Testing a Wireless Sensor

In this tutorial we will show you how to test your wireless sensor. We will cover all our RF sensor types.Before following these steps make sure you have already setup and configured the Gateway.

Open a terminal window on the Raspberry Pi where the Gateway is installed.

Download the serial monitor application:
git clone https://github.com/JemRF/rf_tools.git

python serial_mon.py 

The serial monitor is now running. Any messages received by the Gateway's radio will be displayed on the screen. You can exit the serial monitor anytime by pressing Ctrl-c.

Insert the battery into the sensor with the flat side (+ve) facing upwards. The sensor will send 5 STARTED-- messages followed by a 5 second pause and then it will go to sleep.

Note: If you have a wireless switch do not open/close the switch during the first 5 seconds as this will cause the device to start sending messages and cancel the startup sequence and prevent the device from entering sleep mode.

Note: Ideally put the sensors more than 5 feet away from the receiver when testing otherwise you may see message corruption or incomplete messages. These devices are tuned to transmit at a high DB in order to penetrate walls and for long distance line of sight so we have found when a sensor is very close to the receiver (e.g. 1-2 feet) then we see incomplete messages.

Figure 1 - Insert the battery

Note: The above figure already has a door switch soldered to the button sensors (two white wires between my fingers). This is not necessary at this stage and will be covered later in this tutorial.

Temperature Sensor

python serial_mon.py 9600

Sat Oct 28 20:57:31 2017 02 STARTED--
Sat Oct 28 20:57:31 2017 02 STARTED--
Sat Oct 28 20:57:31 2017 02 STARTED--
Sat Oct 28 20:57:31 2017 02 STARTED--
Sat Oct 28 20:57:31 2017 02 STARTED--

...5 second pause...

Sat Oct 28 20:57:36 2017 02 TMPA22.05
Sat Oct 28 20:57:36 2017 02 SLEEPING-

The above example shows a temperature reading (a02TMPA22.05) before going to sleep. We have configured the sensor to send a reading every 5 minutes. If you wait for 5 minutes then the sensor will awake from sleep and send another temperature reading and then go back to sleep. You can configure the interval to another setting if you wish (see sensor manual or the FLEX module tutorials for more details).


Switch Sensor

python serial_mon.py 9600


Sat Oct 28 21:05:03 2017 02 STARTED--
Sat Oct 28 21:05:03 2017 02 STARTED--
Sat Oct 28 21:05:03 2017 02 STARTED--
Sat Oct 28 21:05:03 2017 02 STARTED--
Sat Oct 28 21:05:03 2017 02 STARTED--
Sat Oct 28 21:05:06 2017 02 STATEOFF-
Sat Oct 28 21:05:07 2017 02 SLEEPING-

In the above example the sensor sent the state of the switch (a02STATEOFF-) before going to sleep. Every time the switch changes state (ie: opens or closes) then the sensor awakens from sleep and transmits the new state of the switch.

Try testing this by closing and opening the switch or bridging the contacts shown in Figure 2. This will also work if your sensor is configured for Temperature sensing.

Figure 2 - Red circle shows the button switch contacts

Messages transmitted when contacts bridged (switch closed):

Sat Oct 28 21:50:41 2017 02 AWAKE----
Sat Oct 28 21:50:41 2017 02 BUTTONON-
Sat Oct 28 21:50:41 2017 02 BUTTONON-
Sat Oct 28 21:50:41 2017 02 SLEEPING-

Messages transmitted when contacts not bridged (switch open):

Sat Oct 28 21:50:43 2017 02 AWAKE----
Sat Oct 28 21:50:43 2017 02 BUTTONOFF
Sat Oct 28 21:50:43 2017 02 BUTTONOFF
Sat Oct 28 21:50:43 2017 02 SLEEPING-

Note: In the above example two BUTTONON/OFF messages are sent every time the switch state changes. This is merely precautionary in case one message is missed by the receiver. The number of messages can be configured using the NOMSG command (see sensor manual for more details on that).

Light Sensor

Messages transmitted when sensor is started:

Sat Oct 28 20:57:31 2017 02 STARTED--
Sat Oct 28 20:57:31 2017 02 STARTED--
Sat Oct 28 20:57:31 2017 02 STARTED--
Sat Oct 28 20:57:31 2017 02 STARTED--
Sat Oct 28 20:57:31 2017 02 STARTED--

...5 second pause...

Sat Oct 28 20:57:36 2017 02 ANAA1456-
Sat Oct 28 20:57:36 2017 02 SLEEPING-


Messages transmitted every 5 (or INTVL) minutes thereafter.

Sat Oct 28 21:50:43 2017 02 AWAKE----
Sat Oct 28 21:50:43 2017 02 ANAA1456-
Sat Oct 28 21:50:43 2017 02 ANAA1456-
Sat Oct 28 21:50:43 2017 02 SLEEPING-

ANAA refers to Analog Sensor A.

1456 is the light reading.

To change the interval of the transmissions (or other configurations) refer the description above for the temperature sensor.