1. !
!"#$%&#'()&*!)+',-%%.*!)/*'
-#"&)..)&-0#'1'20#3-(4/)&-0#'
(4-%*'0#').-5'60)/%'''
!
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. WSN/DTN Gateway Middleware Installation and
Configuration Guide On ALIX Board Version 1.2
!
Revision History
Version 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. WSN/DTN Gateway Middleware Installation and
Configuration Guide On ALIX Board Version 1.2
!
Contents
Contents.................................................................................................................................................................................. 3
Summary ................................................................................................................................................................................. 4
Abbreviation........................................................................................................................................................................... 5
1. Introduction ....................................................................................................................................................................... 6
2. Network Configuration .................................................................................................................................................... 7
3. Apache Installation & Configuration...........................................................................................................................12
4. PHP Installation ..............................................................................................................................................................13
5. MySQL Server Installation & Configuration ..............................................................................................................14
6. Java and Ant Installation & Configuration .................................................................................................................16
7. Hald Installation ..............................................................................................................................................................19
8. SunSPOT Installation & Configuration ......................................................................................................................20
9. References ........................................................................................................................................................................25
3
4. WSN/DTN Gateway Middleware Installation and
Configuration Guide On ALIX Board Version 1.2
!
Summary
This document describes the WSN Middleware installation procedure in the Voyage OS on top of ALIX Board
workstation in order to set up WSN/DTN Gateway.
4
5. WSN/DTN Gateway Middleware Installation and
Configuration Guide On ALIX Board Version 1.2
!
Abbreviation
Abbreviations 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. WSN/DTN Gateway Middleware Installation and
Configuration Guide On ALIX Board Version 1.2
!
1. Introduction
This document describes the WSN Middleware installation procedure in the Voyage OS on top of ALIX Board
workstation in order to set up WSN/DTN Gateway. It can be used after we finish with the procedure that is
described in Voyage & DTN2 Installation & Configuration Guide On ALIX Board document [11]. The
WSN/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. WSN/DTN Gateway Middleware Installation and
Configuration Guide On ALIX Board Version 1.2
!
2. Network Configuration
The following procedure describe the configuration of this WSN/DTN Gateway network Interfaces, including
to set up the interface as DHCP client, WiFi-Access Point and DHCP Server and IP address arrangement for
DHCP server service. The network setup can be done using Static or Dynamic. In this configuration we set
this 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 Setup
Voyage OS, by default, enables the eth0 interface to as dhcp client activate and sent request to the server, so
all we need to do is just plug the Ethernet cable on that port. Thus, in this procedure, we just use this eth0
interface in order to do the further configuration later. If you want to activate another interface then just
follow this standard procedure:
• Enable and interface from the Network Interface using the command below, exp eth0:
# remountrw
# vi /etc/network/interfaces
Add to the file this:
auto eth0
iface 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 –r
and the obtain the fresh IP with!!
# dhclient
or restart the network Interface and/or network service to apply the new configuration:
# ifconfing eth0 down
# ifconfig eth0 up
then
# /etc/init.d/networking restart
# remountro
7
8. WSN/DTN Gateway Middleware Installation and
Configuration Guide On ALIX Board Version 1.2
!
b. Static IP Address, Access-Point, and DHCP Setup
When building a gateway or server, it might be wiser to be on static IP. We set our wlan0 of the ALIX Board
to 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 Hostap
configuration, 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 configure
DNS forwarder and DHCP server. Below is the procedure to do that:
• Check if the PCI card is recognized, using this command:
# remountrw
# lspci –v
It will show all information about the PCI buses and devices in the system. If this ALIX board has this
information like below, then our wireless card is recognized
00: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 ath
ath5k 111732 0
ath 10282 1 ath5k
mac80211 154027 1 ath5k
cfg80211 103027 3 ath5k,ath,mac80211
8
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/interfaces
Add to the file this, eg:
# mac80211-based drivers
iface 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 Hostapd
To enable hostapd, edit the hostapd using this command:
# vi /etc/default/hostapd
Then 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.conf
Ath uses nl80211 driver for hostap functions, so append the following configuration:
interface=wlan0
driver=nl80211
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2
debug=4
dump_file=/tmp/hostapd.dump
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
channel=6
macaddr_acl=0
auth_algs=3
9
10. WSN/DTN Gateway Middleware Installation and
Configuration Guide On ALIX Board Version 1.2
!
eapol_key_index_workaround=0
eap_server=0
wpa=3
ssid=Bytewalla-Voyage
wpa_passphrase=Bytewalla-Voyage
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
eapol_version=1
From 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 my
damn 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 restart
Stopping 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.conf
And comment all the lines except for these:
dhcp-leasefile=/var/tmp/dnsmasq.leases
dhcp-range=wlan0,192.168.3.35,192.168.3.50,24h
Now, restart the dnsmasq by:
# /etc/init.d/dnsmasq restart
Restarting 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 this
step, 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. 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
# ifconfig
It 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)
# iwconfig
It 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:off
mon.wlan0 IEEE 802.11abg Mode:Monitor Tx-Power=20 dBm
Retry long limit:7 RTS thr:off Fragment thr:off
Power Management:off
The “Bytewalla-Voyage” is the ESSID that later we will use to set our WSN/DTN Gateway as Wi-Fi access
point, and because this workstation will serve the Access Point to the client, thus we have to set the wlan0
mode as Master.
11
12. WSN/DTN Gateway Middleware Installation and
Configuration Guide On ALIX Board Version 1.2
!
3. Apache Installation & Configuration
We use Apache version 2 in the WSN/DTN middleware as the HTTP Web Server. In order to do it, just
follows this installation step:
1. Install the Apache by opening terminal and type this command:
# apt-get install apache2
Then restart it
# /etc/init.d/apache2 restart
2. Testing Apache
Open 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. WSN/DTN Gateway Middleware Installation and
Configuration Guide On ALIX Board Version 1.2
!
4. PHP Installation
We 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-php5
2. Enable it using this command:
# a2enmod php5
This 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 restart
4. Testing PHP
Make a PHP file contains <?php phpinfo(); ?> and put in /usr/public_html/ and save it as index.php
Open 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. WSN/DTN Gateway Middleware Installation and
Configuration Guide On ALIX Board Version 1.2
!
5. MySQL Server Installation & Configuration
We use MySQL version 5.1 in this WSN/DTN middleware as the database server. In order to do it, just
follows 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-mysql
2. (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.cnf
Change the line
bind-address = 127.0.0.1
And 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 address
3. 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 root
Then 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 -p
The 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 MySQL
Now, we can try to create a database:
14
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: Username
sunspot and Password sunspot_passwd using this command:
mysql> grant usage on *.* to sunspot@localhost identified
by '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> quit
And check that that new user can connect to it again using this command
# mysql -u sunspot –p 'sunspot_passwd' wsn_database
15
16. WSN/DTN Gateway Middleware Installation and
Configuration Guide On ALIX Board Version 1.2
!
6. Java and Ant Installation & Configuration
The WSN/DTN Gateway Engine Sender will need to use complete module in SunsPOT SDK then we need
the 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-java
This will show the available java versions. We use JDK from Sun Microsystems in this WSN/DTN Gateway
middleware, thus do this command:
# apt-get install sun-java6-jdk
After this, java should be installed in usr/lib/jvm folder, as shown below:
# cd /usr/lib/jvm/
# ls
java-6-sun java-6-sun-1.6.0.26
2. 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/ant
After this, ant should be installed in /usr/ant folder, as shown below:
# cd /usr/ant
# ls
INSTALL KEYS LICENSE NOTICE README WHATSNEW bin docs etc
fetch.xml get-m2.xml lib
3. Update the JAVA_HOME, ANT_HOME and their paths permanently for all user using this command:
# vi /etc/profile
At the end of this file, add these following lines:
JAVA_HOME="/usr/lib/jvm/java-6-sun-1.6.0.26"
export JAVA_HOME
export PATH=$PATH:/usr/lib/jvm/java-6-sun-1.6.0.26/bin
ANT_HOME="/usr/ant"
16
17. WSN/DTN Gateway Middleware Installation and
Configuration Guide On ALIX Board Version 1.2
!
export ANT_HOME
export PATH=${PATH}:${ANT_HOME}/bin
Save the file, and then make sure the new environment variable is set using this command:
# env
or
# printenv
TERM=xterm-color
SHELL=/bin/bash
SSH_CLIENT=192.168.11.2 51944 22
SSH_TTY=/dev/pts/0
ANT_HOME=/usr/ant
USER=root
MAIL=/var/mail/root
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
PWD=/root
JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.26
SHLVL=1
HOME=/root
LOGNAME=root
SSH_CONNECTION=192.168.11.2 51944 192.168.11.1 22
_=/usr/bin/env
4. 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 –version
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
17
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=system
Buildfile: fetch.xml does not exist!
Build failed
or
# ant
Buildfile: build.xml does not exist!
Build failed
So Ant works. This message is there because we need to write an individual build file for our project.
# ant -version
Apache Ant(TM) version 1.8.2 compiled on December 20 2010
18
19. WSN/DTN Gateway Middleware Installation and
Configuration Guide On ALIX Board Version 1.2
!
7. Hald Installation
Hardware Abstraction Layer Daemon (HALD) is a daemon that maintains a database of the devices connected
to the system in real-time. The daemon connects to the D-Bus system message bus to provide an API that
applications 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 the
VoyageOS, open terminal and type this command:
# apt-get install hal
It will show the lines that end with:
Reloading system message bus config...done.
Starting Hardware abstraction layer: hald.
19
20. WSN/DTN Gateway Middleware Installation and
Configuration Guide On ALIX Board Version 1.2
!
8. SunSPOT Installation & Configuration
SunSPOT Manager is the most important part of the WSN/DTN Gateway Middleware. It is used for
managing the Sun SPOT (SDK), including the mote and BS, which are the Open WSN component that is used
in this system. However, we cannot use ordinary installation that is described in SunSPOT Manager Installation
procedure for linux, since Voyage OS does not have GUI application. Thus we have to do some modification
procedure on that, using this following procedure:
1. Install the SunSPOT Manager on any Linux box
2. 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:~# ls
SunSPOT
3. 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.properties
Then copy these lines into that file:
spot.library.name=transducerlib
sunspot.home=/root/SunSPOT/sdk
sunspot.lib=${sunspot.home}/lib
basestation.shared = false
spotselector.basestation.lastport=/dev/ttyACM0
Save and close the file, when we do ls –a, we should see the new hidden .sunspot.properties file in that
directory
root@voyage:~# ls –a
. .. .bash_history .bashrc .profile .ssh .sunspot.properties SunSPOT
Once this has been set up, we should be able to run the sunSOT through the command line
20
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 workstation
root@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 info
It 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 host
The 0014.4F01.0000.07F9 part is the MAC Address of this SPOT Mote. Now, Press the control button to
reset 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. 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 workstation
root@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 disableota
Then
root@voyage:~/SunSPOT/sdk/Demos/BounceDemo/BounceDemo-OnDesktop# ant
startbasestation
• To check the new configuration, type this command:
root@voyage:~/SunSPOT/sdk/Demos/BounceDemo/BounceDemo-OnDesktop# ant info
It 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 host
The 0014.4F01.0000.6456 part is the MAC Address of this SPOT Base station. Now, Press the control button
22
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-run
It 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 an
operation which requires it.
[java] at
java.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] at
org.sunspotworld.demo.simspot.SimDisplayPanel.openInWindow(SimDisplayPanel.java
:61)
[java] at
org.sunspotworld.demo.DesktopBounce.main(DesktopBounce.java:90)
23
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 GUI
display. But it prove that it able to run the SPOT Base station application.
24
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 Administrator's 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. 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