Size: 2531
Comment:
|
← Revision 4 as of 2014-03-08 08:44:25 ⇥
Size: 3468
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 2: | Line 2: |
= batman-adv = |
|
Line 5: | Line 7: |
'''This one from the WBM2 not needed because of AllNodes-Config-Script''' | |
Line 65: | Line 67: |
reboot exit }}} |
|
Line 66: | Line 71: |
#[edit] Enable daemon # |
== start/stop/loglevel config commands == === Enable daemon === {{{ |
Line 69: | Line 75: |
/etc/init.d/batman-adv-kernelland enable /etc/init.d/batman-adv-kernelland start |
/etc/init.d/batman-adv enable /etc/init.d/batman-adv start |
Line 75: | Line 81: |
}}} | |
Line 76: | Line 83: |
=== Disable daemon === {{{ [ -f /etc/init.d/batman-adv-kernelland ] && { /etc/init.d/batman-adv stop /etc/init.d/batman-adv disable } }}} |
|
Line 77: | Line 91: |
#[edit] Disable daemon # #[ -f /etc/init.d/batman-adv-kernelland ] && { # /etc/init.d/batman-adv-kernelland stop # /etc/init.d/batman-adv-kernelland disable #} |
=== Enable batman-remote-logger === {{{ [ -f /etc/init.d/batman-remote-logger.sh ] && { /etc/init.d/batman-remote-logger.sh enable /etc/init.d/batman-remote-logger.sh start } }}} |
Line 84: | Line 99: |
#[edit] Enable batman-remote-logger # #[ -f /etc/init.d/batman-remote-logger.sh ] && { # /etc/init.d/batman-remote-logger.sh enable # /etc/init.d/batman-remote-logger.sh start #} |
=== Disable batman-remote-logger === {{{ [ -f /etc/init.d/batman-remote-logger.sh ] && { /etc/init.d/batman-remote-logger.sh stop /etc/init.d/batman-remote-logger.sh disable } }}} |
Line 91: | Line 107: |
#[edit] Disable batman-remote-logger # #[ -f /etc/init.d/batman-remote-logger.sh ] && { # /etc/init.d/batman-remote-logger.sh stop # /etc/init.d/batman-remote-logger.sh disable #} |
=== Verbose BATMAN log-level === {{{ [ -f /usr/sbin/batctl ] && { batctl ll 3 } }}} |
Line 98: | Line 114: |
#[edit] Verbose BATMAN log-level # #[ -f /usr/sbin/batctl ] && { # batctl ll 15 #} |
=== Quiet BATMAN log-level === {{{ [ -f /usr/sbin/batctl ] && { batctl ll 0 } }}} |
Line 104: | Line 119: |
#[edit] Quiet BATMAN log-level # #[ -f /usr/sbin/batctl ] && { batctl 0 } |
== remote-logger.sh (on each node) WIP, untested yet! == {{{ #!/bin/sh /etc/rc.common START=95 |
Line 108: | Line 124: |
reboot exit |
start () { # set up log server for blocking logfiles mkfifo /tmp/batman-adv.log cat << EOF > /tmp/logserver.sh #!/bin/sh while [ 1 ]; do /usr/bin/netcat -l -p 2050 < /tmp/batman-adv.log done EOF # Log-piper cat << EOF > /tmp/log-piper.sh #!/bin/sh while [ 1 ]; do dmesg | batctl l > /tmp/batman-adv.log sleep 3 done EOF chmod 755 /tmp/logserver.sh chmod 755 /tmp/log-piper.sh /tmp/logserver.sh& /tmp/logpiper.sh& } stop () { killall logserver.sh killall log-piper.sh killall netcat rm /tmp/log-piper.sh rm /tmp/logserver.sh rm /tmp/batman-adv.log } |
BattleMeshV3/NodeConfigScript/Batman here.
batman-adv
This one from the WBM2 not needed because of AllNodes-Config-Script
opkg update opkg install kmod-batman-adv-kernelland set -a HOSTNAME="@PARAM1@" WIRED_IP="@PARAM2@" WIRELESS_IP="@PARAM3@" CHANNEL="@PARAM4@" CELL="@PARAM5@" # setting wireless config DEVICE=`uci get wireless.@wifi-iface[0].device` uci delete wireless.$DEVICE.disabled uci delete wireless.@wifi-iface[0].network #uci delete wireless.@wifi-iface[0].rate uci set wireless.$DEVICE.channel=$CHANNEL uci set wireless.$DEVICE.hwmode=11g uci set wireless.$DEVICE.txpower=20 uci set wireless.@wifi-iface[0].network=wlan uci set wireless.@wifi-iface[0].ssid=wbm_batman uci set wireless.@wifi-iface[0].encryption=none uci set wireless.@wifi-iface[0].bssid=$CELL uci set wireless.@wifi-iface[0].rate=54M uci set wireless.@wifi-iface[0].bgscan=0 uci set wireless.@wifi-iface[0].mode=ahdemo uci set network.wlan=interface uci set network.wlan.proto=static uci set network.wlan.ipaddr=$WIRELESS_IP uci set network.wlan.netmask=255.255.255.0 uci commit wireless && wifi uci commit network #[edit] Configure the daemon # uci set network.batman=interface uci set network.batman.ifname=bat0 uci set network.batman.proto=static uci set network.batman.ipaddr=$WIRELESS_IP uci set network.batman.netmask=255.255.255.0 #uci set network.batman.gateway="" uci set batman-adv-kernelland.general.interface="$DEVICE" ## Enabling syslogging to remote target ## # #uci set system.@system[0].log_ip="$LOG_IP" uci commit reboot exit
start/stop/loglevel config commands
Enable daemon
[ -f /etc/init.d/batman-adv-kernelland ] && { /etc/init.d/batman-adv enable /etc/init.d/batman-adv start } || { echo "ERROR: couldn't find batman init scripts, exiting..." exit 1 }
Disable daemon
[ -f /etc/init.d/batman-adv-kernelland ] && { /etc/init.d/batman-adv stop /etc/init.d/batman-adv disable }
Enable batman-remote-logger
[ -f /etc/init.d/batman-remote-logger.sh ] && { /etc/init.d/batman-remote-logger.sh enable /etc/init.d/batman-remote-logger.sh start }
Disable batman-remote-logger
[ -f /etc/init.d/batman-remote-logger.sh ] && { /etc/init.d/batman-remote-logger.sh stop /etc/init.d/batman-remote-logger.sh disable }
Verbose BATMAN log-level
[ -f /usr/sbin/batctl ] && { batctl ll 3 }
Quiet BATMAN log-level
[ -f /usr/sbin/batctl ] && { batctl ll 0 }
remote-logger.sh (on each node) WIP, untested yet!
START=95 start () { # set up log server for blocking logfiles mkfifo /tmp/batman-adv.log cat << EOF > /tmp/logserver.sh #!/bin/sh while [ 1 ]; do /usr/bin/netcat -l -p 2050 < /tmp/batman-adv.log done EOF # Log-piper cat << EOF > /tmp/log-piper.sh #!/bin/sh while [ 1 ]; do dmesg | batctl l > /tmp/batman-adv.log sleep 3 done EOF chmod 755 /tmp/logserver.sh chmod 755 /tmp/log-piper.sh /tmp/logserver.sh& /tmp/logpiper.sh& } stop () { killall logserver.sh killall log-piper.sh killall netcat rm /tmp/log-piper.sh rm /tmp/logserver.sh rm /tmp/batman-adv.log }