Skip to content

Commit f9822d0

Browse files
authored
Merge pull request #10 from jerryneedell/jerryn_sleep
Fix sleep delay for M4 - fix example for RPi
2 parents 86583a6 + 80af9a2 commit f9822d0

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

adafruit_rfm9x.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -353,11 +353,8 @@ def __init__(self, spi, cs, reset, frequency, *, preamble_length=8,
353353
# Set sleep mode, wait 10s and confirm in sleep mode (basic device check).
354354
# Also set long range mode (LoRa mode) as it can only be done in sleep.
355355
self.sleep()
356-
self.long_range_mode = True
357-
#self._write_u8(_RH_RF95_REG_01_OP_MODE, 0b10001000)
358356
time.sleep(0.01)
359-
#val = self._read_u8(_RH_RF95_REG_01_OP_MODE)
360-
#print('op mode: {0}'.format(bin(val)))
357+
self.long_range_mode = True
361358
if self.operation_mode != SLEEP_MODE or not self.long_range_mode:
362359
raise RuntimeError('Failed to configure radio for LoRa mode, check wiring!')
363360
except OSError:

examples/rfm9x_simpletest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
# This is a limitation of the radio packet size, so if you need to send larger
3737
# amounts of data you will need to break it into smaller send calls. Each send
3838
# call will wait for the previous one to finish before continuing.
39-
rfm9x.send('Hello world!\r\n')
40-
print('Sent hello world message!')
39+
rfm9x.send(bytes("Hello world!\r\n","utf-8"))
40+
print('Sent Hello World message!')
4141

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

0 commit comments

Comments
 (0)