of 12
1
1.
Introduction
This
is a
technical
manual
for
WIMEA
-
ICT Automatic Weather Station
(AWS)
. The AWS
is based on
Wireless Sensor Networks (WSN).
The AWS prototype consists of 4 wireless sensor
nodes and a
Raspberry Pi acting as a gateway. The sink node has a wired connection to the
raspberry
Pi. The sensors
are connected to the nodes as follows:
i.
The 10m node
h
as
wind direction and
speed
and
solar insolation
sensors
.
T
he node is
installed
10m from the ground.
ii.
The 2m node
h
as
air temperature and humidity
sensor
(
SHT25
sensor
)
.
The SHT25 sensor is
i
nstalled
2m from the ground
along the AWS 10m stand.
iii.
The ground node
h
as the
soil temperature, soil moisture
sensor
and rain
gauge
. The soil sensors are
i
n the soil while the rain gauge is either on the ground or close to the ground.
iv.
The sink node
has an atmospheric pressure sensor
and
is attached to and powered by the Raspberry
Pi
forming a
gateway. The gateway is powered through its
USB port using a 5V AC
-
DC adapter.
2.
Wireless sensor Node
2.1 Features of RSS2 Mote
WIMEA
-
IC
T AWS uses
a radio sensor node/mote, also called RSS2 mote
from radio sensors
[1]
.
Figures
1 and 2
show the back and front views of the node
Figure
1
Front side of RSS2 Mote
2
Sensors may be
attached to interfaces including INT5, ADC1 etc. The reset b
utton is used to reset the mote
.
This is normally done during
writing the bootloader.
When configuring the mote, an FTDI cable
in
may be
connected to the mote through a USB
-
TTL 6
-
pin connector. Figure 3 and 4 s
how ftd1 cable
.
Figure
2
Back side of RSS2 Mote
The mote uses IEEE 802.15.4 wireless protocol to communicate
i.e.
receive and send packets.
When
Installing the AWS, the antenna coverage label must face the sink node for
a
good
signal
.
Figure
3
FTDI cable
showing the two ends
3
Figure
4
Head of FTDI Cable, which connects to the Mote
2.2
Configuring the RSS2 Mote
In order to configure the mote, connect the mote to a computer runn
ing an ssh
client like putty using an ftdi
cable.
In case of linux, other se
rial communication clients like minicom may be used.
First check the serial
port
u
sed
by the mote under device manager as in Figure
5
.
Figure
5
Device manager showing COM17 Port in windows after connecting the mote via ftdi cable
After
ide
ntifying the COM port
,
use a client of your choice. For example, putty as per Figure 6. Under
Connection Type, select Serial.
Ensure that the speed is 3
8
400.
Select Open and interact with the serial
Interface.
4
Figure
6
Putty, a se
rial client opting to use com port 17.
After pressing the
O
pen
button,
you will be able to interact with the
mote via keyboard commands.
Figure
7 sh
ows a sample of commands provided during the mote
configuration
.
Foll
ow the commands to perform
configuration.
h
-
help
ri
-
How often the reporting is done, in seconds eg ri 60
report every 1 minute
re
display report mask ,
eg re #0 txt,e64,t (sets the report number 0 to report node name, mac address and
temperature
)
ss
-
Display system summary
Figure
7
Connecting the Mote to Raspberry Pi
GPIO pins using
jumper wires
3.
Gateway Configuration
The
gateway is a combination of a node, also known as a sink because of its function and Raspberry pi
. The
gateway
enables the AWS to connect to the Int
ernet.
Connecti
ng the AWS to Internet
enables users
to
remotely
access it.
The sink collects data from all other nodes and stores it on the raspberry pi.
Using any
uplink option/ Internet
connection method
, the data may be accessed from anywhere at any time.
3.1
Installing and setting up the raspberry Pi
The
raspberry Pi is equipped
wi
th many interfaces including USB
ports (4
), HDMI
port, power slot and SD
card slot among others.
It however does not have a monitor.
The HDMI interface provides a connec
t
ion of
the raspberry pi to
a computer
using
HDMI
to
VGA
cable
.
A keybo
ard and mouse may also be connected
to the raspberry pi via the USB
interfaces.
There are various operating systems, which may be installed on the
raspberry pi. The operating systems
should reside on an SD card, which
is placed in the SD card slot. First,
the
operating system must be set up
on the SD card, An example of
an OS is Rasbian Wheezy.
5
Install
Win32DiskImager
on your computer. The software will help to write the
operating system to the SD
card.
Follow instructions on
[2]
.
After writing the OS, inser
t the
SD card into the
raspberry pi and power it. More instructions on setting up
th
e raspberry pi may be found at
[3]
.
3.2
Connecting
Node to
Raspberry Pi
The
followin
g Figures show
how the RSS2 mote i
s connected to the raspberry pi using
female
jumper wires.
Figure
8
Part of the RSS2 Mote showing how
which pins are connected to the
raspberry Pi
6
Figure
9
Part of the Raspberry Pi showing the GPIO pins to which the node pins are connected using jumper wires
An alternative option of connecting the
node to the raspberry pi is by using an ftdi cable.
I.e. connect
the
USB
of the cable to the USB
port of the raspberry pi
3.3
Connecting
Gateway
to Internet
There are various ways of connecting the raspberry pi to Internet. These include
1.
Using
cable via ther
Ethernet
interface
2.
Wifi
, by attaching a wifi dongle to the raspberry pi
3.
Using a USB modem
4.
Etc
Options 1
requires no configuration, while
option 2 requires limited configurations. Option 3 requires
massive configurations and details are given in this document.
3.3.1
Configuring Rasp
berry Pi to Connect to
Internet Using a USB Modem
Below is a list of required software
f
or
the raspberry Pi
Table
1
Required Raspberry Pi software
Software
Function
ppp
Manages connection between the Raspberry Pi and 3g Provider
Sakis3g
Connects to
3G I
nternet
via a configured Sim card
UMTSkeeper
To reconnect the 3G dongle using sakis3g script if connection drops
7
Although t
he Raspberry pi has an Ethern
e
t port for Internet connection,
i
n the absence of cable
, alternatives
including
using wifi and USB
modems may be used
To configure the raspberry pi to access Internet using usb
modem,
p
erform
the following tasks:
-
i.
Edit
/etc/network/interfaces
to have the following
Auto usb0
Allow
-
hotplug usb0
Iface usb0 inet dhcp
ii.
In case of a smart mobile phone, set USB tethering and check connection
by pinging any
site
.(Optional step but
may help to access Internet before configuring the modem
)
iii.
Fol
l
ow instructions on
[4]
to set up
s
akis 3g on the raspberry pi
iv.
Install ppp
v.
Install umtskeeper
s
udo wget
http://zool33.uni
-
graz.at/petz/umtkeeper/src/umtskeeper.tar.gz
4.
Data
4.1
Acquiring data
from AWS
Given an active Internet connection,
the AWS data may be accessed via SSH or a web page, which runs on
the gateway, a raspberry Pi.
For a
gateway with
a public IP address, SSH access
m
ay be performed through
direct
S
SH
using IP address or domain name
, username and password of the raspberry
Pi.
Different
S
SH
clients may be used including putty, which
has versions for both windows and Linux. Linux users may
issue the
S
SH
commands via the terminal.
A
gateway
using
a
dynamic or private address
may n
ot be d
irectly accessed remotely
.
I
t can
however be
accessed
t
hrough r
e
verse tunneling, which enables the
g
ateway traffic to go th
r
ough
a
public IP server.
While at the public IP
server, the pi may be accessed
. f
ollow instructions on
[5]
to
configure
reverse
tunneling on the gateway.
Also, ensure that the raspberry
pi
s
S
SH
public key is added to the public servers
authorized keys
to enable raspbe
rry pi to login into ser
ver without asking for a password
. Refer to
[6]
to
configure password
-
less SSH access
from raspberry pi to server.
8
Figure
10
Using putty, an ssh client to access
the
public IP server
4.2
Data Analysis
Data is
recorded
in a text file, containing key/
value pairs
, organized in rows
.
Each row
re
presents a
transmission of a mi
xture of
weather parameters, voltage and network information and starts with a date
and time in the first two columns.
Figure 2 show
s a sample text file for a WIMEA
-
ICT
AWS
2016
-
12
-
06 09:28:08 TZ=UTC UT=1481016488 GW_LAT=32.57100 GW_LON=0.32920 &:
TXT=makg2
-
2m E64=fc
c23d00000182b5 PS=1 V_MCU=2.92 V_IN=3.68 T_SHT2X=29.61
RH_SHT2X=36.15 [ADDR=31.193 SEQ=103 TTL=15 RSSI=24 LQI=255 DRP=0.00]
2016
-
12
-
06 09:28:08 TZ=UTC UT=1481016488 GW_LAT=32.57100 GW_LON=0.32920 &:
TXT=makg2
-
2m E64=fcc23d00000182b5 PS=1 V_MCU=2.92 V_IN=3
.68 T_SHT2X=29.61
RH_SHT2X=36.15 [ADDR=31.193 SEQ=103 TTL=14 RSSI=1 LQI=255 DRP=0.00]
2016
-
12
-
06 09:28:08 TZ=UTC UT=1481016488 GW_LAT=32.57100 GW_LON=0.32920 &:
TXT=makg2
-
gnd PS=1 P0=0x0 P0_LST60=0 UP=0x16108 V_A1=0.04 V_A2=2.95
[ADDR=133.199 SEQ=2
04 TTL=15 RSSI=26 LQI=255 DRP=0.00]
2016
-
12
-
06 09:28:08 TZ=UTC UT=1481016488 GW_LAT=32.57100 GW_LON=0.32920 &:
TXT=makg2
-
gnd PS=1 P0=0x0 P0_LST60=0 UP=0x16108 V_A1=0.04 V_A2=2.95
[ADDR=133.199 SEQ=204 TTL=14 RSSI=2 LQI=255 DRP=0.00]
2016
-
12
-
06 09:28
:08 TZ=UTC UT=1481016488 GW_LAT=32.57100 GW_LON=0.32920 &:
TXT=makg2
-
gnd PS=1 T=33.25 T1=27.06 V_MCU=3.00 V_IN=3.85 [ADDR=133.199 SEQ=205
TTL=15 RSSI=26 LQI=255 DRP=0.00]
Figure
11
Sample WIMEA
-
ICT AWS text file
Besides date
and time,
t
here are other columns such as those in
Table 1
Table
2
WIMEA
-
ICT
AWS Database file key representations
Node
Abbreviation
Parameter
To All Nodes
TZ
Timezone
GW_LAT
Gateway Latitude
GW_LON
Gateway Longitude
TXT
Text assigned to node for identification purposes
E64
Mac Address of Node
10m
V_MCU
Microcontroller Voltage
P0_T
V_A1
Wind Speed
V_A2
Wind direction
T
Temperature sensor reading
2m
T_SHT2X
Temperature reading from SHT 25
RH_SHT2X
Humidity reading from SHT25
9
V_MCU
Microcontroller Voltage
GND
PS
Power save indicator
T
Air temperature reading
T1
Soil temperature
V_MCU
MCU input voltage
V_IN
Input voltage
V_A1
Soil moisture
Sink
4.3
Data Extraction
Before data analysis, extracting and formatting it is necessary especially for benchmarking or research
purposes. In order to format, organize or filter out required data,
seltag a software, which is compiled with
sensd
[7]
is used. Sensd can be downloaded fro
m
For example, in order to
format 2m data to display columns containing date, temperature and relative
humidity, issue the following seltag command
, extracted from data_file and writing sorted data to 2m.dat
more data_file
.dat | grep 2m
| grep ^20 |
seltag
-
sel T_SHT2X=%s
RH_SHT2X=%s | grep
-
v Miss
>
>
2m
.dat
The formatted data may help
in
plotting data
References
[1]
Radio sensors.
[Online]. Available: radio
-
sensors.com.
[2]
How to Make a Raspberry Pi disk image to SD card with win32diskimager.
[Online]. Available:
http://raspi.tv/2012/how
-
to
-
make
-
a
-
raspberry
-
pi
-
disk
-
image
-
to
-
sd
-
card
-
with
-
win32diskimager.
[3]
Ultimate Raspberry Pi Configuration Guide.
[Online]. Available:
http://www.instructables.com/id/Ultimate
-
Raspberry
-
Pi
-
Configuration
-
Guide/?ALLSTEPS.
[4]
Raspberry Pi as a 3g (Huawei E303) wireless (Edimax EW
-
7811Un) router.
[5]
Raspberry Pi: Phoning H
ome Using a Reverse Remote Ssh Tunnel.
[Online]. Available:
https://www.tunnelsup.com/raspberry
-
pi
-
phoning
-
home
-
using
-
a
-
reverse
-
remote
-
ssh
-
tunnel/.
[6]
Passwordless SSH access.
[7]
WSN sensor daemon and supporting utilities.
10