RPIRFM9 - RFM69 Raspberry Pi hat
The RPIRFM69 hat allows easy integration of a RFM69 module on a Raspberyy Pi.
Application examples:
- Long range communication between 2 Raspberry Pi.
- Gateway for RFM69 devices.
- Control systems in remote area.
All Raspberry Pi versions and format are supported.
Hardware Spec
- Connects to the 40 pin GPIO pin
- 1 SMA Antenna Port
- 4 Mounting holes.
Software
The hat can be controlled using the rpi-rfm69 Python library. You can install it using
pip install rpi-rfm69
The full documentation for the library is here: https://rpi-rfm69.readthedocs.io/en/latest/api.html.
We provide below two simple examples. The first one just print all packet received. The second one sends hello
everything 5 seconds.
Receiving script
from RFM69 import Radio, FREQ_315MHZ, FREQ_433MHZ, FREQ_868MHZ, FREQ_915MHZ
node_id = 2
network_id = 0
board = {'isHighPower': True, 'encryptionKey': "TOPSECRETPASSWRD"}
with Radio(FREQ_433MHZ, node_id, network_id, verbose=False, **board) as radio:
while True:
# This call will block until a packet is received,
packet = radio.get_packet(timeout = 10)
# If radio.get_packet times out, it will return None
if packet is None:
print("No packet received in the last 10 seconds")
else:
# Process packet
print (packet)
Make sure you change FREQ_433MHZ
with the appropriate frequency for your RFM69 module.
Transmitting script
import time
from RFM69 import Radio, FREQ_315MHZ, FREQ_433MHZ, FREQ_868MHZ, FREQ_915MHZ
node_id = 1
network_id = 0
recipient_id = 2
board = {'isHighPower': True, 'encryptionKey': "TOPSECRETPASSWRD"}
with Radio(FREQ_433MHZ, node_id, network_id, verbose=False, **board) as radio:
while True:
if radio.send(recipient_id, "hello", attempts=3, waitTime=100):
print ("Acknowledgement received")
else:
print ("No Acknowledgement")
time.sleep(5)