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

rfm9x_simpletest.py fails under Blinka #9

Closed jerryneedell closed 6 years ago

jerryneedell commented 6 years ago

I tried running try rfm9x_simpletest.py on a RaspberryPi 3B+ with the latest Blinka (0.2) - the SPI stuff seems fine, but I get the following error

pi@gjnpi3p-1:~/projects/rfm9x/orig $ python3.6 rfm9x_simpletest.py
Traceback (most recent call last):
  File "rfm9x_simpletest.py", line 39, in <module>
    rfm9x.send('Hello world!\r\n')
  File "/usr/local/lib/python3.6/site-packages/adafruit_rfm9x.py", line 561, in send
    self._write_from(_RH_RF95_REG_00_FIFO, data)
  File "/usr/local/lib/python3.6/site-packages/adafruit_rfm9x.py", line 414, in _write_from
    device.write(buf, end=length)
  File "/usr/local/lib/python3.6/site-packages/busio.py", line 112, in write
    return self._spi.write(buf, start, end)
  File "/usr/local/lib/python3.6/site-packages/adafruit_blinka/microcontroller/raspi_23/spi.py", line 47, in write
    self._spi.writebytes([x for x in buf[start:end]])
TypeError: Non-Int/Long value in arguments: 76a38380.

By making this change - the error goes away and it appears to run OK.

39c39,40
< rfm9x.send('Hello world!\r\n')
---
> msg = str.encode('Hello worlt!\n\r')
> rfm9x.send(msg)
pi@gjnpi3p-1:~/projects/rfm9x/orig $ python3.6 rfm9x_simpletest_jerryn.py
Sent hello world message!
Waiting for packets...
Received nothing! Listening again...
Received nothing! Listening again...
Received nothing! Listening again...
Received nothing! Listening again...

I have not fully tested that this is transmitting and receiving. I am testing it remotely and only have one rfm9x connected. I'll do more testing next weekend. The original flle runs OK und CircuitPython -- or it did last time I tried it.

ladyada commented 6 years ago

hiya - is this resolved now?

jerryneedell commented 6 years ago

Yes-resolved by #10.

ladyada commented 6 years ago

awesome