Condroid WSN/DTN Gateway - Middleware Installation & Configuration Guide on ALIX Board

1,518 views

Published on

Condroid WSN/DTN Gateway - Middleware Installation & Configuration Guide on ALIX Board. Download the document in http://csd.xen.ssvl.kth.se/csdlive/content/wsndtn-gateway-system-development-deployment

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,518
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Condroid WSN/DTN Gateway - Middleware Installation & Configuration Guide on ALIX Board

  1. 1. ! !"#$%&#()&*!)+,-%%.*!)/* -#"&)..)&-0#120#3-(4/)&-0# (4-%*0#).-560)/%! 7*/"-0#89: 2011 !"#$%&()%*+(,%+-%"( !"#$%&(&#*&.( ( Lan Sun (lansun@kth.se), 15 ECTS (((((/#*&.(*01(2"#$%&(#30%"( Hervé Ntareme Qing An (qinga@kth.se), 15 ECTS /#4&#*&.( Michel Hognerud Jun Gao (jungao@kth.se), 15 ECTS /.*+25#0( Laili Aidi (aidi@kth.se), 18 ECTS Björn Pehrson! Yasir Ali (yasireal@kth.se), 15 ECTS SUMMER CSD
  2. 2. WSN/DTN Gateway Middleware Installation and Configuration Guide On ALIX Board Version 1.2 ! Revision HistoryVersion Date Responsible Change V1.0 2011-08-11 Laili Aidi Initial version of the document Abbreviation, Introduction, Network V1.1 2011-09-14 Laili Aidi Configuration, Apache Server, PHP, Database Server, Java Run Time Cover, Abbreviation, Introduction, Network Configuration, Web Server Installation & Configuration, PHP V1.2 2011-09-30 Laili Aidi Installation, Java and Ant Installation and Configuration, Telnet Installation, HAL Installation, SunSPOT Installation and Configuration 2
  3. 3. WSN/DTN Gateway Middleware Installation and Configuration Guide On ALIX Board Version 1.2 ! ContentsContents.................................................................................................................................................................................. 3Summary ................................................................................................................................................................................. 4Abbreviation........................................................................................................................................................................... 51. Introduction ....................................................................................................................................................................... 62. Network Configuration .................................................................................................................................................... 73. Apache Installation & Configuration...........................................................................................................................124. PHP Installation ..............................................................................................................................................................135. MySQL Server Installation & Configuration ..............................................................................................................146. Java and Ant Installation & Configuration .................................................................................................................167. Hald Installation ..............................................................................................................................................................198. SunSPOT Installation & Configuration ......................................................................................................................209. References ........................................................................................................................................................................25 3
  4. 4. WSN/DTN Gateway Middleware Installation and Configuration Guide On ALIX Board Version 1.2 ! SummaryThis document describes the WSN Middleware installation procedure in the Voyage OS on top of ALIX Boardworkstation in order to set up WSN/DTN Gateway. 4
  5. 5. WSN/DTN Gateway Middleware Installation and Configuration Guide On ALIX Board Version 1.2 ! AbbreviationAbbreviations used in this document: Abbreviation Description DHCP Dynamic Address Allocation Protocol AP Access-Point Wi-Fi Trademark of a product based on IEEE 802.11 Apache HTTP Server PHP Hypertext Preprocessor, Server-side HTML embedded scripting language MySQL An Open source Relational database management system (RDBMS) DTN Delay Tolerant Network / Delay Disruptive Network ALIX Board Single board computer capable of running operating systems WSN Wireless Sensor Network DTN Delay Tolerant Network / Delay Disruptive Network Voyage Linux GNU/Linux derived distribution that is best run on a x86 embedded platforms WPA Wi-Fi Protected Access Dnsmasq Lightweight version to configure DNS forwarder and DHCP server. JDK Java Development Environment Apache Ant XML-based build scripting language Hald HAL Daemon SunSPOT Embedded microprocessor that runs Java 5
  6. 6. WSN/DTN Gateway Middleware Installation and Configuration Guide On ALIX Board Version 1.2 !1. IntroductionThis document describes the WSN Middleware installation procedure in the Voyage OS on top of ALIX Boardworkstation in order to set up WSN/DTN Gateway. It can be used after we finish with the procedure that isdescribed in Voyage & DTN2 Installation & Configuration Guide On ALIX Board document [11]. TheWSN/DTN Gateway Middleware contains list of software and configuration procedures, as shown below:• Network configuration,• Apache HTTP server installation and configuration,• PHP5 installation,• MySQL database server installation and configuration,• Java and Ant installation and configuration,• HALD installation,• SunSPOT Open WSN installation and configuration 6
  7. 7. WSN/DTN Gateway Middleware Installation and Configuration Guide On ALIX Board Version 1.2 !2. Network ConfigurationThe following procedure describe the configuration of this WSN/DTN Gateway network Interfaces, includingto set up the interface as DHCP client, WiFi-Access Point and DHCP Server and IP address arrangement forDHCP server service. The network setup can be done using Static or Dynamic. In this configuration we setthis arrangement to the interface as below:• The eth0 interface is set to get dynamic IP address via DHCP, connected to the public network• The wlan0 is set to have static IP address, activated as Wi-Fi AP of our private network, and lease certain IP addresses to the client using DHCP.a. Dynamic IP Address SetupVoyage OS, by default, enables the eth0 interface to as dhcp client activate and sent request to the server, soall we need to do is just plug the Ethernet cable on that port. Thus, in this procedure, we just use this eth0interface in order to do the further configuration later. If you want to activate another interface then justfollow this standard procedure:• Enable and interface from the Network Interface using the command below, exp eth0:# remountrw# vi /etc/network/interfacesAdd to the file this:auto eth0iface eth0 inet dhcp• Now connect an Ethernet cable to eth0 (the most right port, beside the power port) and plug it to a switch/plug. You might need to force to renew the dhcp, using# dhclient –rand the obtain the fresh IP with!!# dhclientor restart the network Interface and/or network service to apply the new configuration:# ifconfing eth0 down# ifconfig eth0 upthen# /etc/init.d/networking restart# remountro 7
  8. 8. WSN/DTN Gateway Middleware Installation and Configuration Guide On ALIX Board Version 1.2 !b. Static IP Address, Access-Point, and DHCP SetupWhen building a gateway or server, it might be wiser to be on static IP. We set our wlan0 of the ALIX Boardto have static IP Address, with detail below:• SSID: “Bytewalla-Voyage”• Security as WPA2, with WPA pre-shared key: “Bytewalla-Voyage”.As we will set this WSN/DTN Gateway as the Wi-Fi Access point (AP Mode), then we use the Hostapconfiguration, not the wpa_suplicant, which is used to connect to WPA-PSK enabled AP (Managed Mode).We use dnsmasq, which is provided by default in the Voyage OS, and is a lightweight version to configureDNS forwarder and DHCP server. Below is the procedure to do that:• Check if the PCI card is recognized, using this command:# remountrw# lspci –vIt will show all information about the PCI buses and devices in the system. If this ALIX board has thisinformation like below, then our wireless card is recognized00:0c.0 Ethernet controller: Atheros Communications Inc. AR5413 802.11abg NIC(rev 01) Subsystem: Wistron NeWeb Corp. DCMA-82 High Power WLAN 802.11a/b/g mini-PCI Module (Super A/G, eXtended Range, 400mW) Flags: bus master, medium devsel, latency 168, IRQ 9 Memory at e0080000 (32-bit, non-prefetchable) [size=64K] Capabilities: [44] Power Management version 2 Kernel driver in use: ath5k• Check if the drivers / modules used in the Voyage OS distribution, using this command:# lsmod | grep athath5k 111732 0ath 10282 1 ath5kmac80211 154027 1 ath5kcfg80211 103027 3 ath5k,ath,mac80211 8
  9. 9. WSN/DTN Gateway Middleware Installation and Configuration Guide On ALIX Board Version 1.2 !• Enable the wlan0 interface from the Network Interface using the command below:# vi /etc/network/interfacesAdd to the file this, eg:# mac80211-based driversiface wlan0 inet static address 192.168.3.1 netmask 255.255.255.0 broadcast 192.168.3.255 hostapd /etc/hostapd/hostapd.conf• Enable the HostapdTo enable hostapd, edit the hostapd using this command:# vi /etc/default/hostapdThen add the following lines:DAEMON_CONF="/etc/hostapd/hostapd.conf"DAEMON_OPTS="-dd"RUN_DAEMON="yes"Then change the hostapd.conf as below:# vi /etc/hostapd/hostapd.confAth uses nl80211 driver for hostap functions, so append the following configuration:interface=wlan0driver=nl80211logger_syslog=-1logger_syslog_level=2logger_stdout=-1logger_stdout_level=2debug=4dump_file=/tmp/hostapd.dumpctrl_interface=/var/run/hostapdctrl_interface_group=0channel=6macaddr_acl=0auth_algs=3 9
  10. 10. WSN/DTN Gateway Middleware Installation and Configuration Guide On ALIX Board Version 1.2 !eapol_key_index_workaround=0eap_server=0wpa=3ssid=Bytewalla-Voyagewpa_passphrase=Bytewalla-Voyagewpa_key_mgmt=WPA-PSKwpa_pairwise=TKIPeapol_version=1From the above configuration, WPA/WPA2 is configured, using “Bytewalla-Voyage” as both SSID and pre-shared key, running 802.11g mode on channel 11. eapol_version=1 is set for backward compatibility to mydamn old 2001 iBook. We do not need to set anything with iw tools since hostapd will do it for us.Now, make sure hostapd is enabled in /etc/default/hostapd and restart the hostapd by:# /etc/init.d/hostapd restartStopping advanced IEEE 802.11 management: hostapd.Starting advanced IEEE 802.11 management: hostapd.• Set the lease IP Address for this Wi-Fi Access Point in the dnsmasq configuration, as the DHCP support from dnsmasq is now enabled by default, by using this command:# vi /etc/dnsmasq.more.confAnd comment all the lines except for these:dhcp-leasefile=/var/tmp/dnsmasq.leasesdhcp-range=wlan0,192.168.3.35,192.168.3.50,24hNow, restart the dnsmasq by:# /etc/init.d/dnsmasq restartRestarting DNS forwarder and DHCP server: dnsmasq.This means the dnsmasq will provide IP address lease 192.168.3.35 to 192.168.3.50 from the wlan0. After thisstep, the other workstation will be able to find access points “Bytewalla-Voyage” in its wireless network list.Restart and then check the configuration using these commands:# ifconfig wlan0 down 10
  11. 11. WSN/DTN Gateway Middleware Installation and Configuration Guide On ALIX Board Version 1.2 !# ifconfig wlan0 up# /etc/init.d/networking restart# ifconfig wlan0 192.168.3.1 netmask 255.255.255.0# ifconfigIt will show something like:mon.wlan0 Link encap:UNSPEC HWaddr 00-0B-6B-23-40-EA-6C-6F-00-00-00-00-00-00-00-00 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:7684 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:847513 (827.6 KiB) TX bytes:0 (0.0 B)wlan0 Link encap:Ethernet HWaddr 00:0b:6b:23:40:ea inet addr:192.168.3.1 Bcast:192.168.3.255 Mask:255.255.255.0 inet6 addr: fe80::20b:6bff:fe23:40ea/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:2605 errors:0 dropped:0 overruns:0 frame:0 TX packets:1902 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:228301 (222.9 KiB) TX bytes:276191 (269.7 KiB)# iwconfigIt will show something like:wlan0 IEEE 802.11abg Mode:Master Frequency:2.437 GHz Tx-Power=20 dBm Retry long limit:7 RTS thr:off Fragment thr:off Power Management:offmon.wlan0 IEEE 802.11abg Mode:Monitor Tx-Power=20 dBm Retry long limit:7 RTS thr:off Fragment thr:off Power Management:offThe “Bytewalla-Voyage” is the ESSID that later we will use to set our WSN/DTN Gateway as Wi-Fi accesspoint, and because this workstation will serve the Access Point to the client, thus we have to set the wlan0mode as Master. 11
  12. 12. WSN/DTN Gateway Middleware Installation and Configuration Guide On ALIX Board Version 1.2 !3. Apache Installation & ConfigurationWe use Apache version 2 in the WSN/DTN middleware as the HTTP Web Server. In order to do it, justfollows this installation step:1. Install the Apache by opening terminal and type this command:# apt-get install apache2Then restart it# /etc/init.d/apache2 restart2. Testing ApacheOpen up any web browser and then enter the following into the web address:http://[server_ip_addr]/You should see a folder entitled apache2-default/. Open it and you will see a message saying, "It works!” 12
  13. 13. WSN/DTN Gateway Middleware Installation and Configuration Guide On ALIX Board Version 1.2 !4. PHP InstallationWe use PHP version 5 in the WSN/DTN middleware. In order to do it just follows this installation step:1. Open terminal and type this command:# apt-get install libapache2-mod-php52. Enable it using this command:# a2enmod php5This will create a symbolic link /etc/apache2/mods-enabled/php5 pointing to /etc/apache2/mods-availble/php5. If this command returns "$ This module does not exist!", you should purge the libapache2-mod-php5 package and reinstall it.3. Relaunch Apache 2 apache with following command# service apache2 restart4. Testing PHPMake a PHP file contains <?php phpinfo(); ?> and put in /usr/public_html/ and save it as index.phpOpen up any web browser, clear the cache and then enter the following into the web address:http://[server_ip_addr]/You should see a folder entitled apache2-default/. Open it and you will a PHP test page in the browser 13
  14. 14. WSN/DTN Gateway Middleware Installation and Configuration Guide On ALIX Board Version 1.2 !5. MySQL Server Installation & ConfigurationWe use MySQL version 5.1 in this WSN/DTN middleware as the database server. In order to do it, justfollows this installation step:1. Open terminal and type this command:# apt-get install mysql-server# apt-get install libapache2-mod-auth-mysql# apt-get install php5-mysql2. (This step is optional) In order for other computers on your network to view the server you have created, you must edit the "Bind Address" in the my.cnf file:vi /etc/mysql/my.cnfChange the linebind-address = 127.0.0.1And change the 127.0.0.1 to your IP address. In this WSN/DTN Gateway, we use our private IP address,which is the wlan interface address3. Login to mysql using root user, which needs a password to authenticate. In this case, we can login as root on your mysql server using:voyage:~# mysql –u rootThen type the new password, using this command:mysql> SET PASSWORD FOR root@localhost = PASSWORD(mypassword);The next time to login to the root, we can use this command.# mysql -u root -pThe password of MySql root in the WSN/DTN Gateway is ‘voyage’. Now we are logged in.Or using this:voyage:~# mysql –u root –h localhost password ‘mypassword’voyage:~# mysql –u root –h myhostname password ‘mypassword’Put mypassword as the new password and myhostname as the new host name.4. Testing MySQLNow, we can try to create a database: 14
  15. 15. WSN/DTN Gateway Middleware Installation and Configuration Guide On ALIX Board Version 1.2 !mysql> create database wsn_database;Next, we can create a user and then allow them to connect to our MySQL server, for example: Usernamesunspot and Password sunspot_passwd using this command:mysql> grant usage on *.* to sunspot@localhost identifiedby sunspot_passwd;And finally we grant all privileges to this user on the test_data database:mysql> grant all privileges on wsn_database * to sunspot@localhost;Now leave the root access:mysql> quitAnd check that that new user can connect to it again using this command# mysql -u sunspot –p sunspot_passwd wsn_database 15
  16. 16. WSN/DTN Gateway Middleware Installation and Configuration Guide On ALIX Board Version 1.2 !6. Java and Ant Installation & ConfigurationThe WSN/DTN Gateway Engine Sender will need to use complete module in SunsPOT SDK then we needthe JDK, and Apache Ant to run, compile and control the java application both in the mote and base station.In order to do that just follows this installation step:1. Open Terminal and Install JDK as command below:# apt-cache search ^sun-javaThis will show the available java versions. We use JDK from Sun Microsystems in this WSN/DTN Gatewaymiddleware, thus do this command:# apt-get install sun-java6-jdkAfter this, java should be installed in usr/lib/jvm folder, as shown below:# cd /usr/lib/jvm/# lsjava-6-sun java-6-sun-1.6.0.262. Download and install Apache Ant as command below:# wget http://apache.dataphone.se//ant/binaries/apache-ant-1.8.2-bin.tar.gz# tar -zxvf apache-ant-1.8.2-bin.tar.gz# mv apache-ant-1.8.2 /usr/antAfter this, ant should be installed in /usr/ant folder, as shown below:# cd /usr/ant# lsINSTALL KEYS LICENSE NOTICE README WHATSNEW bin docs etcfetch.xml get-m2.xml lib3. Update the JAVA_HOME, ANT_HOME and their paths permanently for all user using this command:# vi /etc/profileAt the end of this file, add these following lines:JAVA_HOME="/usr/lib/jvm/java-6-sun-1.6.0.26"export JAVA_HOMEexport PATH=$PATH:/usr/lib/jvm/java-6-sun-1.6.0.26/binANT_HOME="/usr/ant" 16
  17. 17. WSN/DTN Gateway Middleware Installation and Configuration Guide On ALIX Board Version 1.2 !export ANT_HOMEexport PATH=${PATH}:${ANT_HOME}/binSave the file, and then make sure the new environment variable is set using this command:# envor# printenvTERM=xterm-colorSHELL=/bin/bashSSH_CLIENT=192.168.11.2 51944 22SSH_TTY=/dev/pts/0ANT_HOME=/usr/antUSER=rootMAIL=/var/mail/rootPATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-6-sun-1.6.0.26/bin:/usr/ant/binPWD=/rootJAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.26SHLVL=1HOME=/rootLOGNAME=rootSSH_CONNECTION=192.168.11.2 51944 192.168.11.1 22_=/usr/bin/env4. Testing and checking Java and Ant version# echo $PATH/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-6-sun-1.6.0.26/bin:/usr/ant/bin# echo $JAVA_HOME/usr/lib/jvm/java-6-sun-1.6.0.26# which java/usr/bin/java# java –versionjava version "1.6.0_26"Java(TM) SE Runtime Environment (build 1.6.0_26-b03) 17
  18. 18. WSN/DTN Gateway Middleware Installation and Configuration Guide On ALIX Board Version 1.2 !Java HotSpot(TM) Client VM (build 20.1-b02, mixed mode, sharing)# echo $ANT_HOME/usr/ant# ant -f fetch.xml -Ddest=systemBuildfile: fetch.xml does not exist!Build failedor# antBuildfile: build.xml does not exist!Build failedSo Ant works. This message is there because we need to write an individual build file for our project.# ant -versionApache Ant(TM) version 1.8.2 compiled on December 20 2010 18
  19. 19. WSN/DTN Gateway Middleware Installation and Configuration Guide On ALIX Board Version 1.2 !7. Hald InstallationHardware Abstraction Layer Daemon (HALD) is a daemon that maintains a database of the devices connectedto the system in real-time. The daemon connects to the D-Bus system message bus to provide an API thatapplications can use to discover, monitor and invoke operations on devices.We use HAL probe the SunSPOT Mote after it is attached via USB bus to the ALIX Board. To install it to theVoyageOS, open terminal and type this command:# apt-get install halIt will show the lines that end with:Reloading system message bus config...done.Starting Hardware abstraction layer: hald. 19
  20. 20. WSN/DTN Gateway Middleware Installation and Configuration Guide On ALIX Board Version 1.2 !8. SunSPOT Installation & ConfigurationSunSPOT Manager is the most important part of the WSN/DTN Gateway Middleware. It is used formanaging the Sun SPOT (SDK), including the mote and BS, which are the Open WSN component that is usedin this system. However, we cannot use ordinary installation that is described in SunSPOT Manager Installationprocedure for linux, since Voyage OS does not have GUI application. Thus we have to do some modificationprocedure on that, using this following procedure:1. Install the SunSPOT Manager on any Linux box2. Copy the entire SunSPOT folder from that Linux box to the Voyage OS. In this example, we use root home to put the directory:$ scp -r SunSPOT/ root@[VoyageOS_IPAddr]:/root/So in our VoyageOS box, the file structure would be like:root@voyage:~# lsSunSPOT3. Copy the entire .sunspot.properties from that Linux box to the Voyage OS, or create sunspot properties file in the VoyageOS root home directory:root@voyage:~# vi .sunspot.propertiesThen copy these lines into that file:spot.library.name=transducerlibsunspot.home=/root/SunSPOT/sdksunspot.lib=${sunspot.home}/libbasestation.shared = falsespotselector.basestation.lastport=/dev/ttyACM0Save and close the file, when we do ls –a, we should see the new hidden .sunspot.properties file in thatdirectoryroot@voyage:~# ls –a. .. .bash_history .bashrc .profile .ssh .sunspot.properties SunSPOTOnce this has been set up, we should be able to run the sunSOT through the command line 20
  21. 21. WSN/DTN Gateway Middleware Installation and Configuration Guide On ALIX Board Version 1.2 !4. Now, we will deploy the SPOT application to the Free-range SPOT Mote(s). To do that, attach the SunSPOT Mote into one of the USB port of the ALIX board. We use the example in BounceDemo- OnSPOT folder.• First, we will make the SPOT mote have the security key pair with this WSN/DTN Gateway workstationroot@voyage:~/SunSPOT/sdk/Demos/BounceDemo/BounceDemo-OnSPOT# ant upgrade• We need to make sure that this SPOT Mote act as a free-range mote and able run the OTA command server. So type this command:root@voyage:~/SunSPOT/sdk/Demos/BounceDemo/BounceDemo-OnSPOT# ant enableota• Then deploy the SPOT application program to the SPOT mote, using this command:root@voyage:~/SunSPOT/sdk/Demos/BounceDemo/BounceDemo-OnSPOT# ant deploy• To check the new configuration, type this command:root@voyage:~/SunSPOT/sdk/Demos/BounceDemo/BounceDemo-OnSPOT# ant infoIt will ask to restart, and then It will show the lines like:-run-spotclient-once: [java] SPOT Client starting... [java] [java] Local Monitor (yellow-101117-1) [java] SPOT serial number = 0014.4F01.0000.07F9 [java] [java] Startup configuration: [java] OTA Command Server is enabled [java] Configured to run midlet: [java] org.sunspotworld.demo.SPOTBounce in eSPOT Bounce Demo-OnSPOT .. [java] Security: [java] Owner key on device matches key on hostThe 0014.4F01.0000.07F9 part is the MAC Address of this SPOT Mote. Now, Press the control button toreset the SPOT Mote and restart deployed program.• To check if the application can run on the SPOT Mote, type this command:root@voyage:~/SunSPOT/sdk/Demos/BounceDemo/BounceDemo-OnSPOT# ant run 21
  22. 22. WSN/DTN Gateway Middleware Installation and Configuration Guide On ALIX Board Version 1.2 !The SPOT Mote should show several lights changes over period of time.5. Next, we have to set up a SPOT Base station, which runs the program that forwards communication from this WSN/DTN Gateway workstation to the free-range Sun SPOTs. To do that, attach the SunSPOT Mote / Base Station (the thinner version) into one of the USB port of the ALIX board. We use the example in BounceDemo-OnDesktop folder.• First, we will make the SPOT Mote / Base Station have the security key pair with this WSN/DTN Gateway workstationroot@voyage:~/SunSPOT/sdk/Demos/BounceDemo/BounceDemo-OnDesktop# ant upgrade• We need to make sure that this SPOT Base station act as a Base station. The OTA command server should be running only on the free-range Sun SPOTs. If it is running on the Base station, the over-the-air deployments will not work. To disable the OTA command server on the Base station, follow this:root@voyage:~/SunSPOT/sdk/Demos/BounceDemo/BounceDemo-OnDesktop# ant disableotaThenroot@voyage:~/SunSPOT/sdk/Demos/BounceDemo/BounceDemo-OnDesktop# antstartbasestation• To check the new configuration, type this command:root@voyage:~/SunSPOT/sdk/Demos/BounceDemo/BounceDemo-OnDesktop# ant infoIt will ask to restart, and then It will show the lines like:-run-spotclient-once: [java] SPOT Client starting... [java] [java] Local Monitor (yellow-101117-1) [java] SPOT serial number = 0014.4F01.0000.6456 [java] [java] Startup configuration: [java] OTA Command Server is disabled [java] Configured as a Basestation .. [java] Security: [java] Owner key on device matches key on hostThe 0014.4F01.0000.6456 part is the MAC Address of this SPOT Base station. Now, Press the control button 22
  23. 23. WSN/DTN Gateway Middleware Installation and Configuration Guide On ALIX Board Version 1.2 !to reset the SPOT Base station.• To check if the application can run on the SPOT Mote, type this command:root@voyage:~/SunSPOT/sdk/Demos/BounceDemo/BounceDemo-OnDesktop# ant run-run-spotclient-once: [java] SPOT Client starting... [java] [java] Local Monitor (yellow-101117-1) [java] SPOT serial number = 0014.4F01.0000.6456 [java] [java] [java] ** VM stopped: exit code = 0 ** [java] [java] base station ready ...Now reset the spot, and then try to run it using this command:root@voyage:~/SunSPOT/sdk/Demos/BounceDemo/BounceDemo-OnDesktop# ant host-runIt will show something like:-do-host-run: [java] No appropriate Java sound supported on this device. [java] Exception in thread "main" java.awt.HeadlessException: [java] No X11 DISPLAY variable was set, but this program performed anoperation which requires it. [java] atjava.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159) [java] at java.awt.Window.<init>(Window.java:432) [java] at java.awt.Frame.<init>(Frame.java:403) [java] at javax.swing.JFrame.<init>(JFrame.java:202) [java] atorg.sunspotworld.demo.simspot.SimDisplayPanel.openInWindow(SimDisplayPanel.java:61) [java] atorg.sunspotworld.demo.DesktopBounce.main(DesktopBounce.java:90) 23
  24. 24. WSN/DTN Gateway Middleware Installation and Configuration Guide On ALIX Board Version 1.2 !This error happens because the WSN/DTN Gateway is running on top of VoyageOS, which don’t have GUIdisplay. But it prove that it able to run the SPOT Base station application. 24
  25. 25. WSN/DTN Gateway Middleware Installation and Configuration Guide On ALIX Board Version 1.2 !9. References[1] MySQL 5.0 Reference Manual http://dev.mysql.com/doc/refman/5.0/en/data-types.html Last time visited: August, 2011[2] ApacheMySQLPHP https://help.ubuntu.com/community/ApacheMySQLPHP Last time visited: August, 2011[3] Building a LAMP Server http://www.lamphowto.com/ Last time visited: August, 2011[4] ApacheMySQLPHP https://help.ubuntu.com/community/ApacheMySQLPHP Last time visited: October, 2011[5] Bash Shell script for automatic installation of DTN2 & Middleware software http://csd.xen.ssvl.kth.se/csdlive/content/wsndtn-gateway-system-deployment Last visited: September, 2011[6] Find out if package is installed in Linux http://www.cyberciti.biz/faq/find-out-if-package-is- installed-in-linux/#debian Last visited: September, 2011[7] Bash Guide for Beginners http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_02_01.html Last visited: September, 2011[8] Linux Force DHCP client (dhclient) to renew ip address http://www.cyberciti.biz/faq/howto- linux-renew-dhcp-client-ip-address/ Last visited: September, 2011[9] Debian GNU/Linux System Administrators Manual http://www.debian.org/doc/manuals/system-administrator/ch-sysadmin-time.html Last visited: September, 2011[10] Easy way to install java runtime environment (jre) in Debian http://pkill-9.com/easy-way-to-install-java-runtime- enviorment-jre-in-debian/ Last visited: September, 2011[11] Voyage & DTN2 Installation & Configuration Guide On ALIX Board Version 1.4 http://csd.xen.ssvl.kth.se/csdlive/content/wsndtn-gateway-system-deployment Last visited: September, 2011[12] Linux Forums http://www.linuxforums.org/forum/ Last visited: September, 2011[13] Linux Questions http://www.linuxquestions.org/questions/linux-newbie-8/howto-set-system-wide- environment-variables-permanently-in-debian-640855/ Last visited: September, 2011[14] Gmane Linux Distributions Voyage General http://article.gmane.org/gmane.linux.distributions.voyage.general/5543/match=master+hostapd Last visited: September, 2011 25
  26. 26. WSN/DTN Gateway Middleware Installation and Configuration Guide On ALIX Board Version 1.2 ![15] .bash_profile vs .bashrc http://www.joshstaiger.org/archives/2005/07/bash_profile_vs.html Last visited: September, 2011[16] How to Set JAVA_HOME / PATH variables Under Linux Bash Profile http://www.cyberciti.biz/faq/linux-unix-set-java_home-path-variable/ Last visited: September, 2011[17] SunSPOTWorld https://www.sunspotworld.com/forums/viewtopic.php?f=32&t=3703&p=15222&hilit=linux#p15222 Last visited: September, 2011[18] S u n SPOT Quick Start Tutorial http://www.sunspotworld.com/Tutorial/Basestation.html Last visited: September, 2011[19] Hald(8) – Linux Man Page http://linux.die.net/man/8/hald Last visited: September, 2011 26

×