From: drowe67 Date: Tue, 1 Jul 2014 22:00:25 +0000 (+0000) Subject: mv to attic X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=40a0bba3398fbe00c302e492d478832ed37a4e40;p=freetel-svn-tracking.git mv to attic git-svn-id: https://svn.code.sf.net/p/freetel/code@1726 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/attic/.gitignore b/attic/.gitignore deleted file mode 100644 index e69de29b..00000000 diff --git a/attic/dilimesh/README.txt b/attic/dilimesh/README.txt new file mode 100644 index 00000000..3f8bc562 --- /dev/null +++ b/attic/dilimesh/README.txt @@ -0,0 +1,292 @@ +README.txt for dilimesh +David Rowe +Dec 7 2010 + + +Introduction +------------ + +Simple mesh network mapping application (web app) used as a test bed +for link debugging techniques in the Dili Village Telco. + +* Screen shot: dilimesh_screenshot.png + +* Currently displays packet loss stats as an alternative to batman + scores. The purpose of this project is to experiment with the + display of different information, for example display signal + strength or even a spectrum of local Wifi activity for each nodes. + The goal is gather information to debug problem links. + +* Based on Google maps V3 API. + +* Light weight: On the server we have just a few CGIs and a text file + database. A browser cookie is used for storing configuration + information. The CGIs are a few lines of shell script, so can run + on any machine. Installation involves copying a few files and + setting a few permissions. + +* Loosely coupled design: Can work without any additional software on + each mesh mode, just needs a Visualisation server somewhere in the + mesh. Doesn't affct Mesh Potato operation, or the operation of + other software on the mesh. + + +Using Dilimesh +-------------- + +1/ Point your browser at http://server/dilimesh/dilimesh/html + +2/ Set "Visualisation Server IP" on RHS and reload page. + +3/ Dilimesh will find new nodes automatically. Drag bouncing nodes + to the correct position on map. + +4/ Mouse over or click on a node to get IP and packet loss. If nodes + are running signal strength daemon signal strengths of adjacent + nodes will also be displayed. + +5/ Click on links to get "Distance" stats on lower right hand side. + +5/ Node colours: + * blue - packet loss < 10% + * red - packet loss between 10% and 90% + * black - packet loss > 90% + +5/ "Update Enable" will update packet loss, network links and signal + strength automatically. + + +Status +------ + +* Alpha +* Tested on Firefox 3.5.3 with Apache2 servers running Ubuntu 9 & 10. +* Tested on small 5 node mesh network, might needs tweaks (e.g. fping + arguments) for larger networks + + +Implementation Notes +-------------------- + +Dilimesh is implemented in Javascript (dilimesh.html). A simple text +database file /var/www/dilimesh/nodes.txt is used to store node +locations and IPs. Browser cookies are used to store config +information like our last map location and vis server IP. Very simple +1 page CGIs written in shell script are used to access the node +database. + +The 'Set' buttons on the RHS cause dilimesh.html to reload with CGI +type variables passed to it. However these variables are not used, we +use onclick() methods to change the state variables which are stored +in a cookie when the page exits. + +All the CGI scripts assume a hard coded path of /var/www/dilimesh for +the nodes.txt database. + + +Directories +----------- + +"dilimesh" directory: + + dilimesh.html - all the Javascript for Dilimesh + dilimesh.css - style sheet + node_good.png + node_packet_loss.png + node_dead.png - node icon PNGs, changes with packet loss + +"cgi-bin" directory: + + addnode.cgi - adds a node to nodes.txt + delnode.cgi - deletes a node from nodes.txt + getnodes.cgi - reads nodes.txt database + getvis.cgi - reads vis server data + fpingnodes.cgi - fires off pings for all nodes, returns results + getsig.cgi - reads signal strength of surrounding nodes from one node, + requires sigstr.sh telnet daemon running on node. + +"scripts" directory: + + sigstr.sh - script that runs on MP as a telnet daemon to return signal + strength of each node to getsig.cgi. Experimental. + S99sigstr - /etc/init.d Mesh Potato start upscript for sigstr.sh telnet + daemon + +Software +-------- + +You need: + +1/ A web server. Apache is assumed in the /usr/lib/cgi-bin path below. + The paths may be different for other web servers. Note the path + to /var/www/dilimesh is hard coded in the CGI scripts so it's + best not to change that. + +2/ netcat (nc) and fping installed on the server. Note that on Ubuntu + we found that netcat 1.10.38 was required, netcat-openbsd would not + work. + +3/ A Batman mesh network with the vis server on one of the nodes, this + may already be running on your supernode. Batman on each node should + be configured for the vis server (e.g. -s 10.130.1.1) + +4/ A route from the web server PC to the mesh network. On the Ubuntu + machine I use as a server I put this script in the file + /etc/network/if-up.d/potato: + + !/bin/sh + # Add interface and routes to connect to potato mesh network + + ifconfig eth0 10.30.1.3 netmask 255.255.255.0 + route add -net 10.130.1.0/24 gw 10.30.1.1 + + This file runs when the machine boots and connects to the Supernode + via Ethernet. + +Installation +------------ + +1/ Server PC + + $ svn co https://freetel.svn.sourceforge.net/svnroot/freetel/dilimesh + $ cd dilimesh + $ sudo mkdir /var/www/dilimesh + $ sudo chmod 777 /var/www/dilimesh + $ cp dilimesh/* /var/www/dilimesh + $ sudo cp cgi-bin/* /usr/lib/cgi-bin + +2/ Supernode + + Configure vis server to work on Wifi and Ethernet interfaces: + + # root@OpenWrt:~# cat /etc/config/vis + config vis general + option 'interface' 'ath0 eth0' + + If it's running OK you should see a process like: + + # ps | grep vis + 711 root 1508 S vis -j ath0 eth0 + +3/ Batman nodes + + Configure you nodes to use the visualisation server: + + # cat /etc/config/batman + config batmand general + option interface ath0 + option announce + option gateway_class + option originator_interval + option preferred_gateway + option routing_class + option visualisation_srv 10.130.1.1 + option policy_routing_script + + When batman is running with the vis server it should look like: + + # ps | grep batman + 552 root 1564 S batmand -s 10.130.1.1 ath0 + +4/ (Optional) Signal strength daemon: + + Copy these scripts to each MP in your mesh that you wish to read sig + strength from: + + $ cd dilimesh/script + $ scp sigstr.sh root@10.130.1.36:/usr/sbin + $ scp S99sigstr root@10.130.1.36:/etc/rc.d + + Now start daemon on remote machine: + + $ ssh root@10.130.1.36 '/etc/rc.d/S99sigstr' + + Test if daemon is running + + $ telnet 10.130.1.36 4950 + +Tests +----- + +1/ Server PC can reach node with vis server: + + $ ping 192.168.1.100 + +2/ Server PC has route to mesh nodes: + + $ ping 10.130.1.1 + $ ping 10.130.1.2 + +3/ Test you have installed fping: + + $ fping 10.130.1.1 + +4/ Test netcat and vis server: + + $ nc 192.168.1.100 2005 + + HTTP/1.0 200 OK + Content-type: application/json + + [ + { router : "10.130.1.1", neighbour : "10.130.1.23", label : 1.02 }, + { router : "10.130.1.14", neighbour : "10.130.1.56", label : 1.76 } + ] + +5/ Test CGIs: + + Point your browser at: + + http://localhost/cgi-bin/fpingnodes.cgi?ip=10.130.1.1 + +6/ Test reading and writing nodes.txt database with your browser: + + http://localhost/cgi-bin/addnode.cgi?lat=123&lng=456&ip=10.130.1.1 + + $ cat /var/www/dilimesh/nodes.txt + 123,456,10.130.1.1 + + http://localhost/cgi-bin/delnode.cgi?lat=123&lng=456&ip=10.130.1.1 + + $ cat /var/www/dilimesh/nodes.txt + (empty file) + +7/ Test signal strength daemon on each node: + + $ telnet 10.130.1.1 4950 + Trying 10.130.1.36... + Connected to 10.130.1.36. + Escape character is '^]'. + + 10.130.1.1 10.130.1.56 10.130.1.14 + -64 -90 -75 + + +Debugging +--------- + +1/ Monitor Apache log: + + $ tail -f /var/log/apache2/access.log + +2/ Use Firebug on Firefox to single step, set breakpoints etc. + +3/ Check nodes.txt database, each line is (lat, lng, IP): + + # cat /var/www/dilimesh/nodes.txt + + -34.88548650005714,138.55225324630737,10.130.1.56 + -34.88006501016277,138.55394840240479,10.130.1.1 + -34.87893842193011,138.55278968811035,10.130.1.23 + -34.882511765792316,138.55210304260254,10.130.1.14 + -34.880364257566484,138.5518455505371,10.130.1.36 + +4/ The "dilimesh" cookie stores a lot of our state. On Firefox 3.5 you + can remove the dilimesh cookie using Edit-Preferences-Privacy, then + click on "remove individual cookies". + +5/ To reset to defaults: + + * move to another page (cookie is svaed when we exit page) + * rm -f /var/www/dilimesh/nodes.txt + * Delete cookie using setp (4) above diff --git a/attic/dilimesh/cgi-bin/addnode.cgi b/attic/dilimesh/cgi-bin/addnode.cgi new file mode 100755 index 00000000..bd78216e --- /dev/null +++ b/attic/dilimesh/cgi-bin/addnode.cgi @@ -0,0 +1,31 @@ +#!/bin/sh +# addnode.cgi +# David Rowe 4 Dec 2010 +# +# CGI to add a new node + +cat < + + + + + +EOF + +lat=`echo "$QUERY_STRING" | sed -n "s/.*lat=\(.*\)&lng.*/\1/p"` +lng=`echo "$QUERY_STRING" | sed -n "s/.*lng=\(.*\)&ip.*/\1/p"` +ip=`echo "$QUERY_STRING" | sed -n "s/.*ip=\(.*\)/\1/p"` + +echo $lat,$lng,$ip >> /var/www/dilimesh/nodes.txt + +echo $QUERY_STRING "
" +echo "
" +echo $lat $lng $ip + +cat < + +EOF diff --git a/attic/dilimesh/cgi-bin/cleardb.cgi b/attic/dilimesh/cgi-bin/cleardb.cgi new file mode 100755 index 00000000..fa4433c9 --- /dev/null +++ b/attic/dilimesh/cgi-bin/cleardb.cgi @@ -0,0 +1,26 @@ +#!/bin/sh +# cleardb.cgi +# David Rowe 15 Dec 2010 +# +# CGI to delete entire node database + +cat < + + + + + +EOF + +# path to node database text file + +P=/var/www/dilimesh +rm $P/nodes.txt + +cat < + +EOF diff --git a/attic/dilimesh/cgi-bin/delnode.cgi b/attic/dilimesh/cgi-bin/delnode.cgi new file mode 100755 index 00000000..5c8b115e --- /dev/null +++ b/attic/dilimesh/cgi-bin/delnode.cgi @@ -0,0 +1,36 @@ +#!/bin/sh +# delnode.cgi +# David Rowe 4 Dec 2010 +# +# CGI to delete a node + +cat < + + + + + +EOF + +lat=`echo "$QUERY_STRING" | sed -n "s/lat=\(.*\)&.*/\1/pg"` +lng=`echo "$QUERY_STRING" | sed -n "s/.*lng=\(.*\)/\1/pg"` + +# path to node database text file + +P=/var/www/dilimesh + +cat $P/nodes.txt | sed "/$lat,$lng.*/ d" > $P/nodes.tmp +cp $P/nodes.tmp $P/nodes.txt +rm $P/nodes.tmp + +#echo $QUERY_STRING "
" +#echo "
" +#echo $lat $lng + +cat < + +EOF diff --git a/attic/dilimesh/cgi-bin/fpingnodes.cgi b/attic/dilimesh/cgi-bin/fpingnodes.cgi new file mode 100755 index 00000000..d0c19faf --- /dev/null +++ b/attic/dilimesh/cgi-bin/fpingnodes.cgi @@ -0,0 +1,24 @@ +#!/bin/sh +# fpingnodes.cgi +# David Rowe 5 Dec 2010 +# +# CGI to fping a bunch of nodes + +cat < + + + + + +EOF + +ip=`echo "$QUERY_STRING" | sed -n "s/.*ip=//p" | sed "s/,/ /g"` +fping $ip -a -b1400 -r1 2>/dev/null + +cat < + +EOF diff --git a/attic/dilimesh/cgi-bin/getnodes.cgi b/attic/dilimesh/cgi-bin/getnodes.cgi new file mode 100755 index 00000000..7312089a --- /dev/null +++ b/attic/dilimesh/cgi-bin/getnodes.cgi @@ -0,0 +1,30 @@ +#!/bin/sh +# getnodes.cgi +# David Rowe 5 Dec 2010 +# +# CGI to return node list from database text file +# We use a CGI rather than fetching the text file directly +# so we can control Firefox from caching + +cat < + + + + + + +EOF + +NODES=/var/www/dilimesh/nodes.txt + +if [ -f $NODES ] ; then + cat $NODES +fi + +cat < + +EOF diff --git a/attic/dilimesh/cgi-bin/getsig.cgi b/attic/dilimesh/cgi-bin/getsig.cgi new file mode 100755 index 00000000..1850fccf --- /dev/null +++ b/attic/dilimesh/cgi-bin/getsig.cgi @@ -0,0 +1,27 @@ +#!/bin/sh +# getsig.cgi +# David Rowe 6 Dec 2010 +# +# CGI to fetch the signal strength from a node +# Requires the node to be running sigstr.sh script as +# a telnet dameon port 4950 + +cat < + + + + + +EOF + +ip=`echo "$QUERY_STRING" | sed -n "s/.*ip=//p" | sed "s/,/ /g"` +nc $ip 4950 +echo $ip + +cat < + +EOF diff --git a/attic/dilimesh/cgi-bin/getvis.cgi b/attic/dilimesh/cgi-bin/getvis.cgi new file mode 100755 index 00000000..a8723b79 --- /dev/null +++ b/attic/dilimesh/cgi-bin/getvis.cgi @@ -0,0 +1,33 @@ +#!/bin/sh +# getvis.cgi +# David Rowe 4 Dec 2010 +# +# CGI to fetches vis server data +# I am sure it is possible to do this directly from Javascript +# but I am too much of a noob. + +cat < + + + + + +EOF + +VIS_SERVER_HOST=`echo "$QUERY_STRING" | sed -n "s/.*ip=//p"` + +nc $VIS_SERVER_HOST 2005 2>/dev/null >/dev/null +if [ $? -eq 0 ] ; then + nc $VIS_SERVER_HOST 2005 | sed -n "/{/ p" +else + echo "Can't connect to Visualisation Server on $VIS_SERVER_HOST" +fi + +cat < + +EOF + diff --git a/attic/dilimesh/dilimesh/dilimesh.css b/attic/dilimesh/dilimesh/dilimesh.css new file mode 100644 index 00000000..d72344f5 --- /dev/null +++ b/attic/dilimesh/dilimesh/dilimesh.css @@ -0,0 +1,70 @@ +html,body{ + margin:0; + padding:0; + width:100%; + height:100%; + font-family:Arial, Helvetica, sans-serif; +} + +div#header{ + vertical-align:middle; + border-bottom:1px solid #000; +} +div#main-map{ + width:70%; + height:100%; + float:left; +} +div#side{ + width:30%; + float:left; +} + +div#dataPanel{ + width:90%; + height:50%; + overflow:auto; + border:2px solid #DDDDDD; +} +input{ + width:90%; +} + +input.navi{ + font-size:12px; + height:30px; + margin-bottom:10px; +} +div ul{ + margin-top:30px; + margin-bottom:30px; +} +div ul li{ + display: inline; + list-style-type: none; + padding-right: 40px; + font-size:18px; + font-weight:bold; +} + +div ul li.title{ + font-size:22px; + color:#888; +} + +div#header p{ + color:#888; + font-size:14px; + padding-left:20px; +} +span.instruction{ + font-weight:bold; + +} + +.message-box { text-align: center; padding: 5px; color:#545454; width:80%; margin:5px auto; font-size:12px;} +.clean { background-color: #efefef; border-top: 2px solid #dedede; border-bottom: 2px solid #dedede; } +.info { background-color: #f7fafd; border-top: 2px solid #b5d3ff; border-bottom: 2px solid #b5d3ff; } +.ok { background-color: #d7f7c4; border-top: 2px solid #82cb2f; border-bottom: 2px solid #82cb2f; } +.alert { background-color: #fef5be; border-top: 2px solid #fdd425; border-bottom: 2px solid #fdd425; } +.error { background-color: #ffcdd1; border-top: 2px solid #e10c0c; border-bottom: 2px solid #e10c0c; } \ No newline at end of file diff --git a/attic/dilimesh/dilimesh/dilimesh.html b/attic/dilimesh/dilimesh/dilimesh.html new file mode 100644 index 00000000..1c002295 --- /dev/null +++ b/attic/dilimesh/dilimesh/dilimesh.html @@ -0,0 +1,996 @@ + + + + + + +Dili Mesh + + + + + + + + + +
+
+ +
+ +

