Waking the Raspberry Pi with a wireless command
Wake Up
The Pi responsible for issuing the wake up call starts with rfwake LocalRFID RemoteRFID GPIO-Pin
(Listing 6). The Pi that needs to wake up begins to boot after a few moments. Once this happens, you will find the RFID of the calling Pi in the log file. You should configure its own local RFID as well as the GPIO pin on the P1 plug in the /etc/default/rtc
file. The start scripts will automatically communicate the information contained there to Rfwait and Rfrespond.
Listing 6
Output of rfwake
¤¤nonumber $ rfwake 11:22:33:44:55:66:77:88 01:23:45:67:89:AB:CD:EF 25 1. Wake-Telegram sent. 2. Wake-Telegram sent. [...] 169. Wake-Telegram sent. ACK received from called Station RFID 01:23:45:67:89:ab:cd:ef
In the interest of being thorough, consider at this point how to configure the Pi so that it can be awakened via a timer. Set a relative time interval for the future as shown in the first line of Listing 7. In the example used, this amounts to 180 seconds. You can set an absolute point in time as demonstrated by the second line. This arrangement ignores alarm times from the past. It can handle alarm events in the near future, by setting them to occur in precisely 2 minutes.
Listing 7
wakealarm
¤¤nonumber $ sudo sh -c ,echo $(($(date +%s) + 180)) > /etc/wakealarm' $ sudo sh -c ,date -d "2015-10-31 18:00:00" +%s > /etc/wakealarm'
Conclusion
The author's Raspberry Pi boots reliably across a distance of several floors, through two steel and concrete ceilings. The 868 MHz band in the environment is quiet. The Pi in question is installed under the building's roof and actsas a weather station. It measures solar radiation every 10 minutes. Every evening it promptly responds to the wireless wake up call to transmit the data via WiFi. A lead battery which is recharged once a week serves as the power supply.
This project requires some practice in constructing and operating more complex electronic switches and more extensive electronics work and shop equipment. In return for your efforts, you will get a solid base for performing additional experiments in the area of short range wireless. For example you can work on optimizing the balance between shorter distances and data throughput.
There are possibilities for those who want to do even more. The 868 MHz band is only a small part of the full SRD range of 863 to 870 MHz. Familiarity with the ETSI documents and the data sheets for the wireless module provides a good way to acquire the necessary knowledge.
README
If you decide to use a Raspberry Pi running on solar power for tasks carried out via WiFi, then ideally, start up and shut down should be at specific timesto conserve power.The setup described in this article boots the Pi with a radio signal trigger.
Caution
The project presented here is the author's best attempt to remain within the ETSI specifications especially with respect to maximum transmission capacity, length of transmission and the permitted transmission spectrum. However this information is not guaranteed to be accurate.
Infos
- Raspberry Spy: Witty Pi http://www.raspberrypi-spy.co.uk/2015/06/witty-pi-a-realtime-clock-and-power-management-for-your-raspberry-pi/#prettyPhoto
- RFM69HCW ISM TRANSCEIVER MODULE v1.1: https://cdn.sparkfun.com/datasheets/Wireless/General/RFM69HCW-V1.1.pdf
- Transceiver Component SX1231: http://www.semtech.com/wireless-rf/rf-transceivers/sx1231/
- ETSI EN 300 220-1: http://www.etsi.org/deliver/etsi_en%5C300200_300299%5C30022001%5C02.04.01_60%5Cen_30022001v020401p.pdf
- Raspbian: https://www.raspberrypi.org/downloads/raspbian/
- Wiring Pi: http://wiringpi.com
- RPiwakeonRnR: https://gitlab.com/dieheins/RPiwakeonRnR
« Previous 1 2 Next »
Buy this article as PDF
Pages: 7
(incl. VAT)