Difference between revisions of "Mesh/WalkThrough"

1,268 bytes added ,  09:57, 16 December 2017
major rework
(major rework)
Line 1: Line 1:
This a walkthrough for flashing a node with the sudomesh firmware and then configuring it with makenode. At the end of the walkthrough, you'll be able to plug in your router and join the mesh. The walkthrough assumes you're using a linux-ish (OSX should mostly work) OS and that you have [https://help.ubuntu.com/community/UsingTheTerminal basic 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 then using a software configurator finish setup.
Congratulations on choosing to become part of a People's Open Network! This a walkthrough for flashing a node (a home router) with the SudoMesh's sudowrt-firmware (a custom build of OpenWRT) and then configuring it with makenode (a custom javascript tool developed by SudoMesh). At the end of the walkthrough, you'll be able to plug in your router and join the mesh. The walkthrough assumes you're using a linux-ish OS (mac OSX should work also) and that you have [https://help.ubuntu.com/community/UsingTheTerminal basic knowledge of the terminal]. The basic idea of getting a node 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 then using a software tool finish the setup.


If you do not want to use a per-compiled OpenWRT image, you can build your own from scratch using this how to: [[Mesh/Build An OpenWRT Image]]
If you do not want to use a pre-compiled sudowrt-firmware image, you can build your own from the [https://github.com/sudomesh/sudowrt-firmware source code].
If you do not want to use a SudoMesh's OpenWRT image, you can also install [https://downloads.openwrt.org/ a standard OpenWRT] release and configure it from scratch,


Before you flash your router it is recommended that you read the [[Home and extender nodes#Home_nodes|Home node info]] to find out the router works as a mesh node.
Before you flash your router it is recommended that you read the [[Home and extender nodes#Home_nodes|Home node info]] to find out the router works as a mesh node.


= Preparing Your Laptop =


You will need to install the dependencies for the [https://github.com/sudomesh/makenode makenode] utility developed by the SudoMesh project.
= Install sudowrt-firmware on your router =
Now that you got your first node (read: a home router), you will probably want to learn how to flash it with the latest sudowrt-firmware build, This guide will lead you through the steps for building your very own People's Open node.


== Linux ==
== Download sudowrt-firmware File For a Supported Router ==
 
If you are working with a fresh installation of one of the operating systems list in the compatibility checklist, you will need to install a few pieces of software.
To install them, open your terminal and type the following commands.
 
  sudo apt update
  sudo apt install curl git dropbear
  curl -o- ht<span>tps://</span>raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
  # you may need to close and reopen your terminal before using nvm
  nvm install 7.10
 
=== OS Compatibility checklist ===
 
{| class="wikitable"
! OS !! Compatible !! Link to ISO !! Notes
|-
| Ubuntu 16.06 || yes || ubuntu dot whatever ||
|-
| Ubuntu 14 || please verify || ubuntu dot whatever ||
|-
| Debian Stretch || yes || debian dot whatever ||
|-
| Debian Jessie || yes || debian dot whatever ||
|-
| Arch Linux || yes || archlinux.org || you may have to build dropbear from [https://github.com/mkj/dropbear source]
|-
|}
 
== Mac ==
 
Install the [http://brew.sh/ Homebrew] package manager, then install the required binaries.
 
  brew install nodejs
  brew install git
  brew install npm
  brew install dropbear
  brew install gnu-tar
  brew install fakeroot
 
== Windows ==
 
For the moment, Windows users will have to figure out some of these steps on their own. Completing this process from a Windows machine has not been tested.
 
* Install [https://nodejs.org/en/download/ NodeJS ] - Make sure to install the 'npm package manager', and select to 'Add to Path'
* Install [https://git-scm.com/download/win Git]
* Install Dropbear (no known ports for Windows)
 
= Install OpenWRT on your Router =
 
== Download the Sudomesh OpenWRT Image File For a Supported Router ==


Sudomesh firmware images can be found at [https://builds.sudomesh.org/builds/chaos_calmer/ar71xx/ https://builds.sudomesh.org/builds/chaos_calmer/ar71xx/]
Sudomesh firmware images can be found at [https://builds.sudomesh.org/builds/chaos_calmer/ar71xx/ https://builds.sudomesh.org/builds/chaos_calmer/ar71xx/]
Line 81: Line 33:
Download the image file for your supported router.
Download the image file for your supported router.


== Flash your Router with OpenWRT ==
== Flash Your Router with sudowrt-firmware ==


There are different techniques for flashing each of the routers. Use the links above to the OpenWRT wiki and follow the instructions there to flash the router with the firmware you've downloaded.
There are different techniques for flashing each of the routers. Use the links above to the OpenWRT wiki and follow the instructions there to flash the router with the firmware you've downloaded.
Line 87: Line 39:
For example, if you have a Western Digital MyNet N600, follow these instructions:
For example, if you have a Western Digital MyNet N600, follow these instructions:


=== Reset your new router ===
* Plug one end of the Ethernet cable into your laptop.
* Plug one end of the Ethernet cable into your laptop.
* Plug the other end of the Ethernet cable into one of the normal ports on the router (not the Internet/WAN port).
* Plug the other end of the Ethernet cable into one of the normal ports on the router (not the Internet/WAN port).
Line 94: Line 47:
* Once the front blue is flashing, you can let go of the pin.
* Once the front blue is flashing, you can let go of the pin.


=== Configure your computer's network settings ===
On your laptop edit your network settings to reflect the following:
On your laptop edit your network settings to reflect the following:


* Network Configuration Method: Manual
* Network Manager Method: Manual
* IP Address: 192.168.1.10 (some devices will only accept from this IP)
* IP Address: 192.168.1.10 (some devices will only accept from this IP)
* Subnet Mask: 255.255.255.0
* Subnet Mask: 255.255.255.0
* Gateway: 0.0.0.0
* Gateway: 0.0.0.0
You can also use the command:
  sudo ifconfig eth0 192.168.1.10 netmask 255.255.255.0
where eth0 is the name of your ethernet interface found using ifconfig (other common interface names esp3s0...)


See Network Configuration Guides: [https://sudoroom.org/wiki/Mesh/Network%20Configuration%20for%20Linux Linux] [https://sudoroom.org/wiki/Mesh/Network%20Configuration%20for%20MacOS%20X Mac]
See Network Configuration Guides: [https://sudoroom.org/wiki/Mesh/Network%20Configuration%20for%20Linux Linux] [https://sudoroom.org/wiki/Mesh/Network%20Configuration%20for%20MacOS%20X Mac]


=== Upload sudowrt-firmware ===
In your web browser:
In your web browser:


Line 113: Line 73:
Note: Sometimes the firmware upload will not complete. After you click on 'Upload' You should get a page with a countdown of 120+ seconds. If this does not occur, reboot the router with the pin reset button depressed (as noted above), and try again.
Note: Sometimes the firmware upload will not complete. After you click on 'Upload' You should get a page with a countdown of 120+ seconds. If this does not occur, reboot the router with the pin reset button depressed (as noted above), and try again.


= Configuring Your OpenWRT Router to Work on the Sudomesh Network =


A freshly flashed node will be setup on 172.22.0.1. You will need to configure your machine to use the following network settings to communicate with the node.
== Configure Router to Work on a People's Open Network ==
After flashing sudowrt-firmware to your router you will need to configure it work on the mesh.
 
=== Reconfigure your computer's network settings ===
A freshly flashed node automatically sets its IP address to 172.22.0.1. You will need to configure your laptop to use the following network settings to communicate with the node.


* IP address: 172.22.0.9
* IP address: 172.22.0.10
* Subnet mask:  255.255.255.0
* Subnet mask:  255.255.255.0
* Gateway: 0.0.0.0
* Gateway: 0.0.0.0
Or use the command
  sudo ifconfig eth0 172.22.0.10 netmask 255.255.255.0
where eth0 is the name of your ethernet interface found using ifconfig (other common interface names esp3s0...)


See Network Configuration Guides: [https://sudoroom.org/wiki/Mesh/Network%20Configuration%20for%20Linux Linux] [https://sudoroom.org/wiki/Mesh/Network%20Configuration%20for%20MacOS%20X Mac]
See Network Configuration Guides: [https://sudoroom.org/wiki/Mesh/Network%20Configuration%20for%20Linux Linux] [https://sudoroom.org/wiki/Mesh/Network%20Configuration%20for%20MacOS%20X Mac]
Line 130: Line 98:
After you have successfully flashed your router with OpenWRT, you will need to use [https://github.com/sudomesh/makenode makenode] to complete the setup. makenode registers your node on the peoplesopen network, resulting in the assignment of a 64 IPv4 address subnet to your node, in addition to applying basic configuration.
After you have successfully flashed your router with OpenWRT, you will need to use [https://github.com/sudomesh/makenode makenode] to complete the setup. makenode registers your node on the peoplesopen network, resulting in the assignment of a 64 IPv4 address subnet to your node, in addition to applying basic configuration.


From your terminal, run the following:
=== Preparing your laptop for makenode ===
 
You will need to install the dependencies for the [https://github.com/sudomesh/makenode makenode] utility developed by the SudoMesh project.


  git clone https://github.com/sudomesh/makenode.git
=== Linux ===
  cd makenode
  npm install
  cp settings.js.example settings.js


The default settings in <tt>settings.js</tt> should suffice in most cases, but if you need to make changes, do them in <tt>settings.js</tt>.  
If you are working with a fresh installation of one of the operating systems list in the compatibility checklist, you will need to install a few pieces of software.
To install them, open your terminal and type the following commands.


=== Troubleshooting ===
  sudo apt update
  sudo apt install curl git dropbear
  curl -o- ht<span>tps://</span>raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
  # you may need to close and reopen your terminal before using nvm
  nvm install 7.10


2017/10/26 -- I also needed to replace the `node-uuid` module with `uuid` in order to get this to work, using the following commands:
==== OS Compatibility checklist ====


  npm uninstall --save node-uuid
{| class="wikitable"
  npm install --save uuid
! OS !! Compatible !! Link to ISO !! Notes
|-
| Ubuntu 16.06 || yes || ubuntu dot whatever ||
|-
| Ubuntu 14 || please verify || ubuntu dot whatever ||
|-
| Debian Stretch || yes || debian dot whatever ||
|-
| Debian Jessie || yes || debian dot whatever ||
|-
| Arch Linux || yes || archlinux.org || you may have to build dropbear from [https://github.com/mkj/dropbear source]
|-
|}


=== Mac ===


== Configuring the Home Node ==
Install the [http://brew.sh/ Homebrew] package manager, then install the required binaries.


Make sure the Ethernet cable is connected to the 4th port on the router.
  brew install nodejs
  brew install git
  brew install npm
  brew install dropbear
  brew install gnu-tar
  brew install fakeroot


Once your network configuration is refreshed, use the following command to run the script and configure your node:
=== Windows ===


  ./makenode.js
For the moment, Windows users will have to figure out some of these steps on their own. Completing this process from a Windows machine has not been tested.


If you get the error "no such file or directory", open a new terminal and run this command to ensure that <tt>node</tt> points to your NodeJS executable:
* Install [https://nodejs.org/en/download/ NodeJS ] - Make sure to install the 'npm package manager', and select to 'Add to Path'
* Install [https://git-scm.com/download/win Git]
* Install Dropbear (no known ports for Windows)


  sudo ln -s nodejs node
=== Install and run makenode ===


In the new terminal, return to the 'makenode' source code directory and try again:
From your terminal, run the following:


  git clone https://github.com/sudomesh/makenode.git
  cd makenode
   npm install
   npm install
  cp settings.js.example settings.js
The default settings in <tt>settings.js</tt> should suffice in most cases, but if you need to make changes, do them in <tt>settings.js</tt>.
Make sure the Ethernet cable is connected to the 4th port on the router.
Once your network configuration is refreshed, use the following command to run the script and configure your node:
   ./makenode.js
   ./makenode.js


Line 175: Line 177:
* "private wifi SSID" - this is the wireless SSID name for the private wireless network that will run on this router
* "private wifi SSID" - this is the wireless SSID name for the private wireless network that will run on this router
* "private wifi password" - this is the password for the private wireless network that will run on this router - it must be at least 8 characters long
* "private wifi password" - this is the password for the private wireless network that will run on this router - it must be at least 8 characters long
=== Troubleshooting ===
2017/10/26 -- I also needed to replace the `node-uuid` module with `uuid` in order to get this to work, using the following commands:
  npm uninstall --save node-uuid
  npm install --save uuid
If you get the error "no such file or directory", open a new terminal and run this command to ensure that <tt>node</tt> points to your NodeJS executable:
  sudo ln -s nodejs node
In the new terminal, return to the 'makenode' source code directory and try again:
  npm install
  ./makenode.js


== Testing ==
== Testing ==
Line 185: Line 204:


For more technical details on the internals of the home node, see the [[Mesh/Technical_Overview]]
For more technical details on the internals of the home node, see the [[Mesh/Technical_Overview]]


= Flashing Extender Nodes =
= Flashing Extender Nodes =
95

edits