Skip to content

Fix sleep delay for M4 - fix example for RPi #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 28, 2018
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
5 changes: 1 addition & 4 deletions adafruit_rfm9x.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,8 @@ def __init__(self, spi, cs, reset, frequency, *, preamble_length=8,
# Set sleep mode, wait 10s and confirm in sleep mode (basic device check).
# Also set long range mode (LoRa mode) as it can only be done in sleep.
self.sleep()
self.long_range_mode = True
#self._write_u8(_RH_RF95_REG_01_OP_MODE, 0b10001000)
time.sleep(0.01)
#val = self._read_u8(_RH_RF95_REG_01_OP_MODE)
#print('op mode: {0}'.format(bin(val)))
self.long_range_mode = True
if self.operation_mode != SLEEP_MODE or not self.long_range_mode:
raise RuntimeError('Failed to configure radio for LoRa mode, check wiring!')
except OSError:
Expand Down
4 changes: 2 additions & 2 deletions examples/rfm9x_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
# This is a limitation of the radio packet size, so if you need to send larger
# amounts of data you will need to break it into smaller send calls. Each send
# call will wait for the previous one to finish before continuing.
rfm9x.send('Hello world!\r\n')
print('Sent hello world message!')
rfm9x.send(bytes("Hello world!\r\n","utf-8"))
print('Sent Hello World message!')

# Wait to receive packets. Note that this library can't receive data at a fast
# rate, in fact it can only receive and process one 252 byte packet at a time.
Expand Down