Closed jerryneedell closed 6 years ago
I have confirmed that this issue is still present with CP 3.0 Master. The first check of the configuration fails https://github.com/adafruit/Adafruit_CircuitPython_RFM9x/blob/master/adafruit_rfm9x.py#L360 This appears to be a problem with basic write/read. Note - the driver works under CP 2.2.4 and the RFM69 driver works under CP3.0 master. I have also experienced several instances where the FIle System is corrupted while troubleshooting this. I will hook up a Logic analyzer next and look at the write/read operations.
making progress: setting the RESET to Pull.UP at initialization fixes the driver for CP 3.0
diff --git a/adafruit_rfm9x.py b/adafruit_rfm9x.py
index d5afcef..72d5d93 100644
--- a/adafruit_rfm9x.py
+++ b/adafruit_rfm9x.py
@@ -30,7 +30,7 @@ http: www.airspayce.com/mikem/arduino/RadioHead/
* Author(s): Tony DiCola
"""
import time
-
+import digitalio
from micropython import const
import adafruit_bus_device.spi_device as spi_device
@@ -344,7 +344,7 @@ class RFM9x:
# trigger a reset. Note that reset MUST be done like this and set as
# a high impedence input or else the chip cannot change modes (trust me!).
self._reset = reset
- self._reset.switch_to_input()
+ self._reset.switch_to_input(pull=digitalio.Pull.UP)
self.reset()
# No device type check! Catch an error from the very first request and
# throw a nicer message to indicate possible wiring problems.
@@ -421,7 +421,7 @@ class RFM9x:
# See section 7.2.2 of the datasheet for reset description.
self._reset.switch_to_output(value=False)
time.sleep(0.0001) # 100 us
- self._reset.switch_to_input()
+ self._reset.switch_to_input(pull=digitalio.Pull.UP)
time.sleep(0.005) # 5 ms
def idle(self):
I'm not sure what is different between 2.x in an 3,0, but the RESET was not working when left to the default..
I want to play around with the RESET sequence before submitting a PR but it is nice to have it working!
submitted PR https://github.com/adafruit/Adafruit_CircuitPython_RFM9x/pull/2 that , I hope, takes care of this. In any case, it appears to be a driver issue and not a CP issue. OK to close?
Hi there
I'm having a similar issue. I have connected the RFM96W according to the tutorial here: https://learn.adafruit.com/lora-and-lorawan-radio-for-raspberry-pi/raspberry-pi-wiring. I have two of these modules, one of them is detected but one of them keeps spitting out this error. Is it possible that the module is broken? How can I test if the module is actually broken? Could it be another issue? Your help will be appreciated. Thanks.
are you using the rfm96w breakout? https://www.adafruit.com/product/3073 Since one works, it is likely not a driver or CP issue. First, have you checked the solder connections? Also what pins are you using for Chip Select --when you swap modules are you using the same connections for both or is it on two different Raspberry Pi's
Alos - since this is probably not a CP issue and may be a hardware problem I suggest that you post this on the Forum at https://forums.adafruit.com/viewforum.php?f=19 -- we can continue there and include the Adafruit Support folks.
Hi jerryneedell
Thanks for the response. No I'm not using the rfm96w breakout, I'm using the module as it is. I have checked the connections. I am using CE1 for chip select; it's two different raspberry pi's and I use the sane connections I used on the other pi.
This is how I connected the module to the pi:
rfm96w module = raspberry pi
GND = GND
3.3 V = 3.3 V
DI00 = GPIO 5 (pin 18)
RST = GPIO 25 (pin 37)
CLK = SCLK (pin 23)
MISO = MISO (pin 21)
MOSI = MOSI (pin 19)
NSS = CE1 (pin 26)
The following is the snippet of python code:
import busio from digitalio import DigitalInOut, Direction, Pull import board import adafruit_rfm9x
CS = DigitalInOut(board.CE1) RESET = DigitalInOut(board.D25)
spi = busio.SPI(board.SCK, board.MOSI, board.MISO) rfm9x = adafruit_rfm9x.RFM9x(spi, CS, RESET, 868.0)
The code fails when I create the rfm9x object and spits the error: "failed to find rfm9x with expected expected version -- check wiring". I printed the version in the adafruit_rfm9x.py file everytime I run and it spits out a 0. I realised I did not specify this error in my previous post and I apologise for that.
Thanks.
Can you swap the module with the working one on the other Pi?
You may want to post this to the discord channel for radio discussion, https://adafru.it/discord then go to the #help-with-radio channel
Hey @Makabongwe-Nkabinde , did you ever get this figured out? I'm having the same problem. Triple checked my wiring...
@jonathanmccormick please provide more details about your issue. What boards are you using. What code? Are you using the latest libraries. Are you using a raspberry pi or if not, what MCU and what version of CIrcuitPython. I have been running these libraries successfully on both Circuitpython and Raspberry Pis
Also please open this issue in the repository for the RFM9x library https://github.com/adafruit/Adafruit_CircuitPython_RFM9x
@jonathanmccormick the issue was with the chip itself, I bought a new one and that solved the issue. The other issue could could be the interrupt request pin, make sure that is configured correctly.
Running the basic test fails under CP3..0 alpha (current master) It works under CP 2.2.4
Same boards, only change is reloading CP and libraries.
lora_test.py is just the repo simpletest with the correct pins set.