Rural Engineer Department
6LoWPAN for Precision Agriculture
6LoWSoft_20 for Precision Agriculture
Some things to consider before configuring and installing the packages
First : Is recommendable to have installed "TinyOS" into "/opt" folder.
If you are planning to use the "Sheevaplug" server, please follow this steps or in the case you want to use a server with x86
architecture follow this steps.
Second: Enable your clock to visualize with 24-hour time and seconds (don't forget) in the computer connected via USB to the sink mote
Third : Unzip the packets downloaded in the software section
Fourth : Be sure the path indicated in this manual is the same in your path computer
Step 1: Preparing your Web and DB Server
For the LAMP server we must install the next packets
a) PHP
root@debian:~# aptitude install php5 php5-mysql
b) Installing Python (To make run python scripts)
We install the next packages:
root@debian:~# aptitude install python python-mysqldb
c) MySQL Server (Data Base)
root@debian:~# aptitude install mysql-server
In the installation process you must asign the password for you database; in this point we recommed put "123456" for the "root" user since the middleware has been set up with this values and if you want you can change it later.
We will create the database on MySQL called "conexion", also its table called "data" and its records, these will serve to store the the data sent by every edge router connected to its respective sink mote until the database server. In the future, may vary according to their own choice.
Write the command below **:
root@debian:/opt/6LoWSoft_DB# ./6LoWSoft_DB.py
To acces to the MySQL database type,
root@debian:~# mysql -u root -p123456
Now restart MySQL,
/etc/init.d/mysql restart
d) Apache Server (Web Server)
To install:
root@debian:~# aptitude install apache2
e) If you have decided to use the "Sheevaplug" install the PPP packet to be able to use the Point to Point Protocol
Download the package "ppp_2.4.5-4_armel.deb" and install it :
root@debian:~# dpkg -i ppp_2.4.5-4_armel.deb
Step 2: Installing "6LoWSoft_web20" in the Web Server
a) Copy the folder called "6LoWSoft_web" inside /var/www/
Be sure its functionality typing the next command:
root@debian:~# chmod 777 -Rf /var/www/6LoWSoft_web/
b) Restart the Web Server
Typing the next command:
root@debian:~# /etc/init.d/apache2 restart
Step 3: Configuring the computer that communicates with the sink node: "The Edge Router"
a) Python (To make run python scripts)
Install the packages:
root@debian:~# aptitude install python python-mysqldb
b) Copying the TinyOS application (6LoWSoft_mote)
Copy the folder called "6LoWSoft_mote" inside "tinyos-2.x/apps" and to be sure his functionality typing the next command:
root@debian:~# chmod 777 -Rf /opt/tinyos-2.x/apps/6LoWSoft_mote/
Step 4: Installing the TinyOS application in the sensor mote
You must have at least two motes telosb and/or tmote sky
Insert into the USB port of your machine and write the command below:
root@debian:/opt/tinyos-2.x/apps/6LoWSoft_mote$ make telosb blip install.8
Once finalized, disconnect the mote from the USB port.
Step 5: Installing the TinyOS application in the sink mote
a) In the PppRouter's Makefile ubicated in the path:
"/opt/tinyos-2.x/apps/PppRouter/Makefile" modify the lines below:
CFLAGS += -DCC2420_DEF_RFPOWER=31
CFLAGS += -DLOW_POWER_LISTENING
CFLAGS += -DLPL_SLEEP_INTERVAL=1024
CFLAGS += -DBLIP_L2_RETRIES=0
CFLAGS += -DBLIP_L2_DELAY=512
b) Installing the application "PppRouter" in the mote
Use another mote and insert it into the USB port of your machine and write the command below:
root@debian:/opt/tinyos-2.x/apps/PppRouter# make telosb blip install.1
Once finalized, maintain the mote inserted to the USB port.
c) Making run the Base Station (In the sink mote)
To know which one USB port has been recognized your mote, type the command below:
root@debian:~# motelist
Be sure to match with your USB port and type the command below:
root@debian:~#pppd debug passive noauth nodetach 115200 /dev/ttyUSB0 nocrtscts nocdtrcts lcp-echo-interval 0 noccp noip ipv6 ::23,::24
Assign to the "Sheevaplug" the IP address below
root@debian:~#ifconfig ppp0 add fec0::100/64
Step 6: Communicating the sink mote with the computer connected via USB
After doing the above steps,
In the Sheevaplug" connected via USB to the sink mote you must run this script:
root@debian:~# ./6LoWSoft_listener.py
Step 7: Showing the data graphically
In some PC connected to the network, start its web-browser and type this URL:
http://_ip_web_server/6LoWSoft_web
Others
a) Be sure is right the wires position in the TelosB mote
In the 10-pin expansion connector (U2) use the pin 1(AVcc), pin 3(ADC0) and pin 9(Gnd).
b) If you want to variate the time to sample in the sensor mote, modify the file: "UDPEchoP.nc" ubicated in the path:
"/opt/tinyos-2.x/apps/6LoWSoft_mote" the line below,
#define REPORT_PERIOD 5L
Where 5L represent 5 seconds to each sample period.
c) To change the ID of your WSN, modify the file: "6LoWSoft_listener.py" ubicated in the path:
"/opt/tinyos-2.x/apps/6LoWSoft_mote/util" the line below,
...
wsn = 1
...
Where 1 represent ID: 1