Add New Page: You are not allowed to add pages Select section/namespace. New page title.
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

project_management:meeting_notes:hack_days:05-04-2012_hackday [2013/11/08 20:00] (current)
Line 1: Line 1:
 +====== Hackday-5412 ======
  
 +===== Commotion Architecture Overview =====
 +
 +
 +===== Remote Update Script =====
 +
 +
 +The existing Freifunk script is located here:
 +<pre>
 +/​usr/​sbin/​remote-update
 +</​pre>​
 +
 +It won't work as is, but we can use it as a framework to build our own script. The first major change is to update the <​pre>​system.@upgrade[0].repository</​pre>​ variable in:
 +<pre>
 +/​etc/​meshconfig/​default/​default
 +</​pre>​
 +
 +This must point to a directory containing the most up-to-date builds of Commotion, with the long file names identifying each separate build, as we have it now.
 +
 +Actually identifying the file we need will be the main problem here. The script function *find_image()* must be modified to contain the proper filename for the file we are using. It should look something more like:
 +<pre>
 +find_image()
 +{
 + case "​$1"​ in
 + atheros)
 + echo "​openwrt-atheros-combined.squashfs.img"​
 + ;;
 + ar71xx)
 + echo "​openwrt-ar71xx-ubnt-bullet-m-squashfs-sysupgrade.bin"​
 + ;;
 + brcm)
 + echo "​openwrt-brcm-2.4-squashfs.trx"​
 + ;;
 + esac
 +}
 +</​pre>​
 +
 +Of course, this is very architecture dependent, in the above example if the proper flags were set to *ar71xx* then we would just get the image for the Ubiquiti Bullet or Picostation M, which wouldn'​t work with any of the other Ubiquiti products, or other things with the AR71XX Atheros chipset.
 +
 +There is also an issue with determining the architecture in the first place - the *find_architecture()* function currently returns the number 1.  It is using the command
 +<pre>
 +opkg list_installed kernel
 +</​pre>​
 +to determine the running kernel, which returns *kernel - 3.2.15-1-618bc01082ca0e501adf6edc24ac9f7f* at the moment. ​ This is then parsed, and the numeral "​1"​ located after a dash is returned. If we can create more helpful kernel names, or insert variables in the various images, we can then have architecture and model variables that will be helpful in determining the correct image to return.
 +
 +Once the above issues are resolved, then secure signing of images can be tackled. As things stand the environment variables and script need a lot of work before we can get there.
 +
 +
 +h2. Collectd
 +
 +"​Collectd":​http://​collectd.org/​ is a statistical collection and transfer service that runs on the OpenWTR platform. The Luci web administration interface collects and displays information that is collected by collectd. During the HackDay we focused on configuring the network plugin for nodes to send data collected to a collectd configured server. ​
 +
 +A "​collectd daemon on a node must be pre-configured when building the router-build in "​OpenWRT":​http://​wiki.openwrt.org/​doc/​howto/​statistic.collectd. In order to conserve space the build only loads the requested packages into the collectd build, so further customisation on the node will lead to errors. In order to connect a node to a network the "​network":​http://​collectd.org/​wiki/​index.php/​Plugin:​Network plugin must be enabled in the OpenWRT menuconfig. "Intro to network configuration":​http://​collectd.org/​wiki/​index.php/​Networking_introduction The collectd configuration that we used on our pico-station (/​etc/​collectd.conf) follows. Note: SERVER ADDRESS & PORT are place holders for the final configurations.
 +
 +<pre>
 +BaseDir "/​var/​run/​collectd"​
 +Include "/​etc/​collectd/​conf.d"​
 +PIDFile "/​var/​run/​collectd.pid"​
 +PluginDir "/​usr/​lib/​collectd"​
 +TypesDB "/​usr/​share/​collectd/​types.db"​
 +Interval 30
 +ReadThreads 2
 +
 +LoadPlugin memory
 +
 +LoadPlugin cpu
 +
 +LoadPlugin load
 +
 +LoadPlugin iptables
 +
 +LoadPlugin conntrack
 +
 +LoadPlugin tcpconns
 +<Plugin tcpconns>​
 +        ListeningPorts false
 +        LocalPort 22
 +        LocalPort 80
 +</​Plugin>​
 +
 +LoadPlugin iwinfo
 +<Plugin iwinfo>
 +        IgnoreSelected false
 +</​Plugin>​
 +
 +LoadPlugin processes
 +<Plugin processes>​
 +        Process uhttpd
 +        Process dnsmasq
 +        Process dropbear
 +</​Plugin>​
 +
 +LoadPlugin interface
 +<Plugin interface>​
 +        IgnoreSelected false
 +        Interface "​br-lan"​
 +        Interface "​br-ff"​
 +</​Plugin>​
 +
 +LoadPlugin rrdtool
 +<Plugin rrdtool>
 +        DataDir "/​tmp/​rrd"​
 +        RRARows 100
 +        RRASingle true
 +        RRATimespan 3600
 +        RRATimespan 86400
 +        RRATimespan 604800
 +        RRATimespan 2678400
 +        RRATimespan 31622400
 +</​Plugin>​
 +
 +LoadPlugin olsrd
 +<Plugin olsrd>
 +        Host "​127.0.0.1"​
 +        Port "​2006"​
 +</​Plugin>​
 +
 +LoadPlugin network
 +<Plugin network>
 +        Server "​SERVER ADDRESS"​ "​PORT"​
 +        Forward false
 +</​Plugin>​
 +
 +
 +</​pre>​
 +
 +The network plugin acts an an output directly from the nodes data to the server. The secondary output function on the node and server determine the way that data is written to local files. Because of this we chose to store data as RRD files on the routers to save space, and as CSV fields on the server to allow for easy manipulation and analysis of the data.
 +
 +Once the network plugin has been configured on both sides to point to the same location the types.db must be updated to include a OpenWRT specific variable at the end of the file. Add <​pre>​stations ​               value:​GAUGE:​0:​256</​pre>​ to the end of the <​pre>​usr/​share/​collectd/​types.db</​pre>​ file.
 +
 +Once this has been completed and the node has been brought online the server and node will both collect data locally. The Luci Configuration screen also has options for frequency of collection that can be customised for the users needs. ​
 +
 +Because we store node data as RRD files, which write over themselves as they collect data, the Luci visualizers graphs will only update as long as a user is logged into a node. This can create confusion if a user is interested in past data about a node. For this reason we suggest making the server side CSV data available to end-users through an alternative web-interface. We have to implement this type of feature. ​
 +===== 
 +Remote Node Access over VPN =====
 +
 +
 +  * N2N is a good option, but is oddly centralized for a mesh setting.  ​
 +  * Things to investigate:​ Robustness/​resilience of supernodes; whether or not linked supernodes actually share their indexes with each other.
 +  * Make all Gateway nodes supernodes by default?
 +  * Best place for stop-gap cron-job solution: a Luci plugin.  ​
 +  * Useful links:
 +
 +http://​wiki.freifunk.net/​N2n
 +http://​www.ntop.org/​products/​n2n/​
 +http://​linux.die.net/​man/​8/​edge
 +
 +===== 
 +Web Interface Themeing =====
 +
 +
 +Want to base next version of OpenWRT admin interface on the "​bootstrap"​ theme in LuCI. Tried to combine the Commotionwireless.net css file "​html-reset.css"​ with the existing bootstrap css file, "​cascade.css,"​ but too many incompatibilities to do easily.
 +
 +Relevant LuCI file hierarchies (in the "​working"​ branch, couldn'​t get "​stable"​ branch to build localhost):
 +
 +./​themes/​THEMENAME/​htdocs/​luci-static/​THEMENAME/​ contains cascade.css,​ favicon.ico,​ html5.js.
 +./​themes/​THEMENAME/​dist/​www/​luci-static/​THEMENAME/​ contains cascade.css,​ favicon.ico,​ html5.js.
 +./​themes/​THEMENAME/​luasrc/​view/​themes/​THEMENAME/​ contains footer.htm, header.htm. header.htm includes a line that auto-generates the css reference to cascade.css in every html file that makes up the web interface - so adding a different css file generating line after this line will follow to every other html page that makes up the web interface once you run "make runuhttpd"​ if you include a different css file in /host/... described below.
 +
 +When you run "make runuhttpd"​ within the LuCI folder, it creates a "​host"​ folder that provides a virtual web environment you access from localhost:​8080. This is how you test virtually theme changes. The actual CSS file that the web server references is at:
 +
 +./​host/​www/​luci-static/​THEMENAME/​ which contains cascade.css,​ favicon.ico,​ html5.js.
 +
 +RECOMMENDATIONS:​
 +
 +1: merge Commotionwireless.net css file with the bootstrap theme css file so the base bootstrap theme comes with all of the commotion branding, including images, fonts and colors.
 +2: replace favicon.ico with the Commotion branded favicon.
 +3: Once the above two things function, merge the existing Commotion custom theme edits with this theme. Make this the new default theme.
 +
 +===== Things Learned =====
 +
 +
 +In by nine
 +start by 9:30-
 +Food lagistics offloaded
 +pre-gaming (agenda, gear, documents, knoweledge,
 +mid-day check in(liunch time)
 +presentations (pacha-a-cha)
project_management/meeting_notes/hack_days/05-04-2012_hackday.txt · Last modified: 2013/11/08 20:00 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported