Download and run the wireless software

At this point you should have built the base station receiver and at least one sensor.  

You will be using the serial communications so you need to install the Python serial libraries. At the Raspberry Pi command prompt type:

  apt-get install python-serial

Next make sure you are on the latest PrivateEyePi software. Follow the following tutorial to install or upgrade your system: PrivateEyePi Installation

Now you are ready to test the unit. We included a test program called rfthermtest.py that will read the incoming RF signals. It was designed specificlly for the temperature sensor but will work with any of the wireless sensors. Make sure that the RF transmitter and the base station are correctly wired and powered. Run the rfthermtest.py by typing the following command:

  cd /home

  sudo python rfthermtest.py

If you testing a temperature sensor then wait for at least 5 minutes for the first temperature reading to come through.

This utility will also work with a wireless switch, but instead of printing the temperature values on the screen it will print BUTTONAON (button A is on), BUTTONAOF (button A is off) or BUTTONBON, BUTTONBOF.

Make a note of the DeviceID that you will use to link it to PrivateEyePi.

A temperature reading will display after a maximum of 5 minutes along with the unique identifier of the sensor displayed on the screen.

Now that you know the sensor is transmitting signals correctly you are ready to link it to your dashboard.

If you have not already created a PrivateEyePi account then follow this tutorial:

  Create a PrivateEyePi Username and Password

Each RF transmitter is pre-configured with a unique sensor number (DeviceID). You can use this number to associate the temperature reading with the sensor. The next step is to configure the PrivateEyePi dashboard with the sensor numbers and link them to a location so they can be displayed correctly. Follow figures 2 and 3 in order to complete this configuration. 


Go to www.privateeyepi.com and log in using your user, then navigate to the GPIO menu.

Figure 2 - Configure the sensor number of your sensor using the GPIO menu option

Select menu option Location and enter the description of your sensor:


Figure 3 - Describe your sensor using the Location menu option

Wireless Switch Information

If you are using the wireless switch then you configure the Device ID the same way as the above temperature sensor example in Figure 2&3.

From November 2015 we started shipping wireless switches that support only one button because there is significant battery savings. You can, however, load the two button firmware yourself or ask us to do it for you before we ship to you (or ship the sensor to us as we'll do it for you). 

A single wireless switch can accommodate two switches (know as Button A and Button B). Button A will send a device Id that was printed on the wireless switch packaging. However for Button B we need to configure another setting in the globals.py to map the button B sensor to the number you configured for the sensor in Figure 2 above. In order to do this follow the following steps:

Open globals.py and look for the Button B configuration shown below. Set the ButtonBList value equal to the device Id of your switch, and set the ButtonBId to the number you configured for the sensor (refer Figure 2). In the example below DeviceId 80 is mapped to sensor number 90. Un-comment the two lines by deleting the # at the front. Repeat these two lines for every Button B sensor you have.

To edit globals.py type:

nano globals.py

        #Configure your button B sensors here

        #Button B is the second button on the RF Switch

        ButtonBList = []

        ButtonBId = []

        ButtonBList.append(80) # this is the device ID of the sensor 

        ButtonBId.append(90)   # sensor number defined in the number field in the GPIO settings

Press Ctrl-x y ENTER to save

Run the software

You are now ready to run the rfsensor.py program that will populate your dashboard which can be viewed on-line.

At the command prompt type:

  cd /home

  sudo python rfsensor.py

Wait for 5 minutes then log into your dashboard at www.privateeyepi.com to view the temperature readings.

Now that your remote temperature sensor(s) are up and running you will want to automate the rfsensor.py program so that is runs as a background process and restarts every time you reboot your Raspberry Pi. Follow this tutorial in order to achieve that.

I hope you have enjoyed this project. For support email support@privateeyepi.com or join the blog on the home page and post questions there.


Comments