adafruit / Adafruit_CircuitPython_RFM9x

CircuitPython module for the RFM95/6/7/8 LoRa wireless 433/915mhz packet radios.
MIT License
68 stars 45 forks source link

Potential hang when changing tx_power or frequency_mhz #22

Closed applio closed 5 years ago

applio commented 5 years ago

Using the setter to change tx_power or frequency_mhz after using the radio to send a packet can result in an indefinite hang. It is unknown if this similarly impacts updates to other registers on the radio. To reproduce, try altering tx_power after having already sent packets.

If a fix to prevent such hangs is possible, that would be ideal. If it turns out there is no solution other than first performing a reset, then this behavior should probably be documented.

brentru commented 5 years ago

We were unable to reproduce this on a Feather M4 + RFM96 FeatherWing today.

Setting frequency_mhz:

for freq in range(int(8150), int(9160), int(1)):
    print('MHZ: ', freq/10)
    rfm9x.frequency_mhz = freq/10
    rfm9x.send(bytes("Hello world!\r\n","utf-8"))
    time.sleep(0.1)

tx_power was set within its range to test as well.

Closing out, @applio: Please provide testing setup information if this still fails for you.