Help

+ + +
DiliMesh README
+ +
+

Network Stats

+ + + + + +
Time
Nodes Reachable
Nodes Poor Packet Loss
Nodes Total
+
+ +
+

Contol Panel

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Visualisation Server IP
Update Enable
Update Time (s)
Clear Database
Debug Messages
+
+ +

Signal Strength

+ + + + + + + + + + + + + + + + +
Currently Polling
Last Node that
Responded
Results
+ +

Distance

+ + + + + + + + + + + + + + + + +
Distance
Path Loss
Est Rx Signal
+
+ +
+

Tests

+
    +
  1. Test nodes.txt database
    +
  2.  
    +
  3.  
    +
+
+ +
+

Debugging Output

+
    +
+
+
+ + + + diff --git a/attic/dilimesh/dilimesh/node_dead.png b/attic/dilimesh/dilimesh/node_dead.png new file mode 100644 index 00000000..88be5501 Binary files /dev/null and b/attic/dilimesh/dilimesh/node_dead.png differ diff --git a/attic/dilimesh/dilimesh/node_good.png b/attic/dilimesh/dilimesh/node_good.png new file mode 100644 index 00000000..056f1c9b Binary files /dev/null and b/attic/dilimesh/dilimesh/node_good.png differ diff --git a/attic/dilimesh/dilimesh/node_packet_loss.png b/attic/dilimesh/dilimesh/node_packet_loss.png new file mode 100644 index 00000000..58420803 Binary files /dev/null and b/attic/dilimesh/dilimesh/node_packet_loss.png differ diff --git a/attic/dilimesh/dilimesh_screenshot.png b/attic/dilimesh/dilimesh_screenshot.png new file mode 100644 index 00000000..7c260866 Binary files /dev/null and b/attic/dilimesh/dilimesh_screenshot.png differ diff --git a/attic/dilimesh/scripts/S99sigstr b/attic/dilimesh/scripts/S99sigstr new file mode 100755 index 00000000..a33f8162 --- /dev/null +++ b/attic/dilimesh/scripts/S99sigstr @@ -0,0 +1,2 @@ +#!/bin/sh +telnetd -l /usr/sbin/sigstr.sh -p 4950 diff --git a/attic/dilimesh/scripts/sigstr.sh b/attic/dilimesh/scripts/sigstr.sh new file mode 100755 index 00000000..726458a4 --- /dev/null +++ b/attic/dilimesh/scripts/sigstr.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# node_tune.sh +# David Rowe 13 April 2010 +# +# Prints information useful for tuning a mesh node +# +# Useful to run as a telnet login, e.g. +# telnetd -l /usr/sbin/node_tune.sh -p 4950 +# will let you plug a laptop into eth0 and "telnet 192.168.1.20 4950" +# to run this script + + # list of nodes this node can see in IP and MAC order + + IP=`cat /proc/net/arp | grep "10.130.1" | awk '{ print $1 }'` + MAC=`cat /proc/net/arp | grep "10.130.1" | awk '{ print $4 }'` + + echo + echo "sigstr" + echo $IP + for m in $MAC + do + wlanconfig ath0 list | grep $m | awk '{ printf " %s",$6 }' + done + echo + + + + diff --git a/dilimesh/README.txt b/dilimesh/README.txt deleted file mode 100644 index 3f8bc562..00000000 --- a/dilimesh/README.txt +++ /dev/null @@ -1,292 +0,0 @@ -README.txt for dilimesh -David Rowe -Dec 7 2010 - - -Introduction ------------- - -Simple mesh network mapping application (web app) used as a test bed -for link debugging techniques in the Dili Village Telco. - -* Screen shot: dilimesh_screenshot.png - -* Currently displays packet loss stats as an alternative to batman - scores. The purpose of this project is to experiment with the - display of different information, for example display signal - strength or even a spectrum of local Wifi activity for each nodes. - The goal is gather information to debug problem links. - -* Based on Google maps V3 API. - -* Light weight: On the server we have just a few CGIs and a text file - database. A browser cookie is used for storing configuration - information. The CGIs are a few lines of shell script, so can run - on any machine. Installation involves copying a few files and - setting a few permissions. - -* Loosely coupled design: Can work without any additional software on - each mesh mode, just needs a Visualisation server somewhere in the - mesh. Doesn't affct Mesh Potato operation, or the operation of - other software on the mesh. - - -Using Dilimesh --------------- - -1/ Point your browser at http://server/dilimesh/dilimesh/html - -2/ Set "Visualisation Server IP" on RHS and reload page. - -3/ Dilimesh will find new nodes automatically. Drag bouncing nodes - to the correct position on map. - -4/ Mouse over or click on a node to get IP and packet loss. If nodes - are running signal strength daemon signal strengths of adjacent - nodes will also be displayed. - -5/ Click on links to get "Distance" stats on lower right hand side. - -5/ Node colours: - * blue - packet loss < 10% - * red - packet loss between 10% and 90% - * black - packet loss > 90% - -5/ "Update Enable" will update packet loss, network links and signal - strength automatically. - - -Status ------- - -* Alpha -* Tested on Firefox 3.5.3 with Apache2 servers running Ubuntu 9 & 10. -* Tested on small 5 node mesh network, might needs tweaks (e.g. fping - arguments) for larger networks - - -Implementation Notes --------------------- - -Dilimesh is implemented in Javascript (dilimesh.html). A simple text -database file /var/www/dilimesh/nodes.txt is used to store node -locations and IPs. Browser cookies are used to store config -information like our last map location and vis server IP. Very simple -1 page CGIs written in shell script are used to access the node -database. - -The 'Set' buttons on the RHS cause dilimesh.html to reload with CGI -type variables passed to it. However these variables are not used, we -use onclick() methods to change the state variables which are stored -in a cookie when the page exits. - -All the CGI scripts assume a hard coded path of /var/www/dilimesh for -the nodes.txt database. - - -Directories ------------ - -"dilimesh" directory: - - dilimesh.html - all the Javascript for Dilimesh - dilimesh.css - style sheet - node_good.png - node_packet_loss.png - node_dead.png - node icon PNGs, changes with packet loss - -"cgi-bin" directory: - - addnode.cgi - adds a node to nodes.txt - delnode.cgi - deletes a node from nodes.txt - getnodes.cgi - reads nodes.txt database - getvis.cgi - reads vis server data - fpingnodes.cgi - fires off pings for all nodes, returns results - getsig.cgi - reads signal strength of surrounding nodes from one node, - requires sigstr.sh telnet daemon running on node. - -"scripts" directory: - - sigstr.sh - script that runs on MP as a telnet daemon to return signal - strength of each node to getsig.cgi. Experimental. - S99sigstr - /etc/init.d Mesh Potato start upscript for sigstr.sh telnet - daemon - -Software --------- - -You need: - -1/ A web server. Apache is assumed in the /usr/lib/cgi-bin path below. - The paths may be different for other web servers. Note the path - to /var/www/dilimesh is hard coded in the CGI scripts so it's - best not to change that. - -2/ netcat (nc) and fping installed on the server. Note that on Ubuntu - we found that netcat 1.10.38 was required, netcat-openbsd would not - work. - -3/ A Batman mesh network with the vis server on one of the nodes, this - may already be running on your supernode. Batman on each node should - be configured for the vis server (e.g. -s 10.130.1.1) - -4/ A route from the web server PC to the mesh network. On the Ubuntu - machine I use as a server I put this script in the file - /etc/network/if-up.d/potato: - - !/bin/sh - # Add interface and routes to connect to potato mesh network - - ifconfig eth0 10.30.1.3 netmask 255.255.255.0 - route add -net 10.130.1.0/24 gw 10.30.1.1 - - This file runs when the machine boots and connects to the Supernode - via Ethernet. - -Installation ------------- - -1/ Server PC - - $ svn co https://freetel.svn.sourceforge.net/svnroot/freetel/dilimesh - $ cd dilimesh - $ sudo mkdir /var/www/dilimesh - $ sudo chmod 777 /var/www/dilimesh - $ cp dilimesh/* /var/www/dilimesh - $ sudo cp cgi-bin/* /usr/lib/cgi-bin - -2/ Supernode - - Configure vis server to work on Wifi and Ethernet interfaces: - - # root@OpenWrt:~# cat /etc/config/vis - config vis general - option 'interface' 'ath0 eth0' - - If it's running OK you should see a process like: - - # ps | grep vis - 711 root 1508 S vis -j ath0 eth0 - -3/ Batman nodes - - Configure you nodes to use the visualisation server: - - # cat /etc/config/batman - config batmand general - option interface ath0 - option announce - option gateway_class - option originator_interval - option preferred_gateway - option routing_class - option visualisation_srv 10.130.1.1 - option policy_routing_script - - When batman is running with the vis server it should look like: - - # ps | grep batman - 552 root 1564 S batmand -s 10.130.1.1 ath0 - -4/ (Optional) Signal strength daemon: - - Copy these scripts to each MP in your mesh that you wish to read sig - strength from: - - $ cd dilimesh/script - $ scp sigstr.sh root@10.130.1.36:/usr/sbin - $ scp S99sigstr root@10.130.1.36:/etc/rc.d - - Now start daemon on remote machine: - - $ ssh root@10.130.1.36 '/etc/rc.d/S99sigstr' - - Test if daemon is running - - $ telnet 10.130.1.36 4950 - -Tests ------ - -1/ Server PC can reach node with vis server: - - $ ping 192.168.1.100 - -2/ Server PC has route to mesh nodes: - - $ ping 10.130.1.1 - $ ping 10.130.1.2 - -3/ Test you have installed fping: - - $ fping 10.130.1.1 - -4/ Test netcat and vis server: - - $ nc 192.168.1.100 2005 - - HTTP/1.0 200 OK - Content-type: application/json - - [ - { router : "10.130.1.1", neighbour : "10.130.1.23", label : 1.02 }, - { router : "10.130.1.14", neighbour : "10.130.1.56", label : 1.76 } - ] - -5/ Test CGIs: - - Point your browser at: - - http://localhost/cgi-bin/fpingnodes.cgi?ip=10.130.1.1 - -6/ Test reading and writing nodes.txt database with your browser: - - http://localhost/cgi-bin/addnode.cgi?lat=123&lng=456&ip=10.130.1.1 - - $ cat /var/www/dilimesh/nodes.txt - 123,456,10.130.1.1 - - http://localhost/cgi-bin/delnode.cgi?lat=123&lng=456&ip=10.130.1.1 - - $ cat /var/www/dilimesh/nodes.txt - (empty file) - -7/ Test signal strength daemon on each node: - - $ telnet 10.130.1.1 4950 - Trying 10.130.1.36... - Connected to 10.130.1.36. - Escape character is '^]'. - - 10.130.1.1 10.130.1.56 10.130.1.14 - -64 -90 -75 - - -Debugging ---------- - -1/ Monitor Apache log: - - $ tail -f /var/log/apache2/access.log - -2/ Use Firebug on Firefox to single step, set breakpoints etc. - -3/ Check nodes.txt database, each line is (lat, lng, IP): - - # cat /var/www/dilimesh/nodes.txt - - -34.88548650005714,138.55225324630737,10.130.1.56 - -34.88006501016277,138.55394840240479,10.130.1.1 - -34.87893842193011,138.55278968811035,10.130.1.23 - -34.882511765792316,138.55210304260254,10.130.1.14 - -34.880364257566484,138.5518455505371,10.130.1.36 - -4/ The "dilimesh" cookie stores a lot of our state. On Firefox 3.5 you - can remove the dilimesh cookie using Edit-Preferences-Privacy, then - click on "remove individual cookies". - -5/ To reset to defaults: - - * move to another page (cookie is svaed when we exit page) - * rm -f /var/www/dilimesh/nodes.txt - * Delete cookie using setp (4) above diff --git a/dilimesh/cgi-bin/addnode.cgi b/dilimesh/cgi-bin/addnode.cgi deleted file mode 100755 index bd78216e..00000000 --- a/dilimesh/cgi-bin/addnode.cgi +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh -# addnode.cgi -# David Rowe 4 Dec 2010 -# -# CGI to add a new node - -cat < - - - - - -EOF - -lat=`echo "$QUERY_STRING" | sed -n "s/.*lat=\(.*\)&lng.*/\1/p"` -lng=`echo "$QUERY_STRING" | sed -n "s/.*lng=\(.*\)&ip.*/\1/p"` -ip=`echo "$QUERY_STRING" | sed -n "s/.*ip=\(.*\)/\1/p"` - -echo $lat,$lng,$ip >> /var/www/dilimesh/nodes.txt - -echo $QUERY_STRING "
" -echo "
" -echo $lat $lng $ip - -cat < - -EOF diff --git a/dilimesh/cgi-bin/cleardb.cgi b/dilimesh/cgi-bin/cleardb.cgi deleted file mode 100755 index fa4433c9..00000000 --- a/dilimesh/cgi-bin/cleardb.cgi +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -# cleardb.cgi -# David Rowe 15 Dec 2010 -# -# CGI to delete entire node database - -cat < - - - - - -EOF - -# path to node database text file - -P=/var/www/dilimesh -rm $P/nodes.txt - -cat < - -EOF diff --git a/dilimesh/cgi-bin/delnode.cgi b/dilimesh/cgi-bin/delnode.cgi deleted file mode 100755 index 5c8b115e..00000000 --- a/dilimesh/cgi-bin/delnode.cgi +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# delnode.cgi -# David Rowe 4 Dec 2010 -# -# CGI to delete a node - -cat < - - - - - -EOF - -lat=`echo "$QUERY_STRING" | sed -n "s/lat=\(.*\)&.*/\1/pg"` -lng=`echo "$QUERY_STRING" | sed -n "s/.*lng=\(.*\)/\1/pg"` - -# path to node database text file - -P=/var/www/dilimesh - -cat $P/nodes.txt | sed "/$lat,$lng.*/ d" > $P/nodes.tmp -cp $P/nodes.tmp $P/nodes.txt -rm $P/nodes.tmp - -#echo $QUERY_STRING "
" -#echo "
" -#echo $lat $lng - -cat < - -EOF diff --git a/dilimesh/cgi-bin/fpingnodes.cgi b/dilimesh/cgi-bin/fpingnodes.cgi deleted file mode 100755 index d0c19faf..00000000 --- a/dilimesh/cgi-bin/fpingnodes.cgi +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# fpingnodes.cgi -# David Rowe 5 Dec 2010 -# -# CGI to fping a bunch of nodes - -cat < - - - - - -EOF - -ip=`echo "$QUERY_STRING" | sed -n "s/.*ip=//p" | sed "s/,/ /g"` -fping $ip -a -b1400 -r1 2>/dev/null - -cat < - -EOF diff --git a/dilimesh/cgi-bin/getnodes.cgi b/dilimesh/cgi-bin/getnodes.cgi deleted file mode 100755 index 7312089a..00000000 --- a/dilimesh/cgi-bin/getnodes.cgi +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# getnodes.cgi -# David Rowe 5 Dec 2010 -# -# CGI to return node list from database text file -# We use a CGI rather than fetching the text file directly -# so we can control Firefox from caching - -cat < - - - - - - -EOF - -NODES=/var/www/dilimesh/nodes.txt - -if [ -f $NODES ] ; then - cat $NODES -fi - -cat < - -EOF diff --git a/dilimesh/cgi-bin/getsig.cgi b/dilimesh/cgi-bin/getsig.cgi deleted file mode 100755 index 1850fccf..00000000 --- a/dilimesh/cgi-bin/getsig.cgi +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -# getsig.cgi -# David Rowe 6 Dec 2010 -# -# CGI to fetch the signal strength from a node -# Requires the node to be running sigstr.sh script as -# a telnet dameon port 4950 - -cat < - - - - - -EOF - -ip=`echo "$QUERY_STRING" | sed -n "s/.*ip=//p" | sed "s/,/ /g"` -nc $ip 4950 -echo $ip - -cat < - -EOF diff --git a/dilimesh/cgi-bin/getvis.cgi b/dilimesh/cgi-bin/getvis.cgi deleted file mode 100755 index a8723b79..00000000 --- a/dilimesh/cgi-bin/getvis.cgi +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -# getvis.cgi -# David Rowe 4 Dec 2010 -# -# CGI to fetches vis server data -# I am sure it is possible to do this directly from Javascript -# but I am too much of a noob. - -cat < - - - - - -EOF - -VIS_SERVER_HOST=`echo "$QUERY_STRING" | sed -n "s/.*ip=//p"` - -nc $VIS_SERVER_HOST 2005 2>/dev/null >/dev/null -if [ $? -eq 0 ] ; then - nc $VIS_SERVER_HOST 2005 | sed -n "/{/ p" -else - echo "Can't connect to Visualisation Server on $VIS_SERVER_HOST" -fi - -cat < - -EOF - diff --git a/dilimesh/dilimesh/dilimesh.css b/dilimesh/dilimesh/dilimesh.css deleted file mode 100644 index d72344f5..00000000 --- a/dilimesh/dilimesh/dilimesh.css +++ /dev/null @@ -1,70 +0,0 @@ -html,body{ - margin:0; - padding:0; - width:100%; - height:100%; - font-family:Arial, Helvetica, sans-serif; -} - -div#header{ - vertical-align:middle; - border-bottom:1px solid #000; -} -div#main-map{ - width:70%; - height:100%; - float:left; -} -div#side{ - width:30%; - float:left; -} - -div#dataPanel{ - width:90%; - height:50%; - overflow:auto; - border:2px solid #DDDDDD; -} -input{ - width:90%; -} - -input.navi{ - font-size:12px; - height:30px; - margin-bottom:10px; -} -div ul{ - margin-top:30px; - margin-bottom:30px; -} -div ul li{ - display: inline; - list-style-type: none; - padding-right: 40px; - font-size:18px; - font-weight:bold; -} - -div ul li.title{ - font-size:22px; - color:#888; -} - -div#header p{ - color:#888; - font-size:14px; - padding-left:20px; -} -span.instruction{ - font-weight:bold; - -} - -.message-box { text-align: center; padding: 5px; color:#545454; width:80%; margin:5px auto; font-size:12px;} -.clean { background-color: #efefef; border-top: 2px solid #dedede; border-bottom: 2px solid #dedede; } -.info { background-color: #f7fafd; border-top: 2px solid #b5d3ff; border-bottom: 2px solid #b5d3ff; } -.ok { background-color: #d7f7c4; border-top: 2px solid #82cb2f; border-bottom: 2px solid #82cb2f; } -.alert { background-color: #fef5be; border-top: 2px solid #fdd425; border-bottom: 2px solid #fdd425; } -.error { background-color: #ffcdd1; border-top: 2px solid #e10c0c; border-bottom: 2px solid #e10c0c; } \ No newline at end of file diff --git a/dilimesh/dilimesh/dilimesh.html b/dilimesh/dilimesh/dilimesh.html deleted file mode 100644 index 1c002295..00000000 --- a/dilimesh/dilimesh/dilimesh.html +++ /dev/null @@ -1,996 +0,0 @@ - - - - - - -Dili Mesh - - - - - - - - - -
-
- -
- -

