opentechinstitute / commotion-linux-py

DEPRECATED, see commotion-client - Python implementation of core commotion functions for Linux
Other
3 stars 5 forks source link

Commotion Linux - Python Implementation

INTRODUCTION

This is an initial implementation of core Commotion functionality in the form of a python module (commotionc) and related scripts. None of the code in this bundle is intended to be called directly, but rather serves as a backend for commotion-mesh-applet and nm-applet-olsrd (although if you really want to you can use fallback.py as a basic command-line interface to bring Commotion up and down). Future versions of this code will allow for full command-line control of the Commotion software stack via one unified binary.

PRE-REQUISITES

  1. Confirm that you have a wireless adapter whose driver supports both the cfg80211 kernel interface and ibss mode. A list of drivers that support these features can be found at http://wireless.kernel.org/en/users/Drivers.
  2. Ensure that you are running an up-to-date OS and kernel. Where possible, download and install the newest kernel your OS supports (optimally 3.5 or higher). Many wireless drivers are embedded in the kernel, and some of these have only recently gotten full cfg80211 support.
  3. If you are running an OS that uses a version of wpasupplicant older than v. 1.0, you will either need to recompile wpasupplicant for your platform with support for IBSS_RSN, or install the commotion-wpasupplicant package. If you opt to use commotion-wpasupplicant, your system will only be able connect in "fallback" mode, which entirely bypasses network manager.

INSTALLATION


If you are using Debian, Ubuntu, Mint, or any other Debian-derivative, you can install Commotion by downloading all .deb packages located at https://downloads.commotionwireless.net/linux, and installing them with:

sudo dpkg -i *.deb

If you encounter any dependency errors during this process, simply run:

apt-get install -f

to resolve the problems, and then run the original dpkg command once again.

USAGE

Step 1

Define a new mesh network profile or modify the default profile in /etc/commotion/profiles.d/. You can define as many different network profiles as you wish, one per file. .profile files consist of simple parameter=value pairs, one per line. The default commotionwireless.net.profile file installed by the commotion-mesh-applet package shows all available parameters:

ssid=commotionwireless.net 
#Network name (REQUIRED)
bssid=02:CA:FF:EE:BA:BE
#IBSS cell ID, which takes the form of a fake mac address.  If this field is omitted, it will be automatically generated via an md4 hash of the ssid and channel.
channel=5
#2.4 GHz Channel (REQUIRED)
ip=5.0.0.0
#When ipgenerate=true, ip holds the base address from which the actual ip will be generated.  When ipgenerate=false, ip holds the actual ip that will be used for the connection (REQUIRED)
ipgenerate=true
#See note for ip parameter.  ipgenerate is automatically set to false once a permanent ip has been generated (REQUIRED)
netmask=255.0.0.0
#The subnet mask of the network (REQUIRED)
dns=8.8.8.8
#DNS server (REQUIRED)
psk=meshpassword
#The password required to connect to an IBSS-RSN encrypted mesh network.  When connecting to a network with an encrypted backhaul, this parameter is required.  When connecting to a networking without encryption, the parameter should be omitted entirely.  

Step 2

Once you have either modified the default profile or installed a new one, you will need to force the various Commotion helper applets to reparse the profiles.d directory, like so:

Step 3

Click on the mesh profile you wish to connect to in the list of networks shown by commotion-mesh-applet. If your system is capable of using the "network manager" connection path, Network Manager will activate the specified connection, and nm-applet will display an ad-hoc icon once you are connected. If your system relies on the "fallback" connection path, Network Manager will be put to sleep when the mesh network is activated, and will remain so until the mesh connection is deactivated. In the fallback case, all networking mechanics are handled directly by wpasupplicant and calls to ifconfig.

Step 4

When you wish to restore normal networking functionality, click in commotion-mesh-applet.

TROUBLESHOOTING NOTES

BUGS


If you encounter any problems or wish to request features, please add them to our issue tracker:

https://github.com/opentechinstitute/nm-dispatcher-olsrd

BUILDING


If you are on a non-Debian-derivitive GNU/Linux distro, then you'll need to install this manually. We are looking for contributions of packaging to make this easy for people to do.

Check the debian/control file for a list of standard libraries that are required. Here are the other libraries needed:

This project relies heavily on the NetworkManager 0.9.x dbus API, currently via the python-networkmanager library available on pypi:

http://people.redhat.com/dcbw/NetworkManager/NetworkManager%20DBUS%20API.txt http://projects.gnome.org/NetworkManager/developers/api/09/spec.html