diff --git a/adafruit_rfm9x.py b/adafruit_rfm9x.py index 62eb246..c09173e 100644 --- a/adafruit_rfm9x.py +++ b/adafruit_rfm9x.py @@ -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: diff --git a/examples/rfm9x_simpletest.py b/examples/rfm9x_simpletest.py index a9b4220..95bb1f9 100644 --- a/examples/rfm9x_simpletest.py +++ b/examples/rfm9x_simpletest.py @@ -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.