Skip to content

Commit 7a9b9b5

Browse files
committed
Add RSSI and tx power to example.
1 parent 54d0703 commit 7a9b9b5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

examples/simpletest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
# Note that the radio is configured in LoRa mode so you can't control sync
2828
# word, encryption, frequency deviation, or other settings!
2929

30+
# You can however adjust the transmit power (in dB). The default is 13 dB but
31+
# high power radios like the RFM95 can go up to 23 dB:
32+
rfm9x.tx_power = 23
33+
3034
# Send a packet. Note you can only send a packet up to 252 bytes in length.
3135
# This is a limitation of the radio packet size, so if you need to send larger
3236
# amounts of data you will need to break it into smaller send calls. Each send
@@ -56,3 +60,7 @@
5660
# sending side is sending ASCII data before you try to decode!
5761
packet_text = str(packet, 'ascii')
5862
print('Received (ASCII): {0}'.format(packet_text))
63+
# Also read the RSSI (signal strength) of the last received message and
64+
# print it.
65+
rssi = rfm9x.rssi
66+
print('Received signal strength: {0} dB'.format(rssi))

0 commit comments

Comments
 (0)