Help

- - -
DiliMesh README
- -
-

Network Stats

- - - - - -
Time
Nodes Reachable
Nodes Poor Packet Loss
Nodes Total
-
- -
-

Contol Panel

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Visualisation Server IP
Update Enable
Update Time (s)
Clear Database
Debug Messages
-
- -

Signal Strength

- - - - - - - - - - - - - - - - -
Currently Polling
Last Node that
Responded
Results
- -

Distance

- - - - - - - - - - - - - - - - -
Distance
Path Loss
Est Rx Signal
-
- -
-

Tests

-
    -
  1. Test nodes.txt database
    -
  2.  
    -
  3.  
    -
-
- -
-

Debugging Output

-
    -
-
-
- - - - diff --git a/dilimesh/dilimesh/node_dead.png b/dilimesh/dilimesh/node_dead.png deleted file mode 100644 index 88be5501..00000000 Binary files a/dilimesh/dilimesh/node_dead.png and /dev/null differ diff --git a/dilimesh/dilimesh/node_good.png b/dilimesh/dilimesh/node_good.png deleted file mode 100644 index 056f1c9b..00000000 Binary files a/dilimesh/dilimesh/node_good.png and /dev/null differ diff --git a/dilimesh/dilimesh/node_packet_loss.png b/dilimesh/dilimesh/node_packet_loss.png deleted file mode 100644 index 58420803..00000000 Binary files a/dilimesh/dilimesh/node_packet_loss.png and /dev/null differ diff --git a/dilimesh/dilimesh_screenshot.png b/dilimesh/dilimesh_screenshot.png deleted file mode 100644 index 7c260866..00000000 Binary files a/dilimesh/dilimesh_screenshot.png and /dev/null differ diff --git a/dilimesh/scripts/S99sigstr b/dilimesh/scripts/S99sigstr deleted file mode 100755 index a33f8162..00000000 --- a/dilimesh/scripts/S99sigstr +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -telnetd -l /usr/sbin/sigstr.sh -p 4950 diff --git a/dilimesh/scripts/sigstr.sh b/dilimesh/scripts/sigstr.sh deleted file mode 100755 index 726458a4..00000000 --- a/dilimesh/scripts/sigstr.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# node_tune.sh -# David Rowe 13 April 2010 -# -# Prints information useful for tuning a mesh node -# -# Useful to run as a telnet login, e.g. -# telnetd -l /usr/sbin/node_tune.sh -p 4950 -# will let you plug a laptop into eth0 and "telnet 192.168.1.20 4950" -# to run this script - - # list of nodes this node can see in IP and MAC order - - IP=`cat /proc/net/arp | grep "10.130.1" | awk '{ print $1 }'` - MAC=`cat /proc/net/arp | grep "10.130.1" | awk '{ print $4 }'` - - echo - echo "sigstr" - echo $IP - for m in $MAC - do - wlanconfig ath0 list | grep $m | awk '{ printf " %s",$6 }' - done - echo - - - -