Difference between revisions of "Mesh/WalkThrough"

2,292 bytes removed ,  14:11, 7 December 2013
Bit of cleanup; Moved OpenWRT image build instructions to a separate page.
(Bit of cleanup; Moved OpenWRT image build instructions to a separate page.)
Line 1: Line 1:
The following walk through assumes you're using linux and you have [https://help.ubuntu.com/community/UsingTheTerminal knowledge of the terminal]. The basic idea of getting a node (router) on the mesh consists of flashing (copying files to [https://en.wikipedia.org/wiki/Flash_memory flash memory]) an operating system to node and installing additional drivers and packages. We use [https://openwrt.org/ OpenWRT] as the operating system on our embedded devices (routers), then connect to the node (via [https://en.wikipedia.org/wiki/Secure_Shell SSH]) and install mesh the related software and configure it. This operating system is meant to fit on small amount (4MB) of flash memory.  
The following walkthrough assumes you're using linux and you have [https://help.ubuntu.com/community/UsingTheTerminal knowledge of the terminal]. The basic idea of getting a node (router) on the mesh consists of flashing (copying files to [https://en.wikipedia.org/wiki/Flash_memory flash memory]) an operating system to the node and installing additional drivers and packages. We use [https://openwrt.org/ OpenWRT] as the operating system on our embedded devices (routers), then connect to the node (via [https://en.wikipedia.org/wiki/Secure_Shell SSH]), install the related software and configure it. This operating system is meant to fit on a small amount (4MB) of flash memory.  


=Building an OpenWRT image=
To build an OpenWRT image from scratch, visit this How To: [[Mesh/Build An OpenWRT Image]]
 
If you already have a image of the operating system (firmware), then you can skip this step. If your router has the stock software, then you'll probably have to use a '''factory image''', which has information in the header which allows you to install it. Otherwise, you'll be using a '''sysupgrade image''' (trx image).
 
==Step One: Install Buildroot==
 
The Buildroot is software which will creates your firmware. The Buildroot has feeds associated with it that allow you to add more to your firmware. The feeds are comparable to [https://en.wikipedia.org/wiki/Repository_%28version_control%29 repositories] in linux. There's a [http://wiki.openwrt.org/doc/howto/buildroot.exigence full guide] at OpenWRT, this is a shorter version.
 
*Install svn and git.
*: <code>$ sudo apt-get install subversion build-essential</code>
*: <code>$ sudo apt-get install git-core</code>
*Make a new directory and download the Buildroot.
*: <code>$ mkdir ~/openwrt</code>
*: <code>$ cd ~/openwrt</code>
*: <code>$ git clone git://git.openwrt.org/openwrt.git</code>
*Update Buildroot and install feeds.
*: <code>$ cd ~/openwrt/openwrtt</code>
*: <code>$ ./scripts/feeds update -a</code>
*: <code>$ ./scripts/feeds install -a</code> (if you want to install all feeds)
*Update and Install the Buildroot dependencies
*: <code>$ make defconfig</code> (build list of dependencies)
*: <code>$ make prereq</code> (install dependencies)
 
If you're still missing software, then you'll have to manually install it.
 
==Step Two: Install Feeds==
 
There are other feeds than the standard that you may want to be available to Buildroot. These are the suggested feeds for nodes: 
 
*Find the drivers for your device
*: Determine drivers for your router based on the chipset (ex. Atheros AR9331)
*: Download the [http://wireless.kernel.org/en/users/Drivers driver for the node]. (ex. [http://wireless.kernel.org/en/users/Drivers/ath9k Ath9k])
*Install the driver feed
*: <code>$ ./scripts/feeds install <PACKAGENAME></code> (ex. kmod-ath9k)
 
[http://wiki.openwrt.org/doc/howto/wireless.overview Other feeds for OpenWRT].
 
==Step Three: Build the Firmware==
 
*Run the Buildroot
*: <code>$ make menuconfig</code>
*Configure the firmware (needs it's own article)
*: ''Kernel Modules > Network Support > kmod-ipsec''


=Installing OpenWRT=
=Installing OpenWRT=
Line 104: Line 62:
  curl -F 'nil=nil' http://ubnt:ubnt@192.168.1.20/fwflash.cgi
  curl -F 'nil=nil' http://ubnt:ubnt@192.168.1.20/fwflash.cgi
  echo "FLASHING IN PROGRESS - It will be complete when the system displays two solid green lights for ten seconds."
  echo "FLASHING IN PROGRESS - It will be complete when the system displays two solid green lights for ten seconds."


Note, that if you're flashing AirOS instead, at least the Bullet M5 series will remember setting between firmware upgrades and others may do so too. To reset username / password / ip address and other settings to factory default, first let the router boot, then press and hold the reset button until more lights come on and release. Wait for the factory reset to complete (a minute or two) and try to access 192.168.1.1 in a browser (ensure that your own IP is in the 192.168.1.x range). Note: This procedure seems to have no effect on the Bullet 2 HP, but works on the Bullet M5. It could be that the Bullet 2 HP does not persist settings across firmware upgrades, and so doesn't have the factory reset procedure.  When flashing AirOS on the PicoStation, only one green light will be on when the flash is complete.
Note, that if you're flashing AirOS instead, at least the Bullet M5 series will remember setting between firmware upgrades and others may do so too. To reset username / password / ip address and other settings to factory default, first let the router boot, then press and hold the reset button until more lights come on and release. Wait for the factory reset to complete (a minute or two) and try to access 192.168.1.1 in a browser (ensure that your own IP is in the 192.168.1.x range). Note: This procedure seems to have no effect on the Bullet 2 HP, but works on the Bullet M5. It could be that the Bullet 2 HP does not persist settings across firmware upgrades, and so doesn't have the factory reset procedure.  When flashing AirOS on the PicoStation, only one green light will be on when the flash is complete.
Line 194: Line 151:
option ssid 'sudomesh-backchannel' # You should change the ssid to be unique for development purposes, but for meshing this should be the same for all routers on the mesh
option ssid 'sudomesh-backchannel' # You should change the ssid to be unique for development purposes, but for meshing this should be the same for all routers on the mesh
</pre>
</pre>
Write some of this stuff down for reference later! You might need it!


==Step Two: Network Configuration ==
==Step Two: Network Configuration ==
Line 240: Line 195:
==Step Four: System Configuration ==
==Step Four: System Configuration ==


In /etc/config/system you can set hostname and timezone. This is not strictly necessary for BATMAN to work, but it should be set correctly. The below timezone is correct for the pacific U.S. timezone. The naming convention for hostnames is: <router-model-name>-<some-unique-name-you-choose>
In /etc/config/system you can set hostname and timezone. This is not strictly necessary for BATMAN to work, but it should be set correctly. The below timezone is correct for the Pacific U.S. timezone (PST). The naming convention for hostnames is: <router-model-name>-<some-unique-name-you-choose>


<pre>
<pre>
1,194

edits