Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions adafruit_rfm69.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,8 @@ def __init__(self, spi, cs, reset, frequency, *, sync_word=b'\x2D\xD4',
self.encryption_key = encryption_key
# Set transmit power to 13 dBm, a safe value any module supports.
self.tx_power = 13
# last RSSI reading
self.last_rssi = 0.

# pylint: disable=no-member
# Reconsider this disable when it can be tested.
Expand Down Expand Up @@ -765,6 +767,8 @@ def receive(self, timeout=0.5, keep_listening=True, with_header=False,
timed_out = True
# Payload ready is set, a packet is in the FIFO.
packet = None
# save RSSI
self.last_rssi = self.rssi
# Enter idle mode to stop receiving other packets.
self.idle()
if timed_out:
Expand Down
2 changes: 1 addition & 1 deletion examples/rfm69_rpi_interrupt.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def rfm69_callback(rfm69_irq):
# Print out the raw bytes of the packet:
print('Received (raw bytes): {0}'.format(packet))
print([hex(x) for x in packet])
print('RSSI: {0}'.format(rfm69.rssi))
print('RSSI: {0}'.format(rfm69.last_rssi))


# Define radio parameters.
Expand Down