Step-by-step - creating and installing a package for Commotion

2012-10-08 / The Work Department

Here at The Work Department, we've been busy cooking up systems to experiment with applications that utilize node-to-node mesh connections and are eager to share them with you. In particular, some of the example applications that we proposed in our Exploring "Meshaging" post have been taking form. We want to offer you the tools to experiment with what is possible given the unique architecture of a mesh network. The Commotion router software is built atop OpenWRT, a Linux distribution designed for routers and other small devices. OpenWRT has a package management system, and Commotion’s code is kept in a separate feed and package. A developer can integrate additional features into a Commotion network by writing or porting applications and packaging them for OpenWRT. Below, we explain the process of porting and packaging an application (in this case, a small websockets server, ws-routing, and dependencies).


You'll need a few things to follow along:

  1. **A computer! **Assuming you are currently using a computer, this should be easy. Make sure you have some space on your hard drive to download the packages.
  2. **Terminal access and a few common commands.** You'll need these tools, including GIT and Make, to download and compile the latest code from the repositories.
  3. **Wireless Router(s).** This hardware is necessary to serve your mesh network. You can read more details on the hardware that we use here: Installing Commotion on Wireless Nodes.
  4. **Time. **Like a good stew, some of these scripts can take time before they are complete. You might anticipate about one or two hours until you are up and running.
  5. **Friends.** Not required, but collaboratively learning and working together can be an important part of setting up mesh networks.

Step-by-step to mesh networking delight

Once you have the essentials listed above you can start mixing it all together. First, let's build the packages! You can do this by opening your terminal and entering the commands listed below in order. Anything after a number sign (#) is there to provide additional instruction and shouldn't be entered into the command line. The setup scripts and make commands can take time to run, so that would be a great time to read more of the blog or the Mesh Resources wiki.

# Clone the commotion-openwrt repo:
git clone
cd commotion-openwrt
cd ..
# Clone your package repo:
git clone commotion-examples
# Run the package script:
cd commotion-examples
./ # ignore package feed errors
# Configure and build:
cd ../commotion-openwrt/openwrt
make menuconfig # ignore package feed errors
# A ncurses GUI will display:
## Select the commotion-apps submenu
## Select ws-routing as * (static) by pressing Y
## Select exit
## When prompted, choose to save config
make V=99 # build, verbosely
cd bin/ar71xx/

And, voila! You should see a list of files that look something like this: "openwrt-ar71xx-generic-ubnt-bullet-m-squashfs-factory.bin". The file you'll need to flash your wireless router will vary depending on the router hardware. Using that file, follow the instructions provided for Installing Commotion on Wireless Nodes in order flash the router. These Detailed TFTP Instructions also include detailed steps to transfer the file to your router with TFTP.

Get a taste of Commotion

Well done! You have installed Commotion on a your wireless router. After the router restarts, you can disable your wired network and hop on the “commotion_NNNNN_ap” network that should become available. Open a web browser and navigate to any website, which should bring you to the Commotion splash page. Last, you can verify that the ws-routing package is installed by following these steps:

  1. Click "**Go to Password configuration...**"
  2. Click "**Login**" and reset the password if necessary.
  3. The administration menu should appear at the top. Hover over "**System**" and click "**Software**." **ws-routing** should be in the list.

Here's a virtual pat on the back. Now you’ll be ready to install example applications and test them for yourself. In our next post, we’ll show you how to install and use the chat application we developed.