[PATCH] Add support for Powerbeam M2 XW

Christian Dresel fff at chrisi01.de
Sa Jan 30 13:12:09 CET 2016


Mit diesen Patch wird die Ubiquiti Powerbeam M2 in der Hardwarefassung XW unterstützt. Es ist möglich das diese Firmware auch auf anderen Geraeten mit XW Hardware und einen Ethernetanschluss funktioniert. Aufgrund von mangelnden Geräten kann ich dies nicht testen.
Die Powerbeam M2 ist ein Richtfunkgerät welches ähnlich wie eine Satellitenschüssel aussieht und etwa 40cm Durchmesser hat. Mit einer angegeben Sendeleistung von max. 28dBm und einer 18dBm Antenne sowie einen sehr kleinen Öffnungswinkel ist sie sehr gut für Punkt zu Punkt Verbindungen geeignet.
Laut OpenWRT Webseite gibt es in der Hardwarefassung XW einen Bug der den Ethernetanschluss unbrauchbar macht. Ich habe den Ethernetport durchgetestet und konnte den Bug nicht feststellen. Somit ist der Ethernetboard wie bei allen anderen Geräten mit nur einem Port frei über die network.mode konfigurierbar.

Signed-off-by: Christian Dresel <fff at chrisi01.de>

	new file:   bsp/ar71xx/root_file_system/etc/network.ubnt-loco-m-xw
	modified:   bsp/board_ar71xx.bsp
	modified:   bsp/default/root_file_system/etc/rc.local.tpl
---
 .../root_file_system/etc/network.ubnt-loco-m-xw    | 33 ++++++++++++++++++++++
 bsp/board_ar71xx.bsp                               |  2 ++
 bsp/default/root_file_system/etc/rc.local.tpl      |  3 ++
 3 files changed, 38 insertions(+)
 create mode 100644 bsp/ar71xx/root_file_system/etc/network.ubnt-loco-m-xw

diff --git a/bsp/ar71xx/root_file_system/etc/network.ubnt-loco-m-xw b/bsp/ar71xx/root_file_system/etc/network.ubnt-loco-m-xw
new file mode 100644
index 0000000..20ac8bd
--- /dev/null
+++ b/bsp/ar71xx/root_file_system/etc/network.ubnt-loco-m-xw
@@ -0,0 +1,33 @@
+WANDEV=eth0
+SWITCHDEV=eth0
+CLIENT_PORTS=""
+WAN_PORTS=""
+BATMAN_PORTS=""
+
+. /etc/network.mode
+
+CLIENTIF="w2ap"
+ETHMESHMAC=
+ROUTERMAC=w2mesh
+
+uci set network.$SWITCHDEV=interface
+uci set network.$SWITCHDEV.ifname=$SWITCHDEV
+uci set network.mesh.ifname="bat0"
+uci set network.eth0.mtu="1500"
+
+
+if [ "$ETHMODE" = "WAN" ] ; then
+  ## Activate for WAN:
+  echo "net.ipv6.conf.$WANDEV.accept_ra_defrtr = 1" >> /etc/sysctl.conf
+  echo "net.ipv6.conf.$WANDEV.accept_ra_pinfo = 1" >> /etc/sysctl.conf
+  echo "net.ipv6.conf.$WANDEV.autoconf = 1" >> /etc/sysctl.conf
+  echo "net.ipv6.conf.$WANDEV.accept_ra_rtr_pref = 1" >> /etc/sysctl.conf
+  uci set network.wan.ifname=$WANDEV
+elif [ "$ETHMODE" = "CLIENT" ] ; then
+  ## Activate Client:
+  CLIENTIF="w2ap eth0"
+  uci set network.mesh.ifname="bat0 $SWITCHDEV"
+else
+  ## Activate BATMAN:
+  uci set network.ethmesh.ifname="$SWITCHDEV"
+fi
diff --git a/bsp/board_ar71xx.bsp b/bsp/board_ar71xx.bsp
index 35bcd6b..1a8e095 100644
--- a/bsp/board_ar71xx.bsp
+++ b/bsp/board_ar71xx.bsp
@@ -12,6 +12,8 @@ board_prebuild() {
 board_postbuild() {
     cp $target/bin/ar71xx/openwrt-ar71xx-generic-ubnt-nano-m-squashfs-*.bin ./bin/
 
+    cp $target/bin/ar71xx/openwrt-ar71xx-generic-ubnt-loco-m-xw-squashfs-*.bin ./bin/
+
     cp $target/bin/ar71xx/openwrt-ar71xx-generic-tl-wr740n-v4-squashfs-*.bin ./bin/
 
     cp $target/bin/ar71xx/openwrt-ar71xx-generic-tl-wr741nd-v2-squashfs-*.bin ./bin/
diff --git a/bsp/default/root_file_system/etc/rc.local.tpl b/bsp/default/root_file_system/etc/rc.local.tpl
index 04663fa..ddf208d 100755
--- a/bsp/default/root_file_system/etc/rc.local.tpl
+++ b/bsp/default/root_file_system/etc/rc.local.tpl
@@ -26,6 +26,9 @@ case "$BOARD" in
     nanostation-m)
         BOARD=ubnt-nano-m
         ;;
+    loco-m-xw)
+        BOARD=ubnt-loco-m-xw
+        ;;
     tl-wa850re)
         BOARD=tl-wa850re-v1
         ;;
-- 
2.1.4




Mehr Informationen über die Mailingliste franken-dev