Emergent Network Field Day

From Makers Local 256
Revision as of 20:39, 22 January 2013 by Strages (Talk | contribs)

Jump to: navigation, search

Creator:
Strages
Status:
Planning
Born On:
21:17, 26 September 2011 (CDT)
Last Updated:
20:39, 22 January 2013 (CDT)

Overview

Building a wireless mesh network up with DNS, captive portal webpage, and communication infrastructure. A tiny "internet" for disaster stricken areas.


Goals

  • Portable power
    • batteries, solar, wind turbines, etc
  • Mesh network nodes capable of being run on available power.
    • OpenWRT capable devices
  • Various antenna types
  • DNS server
  • DHCP server
  • Captive portal page containing emergency and general information for people joining the network.
  • Communication options
    • IRC
    • BBS?
    • SMS gateway
    • Jabber server
  • QR code ( http://delivr.com/qr-code-generator ) stickers and/or stencils containing a link or information about the network in a given area. Keep with the nodes and/or on the nodes.
  • Have a file repo available and linked off the captive portal containing mesh network packages, etc. Piratebox ( http://wiki.daviddarts.com/PirateBox ) perhaps.
  • Local copies of Wikipedia or Appropedia for reference use.

Location

?

Progress

General

03/30/2012

  • To catch everyone up, as the wiki has been neglected :( :
    • At last count we have 3 WRT54G devices meshing using Brimstone's custom slim build.
    • strages purchased/obtained 8 TP-Link wr710N wireless routers, 3 of which have been flashed with openwrt.
    • strages purchased a fair sized clear blue water proof box and an 1800mAh battery pack that might work well for the wr710n's. Testing will ensue.
    • strages purchased a 45W solar array with power converter for use with the field day portion of this project.
    • strages purchased a 5W solar panel for use with the field day portion of this project.

07/09/2012

  • Stopped by Batteries+ and found 42Ah AGM battery for $76.99 and battery boxes for $12.99. The battery boxes should provide decent weather proofing so long as they're not submerged. Might want to paint them white so as to not absorb so much heat (they're black plastic). Still trying to workout a small footprint solar charging solution.

01/21/2013

  • Successfully configured an AP and adhoc(mesh) interface on 3 of the 8 routers and they all function properly! Mesh is mesh and AP let's everyone connect into the network over wireless. Still some configuration I have to setup for the physical LAN interfaces. Thanks to this website I now have a uci config that involves 2 line changes per device.

From Twitter

  • strages Huzzah! First mesh node toward @krs and I's emergent network plans. #makerslocal 26 Sep
  • strages Huzzah! Freifunk wiki.freifunk.net/Freifunk_Firmw… flashed to the first mesh node! #makerslocal #opensourcemesh 27 Sep
  • strages Achievement unlocked! JimShoe found a wrt-54gv2 in a box. Yay for having a second node! #makerslocal #opensourcemesh 28 Sep
    • Later found to be a WAP54G v2
  • strages Ran down some rather nice tutorials for setting up mesh networks using Freifunk. This should help. #makerslocal 29 Sep
  • strages wewt! third mesh node obtained! #makerslocal 3 Oct
  • strages Totally got a WAP54gv2(Yancey) and WRT54gv5(Josh) meshing with OLSR :D #makerslocal 4 Oct
  • strages Alright, unbricked the third node again. Loaded dd-wrt with olsr on it. Might have it talking to the others in the mesh. #makerslocal 6 Oct
  • strages 4th mesh node obtained! Brother-in-law gave me a WRT160N :D #makerslocal 7 Oct
  • strages Fifth wireless mesh node obtained! A WRT54G v2.2 with swappable antennas! I shall call it Lincoln after where I got it. #makerslocal 13 Oct
  • strages Wifi mesh project update: five nodes, three water proof enclosures, one solar panel. Four more nodes in the future. #makerslocal 14 Oct
  • strages Found another water proof box! Bringing the total up to 4 :D #makerslocal #mesh 15 Oct
  • strages Found node six while unpacking boxes at the shop! :D ...and it shall be called Butterscotch #makerslocal 17 Oct
  • strages Huzzah the 3 new mesh nodes from Birmingham showed up! Thanks @xhizu :D #makerslocal 02 Dec
  • strages Looking heavily into http://smesh.org for my mesh network project. Working on finding or compiling a newer image to load. 04 Jan
  • strages Settling on kmod-batman-adv for my mesh network. Layer 2 routing for the win. #makerslocal 06 Jan
  • strages Just ordered 3 TP-Link TL-WR703N for my mesh network project. #makerslocal 13 Jan
  • strages @brimston3 is working pretty hard on a openwrt backfire image for 2MB devices containing batman-adv #makerslocal 16 Jan
  • brimstone Got #openwrt finally under 2MB for this wrt54gs for @strages' mesh at #makerslocal 20 Jan
  • strages Huzzah! TP-Link WR703Ns have arrived! Time to get back to work on mesh nodes! #makerslocal 19 March
  • strages Huzzah! All 8 wr703n APs flashed with openwrt. Now to get them all meshing... #makerslocal 31 March
  • strages Huzzah! Three wr703n's meshing! #ranoutofusbports #makerslocal http://pic.twitter.com/0vg5cHMb 07 Apr

From IRC

01/13/12

  • <brimstone> 03:00:31 +brimstone | !note strages* At this point in our program, brimstone takes a victory lab as Josh is now running a usable openwrt.
  • <brimstone> 03:01:38 +brimstone | 1708032 works
  • <brimstone> 03:02:47 +brimstone | 1773568 doesn't
  • <brimstone> 03:06:18 +brimstone | i could hack it in there like this one
  • <brimstone> 03:09:01 +brimstone | let's see if i can sneak batman-adv into it now
  • <brimstone> 03:11:02 +brimstone | !note strages* Now turn to page 2: batman_adv: B.A.T.M.A.N. advanced 2011.2.0 (compatibility version 12) loaded
  • <brimstone> 03:12:35 +brimstone | !note strages* i apparently have removed wifi drivers, this is a beast for another day, monday perhaps

01/17/12

  • [23:16] <+brimstone> !note strages* wifi passes traffic in adhoc mode

01/18/12

  • [08:56] <strages_work> how did you get it working?
  • [08:56] <+brimstone> which part?
  • [08:56] <strages_work> I guess what I'm asking, what had to be removed to get wifi and batman-adv in there
  • [08:57] <+brimstone> ssh, firewall support, anything crypto related
  • [08:57] <+brimstone> usb and network file system support from the kernel
  • [08:57] <+brimstone> some wireless regulation stuff (crda)
  • [08:58] <+brimstone> pretty progress bars off wget
  • [08:58] <+brimstone> a hand full of other things
  • [08:58] <+brimstone> i don't remember all right now
  • [09:06] <strages_work> fantastic work
  • [09:06] <strages_work> thank you
  • [09:09] <+brimstone> it's not quite done
  • [09:09] <+brimstone> there's still not a good way to change configurations
  • [09:11] <strages_work> but one can be set initially?
  • [09:12] <+brimstone> yes, but i'm not sure if that's a good thing to do

01/19/12

  • [14:44] <+brimstone> strages_work: why did i ask you to send me that lsmod and dmesg output?
  • [14:45] <strages_work> oh, you were going to check what driver they were using to do VAPs
  • [14:46] <strages_work> you might find some other interesting stuff in there as well
  • [14:47] <+brimstone> it's interesting that a lot of the hardware's the same
  • [14:47] <strages_work> right
  • [14:48] <strages_work> *it's mostly just memory contraints
  • [14:48] <strages_work> cheaper manufacturing
  • [14:48] <+brimstone> i think the multiple VAPs are controlled by hostapd, and i don't have space for that graaaaa

01/20/12

  • 17:19 <+brimstone> strages_work: i tweaked the lzma settings and saved another k out of the kernel
  • 17:51 <+brimstone> Kernel: Old: 809812 New: 784844 Size change: -24968
  • 17:51 <+brimstone> Busybox: Old: 407679 New: 407679 Size change: 0
  • 17:51 <+brimstone> Squashfs: Old: 846014 New: 845889 Size change: -125
  • 17:51 <+brimstone> TRX: Old: 1794048 New: 1765376 Size change: -28672
  • 17:51 <+brimstone> Room: 4096
  • 17:51 <+brimstone> It's good!
  • 17:57 < strages_shop> :D
  • 17:57 <+brimstone> this might be it
  • 17:57 <+brimstone> but it may still give you problems
  • 17:57 < strages_shop> oh man oh man oh man
  • 17:57 <+brimstone> i removed some of the routing stuff
  • 17:57 <+brimstone> and the qos
  • 17:57 <+brimstone> and some queuing stuff
  • 17:57 < strages_shop> hmm
  • 17:58 <+brimstone> but it's got batman, and wifi firmware, and it's small enough to flash
  • 17:58 < strages_shop> works on Josh?
  • 17:58 <+brimstone> yup

01/21/12

  • 14:28 <+brimstone> strages_home: you didn't tell me these routers only had 8MB of ram too
  • 14:35 < strages_home> I didn't know it was an issue :(
  • 14:35 <+brimstone> yup
  • 14:36 <+brimstone> i've got butterscotch in a weird state too
  • 14:36 <+brimstone> boots up fine, then does something to corrupt itself
  • 14:42 < strages_home> hmm
  • 14:43 <+brimstone> i'm reflashing butterscotch with stock openwrt
  • 14:43 <+brimstone> leaves him at least usable
  • 14:44 < strages_home> kk
  • 14:44 < strages_home> he's a 2.2 which means that's fine
  • 14:44 <+brimstone> yeah, but my firmware should have worked
  • 14:45 <+brimstone> so there's debugging that
  • 14:45 < strages_home> oh you were testing it for use on all the devices, not just the 2MB ones
  • 14:45 <+brimstone> yup
  • 14:46 < strages_home> buterscotch is 4MB
  • 14:46 <+brimstone> right
  • 14:46 <+brimstone> why does the 1.7MB firmware fail?
  • 14:46 < strages_home> not a clue
  • 14:47 < strages_home> check lsmod and dmesg dumps for differences?
  • 14:47 <+brimstone> probably the jffs2 stuff getting in the way
  • 15:06 <+brimstone> yup, the jffs2 stuff
  • 15:11 <+brimstone> pfft, batctl wants a debugfs
  • 15:13 < strages_home> don't need it
  • 15:38 <+brimstone> debugfs is so biiiiiiig
  • 15:39 <+brimstone> +70k!
  • 17:54 <+brimstone> Mesh: Built

01/23/12

  • [09:56] <strages_work> brimstone: is there a config being written somewhere on Josh that contrains all the settings for the mesh?
  • [09:56] <+brimstone> no, josh doesn't have room to save configs
  • [09:57] <+brimstone> but /etc/init.d/mesh-setup and /etc/init.d/mesh-finish are the static files i hard coded into the firmware to set it up
  • [09:57] <strages_work> ok
  • [09:59] <strages_work> I'm thinking we need to replicate those settings in a config file for the 4MB devices and just run straight openwrt 10.3.1 on them. This would let us use tools like batctl etc on at least some of the devices.
  • [10:01] <+brimstone> we could also just pull the batctl binary from the package and replace it on the 4MB ones
  • [10:01] <+brimstone> the stock firmware has a lot of extra baggage
  • [10:01] <+brimstone> ppp, luci, etc
  • [10:03] <strages_work> can hostap be installed like that as well?
  • [10:03] <+brimstone> yes
  • [10:04] <strages_work> ok
  • [10:06] <strages_work> so right now, we can install your openwrt image on all the devices (at least the ones we've tested thus far), they'll mesh, and we add packages as needed given room on the device?
  • [10:06] <+brimstone> should be able to
  • [10:06] <+brimstone> i made sure opkg was still on there
  • [10:07] <strages_work> alright because I'm shooting for as little setup time as possible given that it's supposed to be an emergency network
  • [10:08] <strages_work> there are a few spinoff ideas after I finish this one utilizing the same or similar setup
  • [10:09] <strages_work> like having them in client mode on one of the virtual aps and auto connection to open wireless networks effectively extending the range of existing infrastructure
  • [10:09] <strages_work> *auto connecting
  • [10:10] <+brimstone> that'll be gross if you're not careful
  • [10:10] <strages_work> right, it's just an idea
  • [10:10] <+brimstone> as long as you're only linking to one network it should be ok
  • [10:11] <strages_work> or use a decent routing protocol to prevent routing loops
  • [10:12] <+brimstone> it's more then that
  • [10:12] <+brimstone> you can't link to 192.168.1.0/24 networks, you'll get conflicting ips
  • [10:12] <+brimstone> you'll knock valid users off networks, or your own users
  • [10:13] <strages_work> that seems fixable by using some other network range though by default...
  • [10:13] <+brimstone> you don't control the open wifis you're connecting to
  • [10:13] <+brimstone> you might be able to do some double/triple nat weirdness, but that's gross
  • [10:15] <strages_work> sure I would have difficulty hosting services on the network, but that wasn't really the plan
  • [10:15] <+brimstone> you also start limited the range as you're adding additional TTLs
  • [10:15] <+brimstone> or subtracting as the case may be
  • [10:15] <strages_work> true
  • [10:17] <strages_work> regardless this is all hypothetical right now. Getting everything working as an emergency network is the plan then it's building communication services on top of that
  • [10:17] <+brimstone> yup
  • [10:17] <strages_work> captive portal, message board, chat, possibly crude voip
  • [10:18] <strages_work> I wonder if android can do batman-adv

Google+

  • Matt Robinson - I might finally have it. Will start testing tonight. 04:38PM 17 Jan

Nodes

  1. Linksys WRT54GS v5 (Josh)
    • S/N: CGN70F2A6509
    • OS: custom OpenWrt Backfire 10.03.1 w/ kmod-batman-adv
    • Owner: strages
    • Mesh IP: 192.168.10.102
  2. Linksys WRT54G v2.2 (Lincoln)
    • S/N: CDF70DCM4969
    • OS: custom OpenWrt Backfire 10.03.1 w/ kmod-batman-adv
    • Owner: strages
    • Mesh IP: 192.168.10.100
    • Status: locked out because of root password being set and no ssh
  3. Linksys WRT54G v2.2 (Butterscotch)
    • S/N: CDF70DCE1873
    • OS: custom OpenWrt Backfire 10.03.1 w/ kmod-batman-adv
    • Owner: strages
    • Mesh IP: 192.168.10.101
  4. TP-Link wr703n (blue leader)
    • S/N: 12116803322
    • OS: OpenWRT ATTITUDE ADJUSTMENT (bleeding edge, r30919)
    • Owner: strages
    • WLAN IP:
    • LAN IP:
  5. TP-Link wr703n (blue1)
    • S/N: 12116801066
    • OS: OpenWRT ATTITUDE ADJUSTMENT (bleeding edge, r30919)
    • Owner: strages
    • WLAN IP:
    • LAN IP:
  6. TP-Link wr703n (blue2)
    • S/N: 12116802930
    • OS: OpenWRT ATTITUDE ADJUSTMENT (bleeding edge, r30919)
    • Owner: strages
    • WLAN IP:
    • LAN IP:10.100.1.2
  7. TP-Link wr703n (blue3)
    • S/N: 11C35603301
    • OS: OpenWRT ATTITUDE ADJUSTMENT (bleeding edge, r30919)
    • Owner: strages
    • WLAN IP:
    • LAN IP:10.100.1.3
  8. TP-Link wr703n (blue4)
    • S/N: 11C35603745
    • OS: OpenWRT ATTITUDE ADJUSTMENT (bleeding edge, r30919)
    • Owner: strages
    • WLAN IP:
    • LAN IP:
  9. TP-Link wr703n (blue5)
    • S/N: 11C35603488
    • OS: OpenWRT ATTITUDE ADJUSTMENT (bleeding edge, r30919)
    • Owner: strages
    • WLAN IP:
    • LAN IP:
  10. TP-Link wr703n (blue6)
    • S/N: 11C35603174
    • OS: OpenWRT ATTITUDE ADJUSTMENT (bleeding edge, r30919)
    • Owner: strages
    • WLAN IP:
    • LAN IP:
  11. TP-Link wr703n (blue7)
    • S/N: 11C35603510
    • OS: OpenWRT ATTITUDE ADJUSTMENT (bleeding edge, r30919)
    • Owner: strages
    • WLAN IP:
    • LAN IP: 10.100.1.7

Costs

Notes

  • a 7Ah battery should run a WRT54G for ~29 hours [1]
  • "And as a reference point, it was found that a 55 AH SLA battery with a 45W amorphous solar panel under decidedly sub-optimal conditions can run a WRT54G indefinitely." [2]
  • With the custom 2MB openwrt-10.3.1 image that brimstone is developing, if there is no mesh IP defined it will assume 192.168.10.2 .
  • Multiple SSIDs cannot be done with the custom 2MB image, but can on the 4MB devices.
    • This is due to the limited number of packages available due to memory constraints.
  • To enter failsafe mode on the wr703n routers, hit the reset switch multiple times immediately upon plugging it in. The blue light will begin blinking rapidly if done correctly. You should now be able to set your ethernet IP to 192.168.1.233 and telnet to 192.168.1.1. Run the command mount_root to mount the root filesystem and edit files to restore connectivity.
    • running the command firstboot restores deafult values

Packages needed

  • terminfo
    • libncurses
      • nano
  • kmod-batman-adv

UCI config

#!/bin/sh

### Main radio0 will broadcast one AP with no encryption 
### and will be bridged together with eth0 and bat0
### Another VAP in adhoc mode is added to main radio0.
### All three adhoc networks are added to bat0 and thus managed by batman-adv

### Node-specific settings
export HOSTNAME="hostman" 
export IP="ip" 

### These parameters should be consistent across all nodes
export NETMASK="255.0.0.0" 
export DNS="" 
export GATEWAY="" 
export PUBLIC_ESSID="makers_mesh"
export PUBLIC_BSSID="DE:AD:BE:EF:CA:FE"
export MESH0_BSSID="CA:CA:CA:CA:CA:00" 
export MESH0_ESSID="mesh0"
export MESH0_CHANNEL="1" 

### Ensure of populating /etc/config/wireless with 
### autodetected wifi-device entries (radioX)
### to get all list_capab and hwmode correct. Otherwise
### OpenWRT might fail to configure the radio properly.
wifi detect >>/etc/config/wireless

### Clear preexisting wifi-iface sections to avoid conflicts or dups
( for i in `seq 0 9` ; do echo "delete wireless.@wifi-iface[]" ; done ) | uci batch -q

### Create /etc/config/batman-adv if it's not there yet.
uci import -m batman-adv </dev/null

echo " 
set system.@system[0].hostname=$HOSTNAME

set batman-adv.bat0=mesh
set batman-adv.bat0.interfaces='mesh0'

#set network.wan.proto=dhcp
set network.lan.ipaddr=$IP
set network.lan.netmask=$NETMASK
set network.lan.dns='$DNS'
set network.lan.gateway=$GATEWAY
set network.lan.ifname='eth0 bat0'
set network.bat0=interface
set network.bat0.ifname=bat0
set network.bat0.proto=none
set network.bat0.mtu=1500
set network.mesh0=interface
set network.mesh0.proto=none
set network.mesh0.mtu=1528

set wireless.radio0=wifi-device
set wireless.radio0.channel=$MESH0_CHANNEL
set wireless.radio0.disabled=0
set wireless.radio0.phy=phy0
set wireless.radio0.macaddr=

add wireless wifi-iface
set wireless.@wifi-iface[-1].device=radio0
set wireless.@wifi-iface[-1].encryption=none
set wireless.@wifi-iface[-1].network=lan
set wireless.@wifi-iface[-1].mode=ap
set wireless.@wifi-iface[-1].ssid='$PUBLIC_ESSID'
set wireless.@wifi-iface[-1].bssid=$PUBLIC_BSSID

add wireless wifi-iface
set wireless.@wifi-iface[-1].device=radio0 
set wireless.@wifi-iface[-1].encryption=none
set wireless.@wifi-iface[-1].network=mesh0
set wireless.@wifi-iface[-1].mode=adhoc 
set wireless.@wifi-iface[-1].bssid=$MESH0_BSSID
set wireless.@wifi-iface[-1].ssid='$MESH0_ESSID'
set wireless.@wifi-iface[-1].mcast_rate=11000 
commit" \
| uci batch

What needs to be done

References