welcome: please sign in
location: BattleMeshV3 / NodeConfigScript / Olsr

BattleMeshV3/NodeConfigScript/Olsr here.




opkg update
opkg install olsrd
opkg install olsrd-mod-arprefresh 
opkg install olsrd-mod-dot-draw 
opkg install olsrd-mod-httpinfo
opkg install olsrd-mod-nameservice
opkg install olsrd-mod-txtinfo


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_olsr
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
#
[ -f /etc/config/olsrd ] && rm /etc/config/olsrd

touch /etc/config/olsrd

uci add olsrd olsrd

uci set olsrd.@olsrd[0].IpVersion=4
uci set olsrd.@olsrd[0].DebugLevel=9

uci add olsrd LoadPlugin
uci set olsrd.@LoadPlugin[0]=LoadPlugin
uci set olsrd.@LoadPlugin[0].library=olsrd_arprefresh.so.0.1

uci add olsrd LoadPlugin
uci set olsrd.@LoadPlugin[1]=LoadPlugin
uci set olsrd.@LoadPlugin[1].library=olsrd_dot_draw.so.0.3
uci set olsrd.@LoadPlugin[1].accept="$WIRED_IP"

uci add olsrd LoadPlugin
uci set olsrd.@LoadPlugin[2]=LoadPlugin
uci set olsrd.@LoadPlugin[2].library=olsrd_httpinfo.so.0.1
uci set olsrd.@LoadPlugin[2].port=1978
uci set olsrd.@LoadPlugin[2].Net="0.0.0.0 0.0.0.0"

uci add olsrd LoadPlugin
uci set olsrd.@LoadPlugin[3]=LoadPlugin
uci set olsrd.@LoadPlugin[3].library=olsrd_mdns.so.1.0.0
uci set olsrd.@LoadPlugin[3].NonOlsrIf=eth0

uci add olsrd LoadPlugin
uci set olsrd.@LoadPlugin[4]=LoadPlugin
uci set olsrd.@LoadPlugin[4].library=olsrd_nameservice.so.0.3

uci add olsrd LoadPlugin
uci set olsrd.@LoadPlugin[5]=LoadPlugin
uci set olsrd.@LoadPlugin[5].library=olsrd_txtinfo.so.0.1
uci set olsrd.@LoadPlugin[5].accept="$WIRED_IP"

uci add olsrd Interface
uci set olsrd.@Interface[0]=Interface
uci set olsrd.@Interface[0].interface=wlan

#adding hna4 -- only do this on one node...
#
#uci add olsrd Hna4
#uci set olsrd.@Hna4[-1].netaddr=192.168.42.0
#uci set olsrd.@Hna4[-1].netmask=255.255.255.0

uci commit olsrd


#[edit] Enable the daemon
[ -f /etc/init.d/olsrd ] && {
  /etc/init.d/olsrd enable
  /etc/init.d/olsrd start
} || {
  echo "ERROR: olsrd init script not found..."
  exit 1
}

#[edit] Disable the daemon
#
#[ -f /etc/init.d/olsrd ] && {
#  /etc/init.d/olsrd stop
#  /etc/init.d/olsrd disable
#}


reboot 
exit

olsrd.conf

LoadPlugin "olsrd_txtinfo.so.0.1"
{
PlParam     "port"   "10001"
PlParam     "Accept"   "0.0.0.0"
}

Interface "ath0:0"
{
# IPv4Src 10.10.3.<nodeid>
IPv4Multicast 10.10.3.255
}

BattleMeshV3/NodeConfigScript/Olsr (last edited 2010-06-04 10:41:38 by ZioProto)