martynwheeler / u-lora

raspi-lora for micropython
GNU General Public License v3.0
74 stars 13 forks source link

"LoRa initialization failed" #9

Closed mikewhetzel closed 1 year ago

mikewhetzel commented 1 year ago

Hello, I am getting the following error on an ESP32 WROOM when attempting to run either the client or the server examples:

Traceback (most recent call last):
  File "<stdin>", line 15, in <module>
  File "ulora.py", line 136, in __init__
AssertionError: LoRa initialization failed

I am relatively sure that all of my wires are connected correctly. I am powering the RFM95W from the 3v3 pin on the ESP32, which should be able to provide enough current, according to the docs. I've tried wiring the reset to pin 0, which is the built-in boot button on the board. I've successfully used that button in micropython scripts before on the same unit once booted.

I am using the esp32_2 defaults as they seem to correspond to my unit. I am using the defaults for everything but CS (channel) - the ulora.py script lists the default channel pin as 2, but I am using pin 5 which is the default SPI channel pin as far as I'm aware. Especially since I eventually intend to work Lora into other scripts I am working on, pin 2 conflicts with an onboard LED that is used in my other functions.

I changed this in the client and server scripts to reflect my changes. I have an interrupt pin set up on pin 21, and I currently have the reset pin linked to pin 0 which is the onboard boot button, useable as a GPIO once firmware is booted.

I also adjusted the tuning parameter of the client and server scripts to 915.0 to reflect US ISM frequencies.

I did notice that I get the same error even when I completely remove power from the RFM95W unit. I have tried with two separate but identical, brand new Lora radio boards and still get the same error.

It seems as though the radio is failing to initialize when the script tries to communicate to set the mode. Does anyone have any suggestions?

Thank you

UPDATE: Checked my soldering on the header pins. It turns out I was overly cautious with the heat, and not all of the pins were properly soldered with a good connection. Problem solved!