Open ratio-x opened 2 years ago
I think i have the same problem with 2 circuits (Arduino Pro Mini + RFM95 Lora Module). LoRaSender and LoRaReceiver sketches works fine but LoRaReceiverCallback does not. I'm using the default SS = pin 10, RESET = pin 9, DIO0 = pin2 and connections are made in the same way on the circuits. According to datasheets on Arduino Pro Mini pin 2 is interrupt capable.
Did you find any solution about this problem ?
No, I gave up the RFM95W (SX1276) module and switched to the EBYTE E220-900T30D (LLCC68), which works fine for me.
There seems to be a problem with RegIrqFlags, which causes problems in LoRaSimpleGateway and LoRaReceiverCallback example sketches. The following is far beyond my knowledge, so please bear with me if anything has not been described quite correctly.
I have 2 identical hardware setups on breadboard, working with Arduino IDE 2.0.0-rc3
NANO 33 BLE (powered by USB) <--> Adafruit RFM95W breakout (with SMA antenna) D13 <--> SCK +3V3 <--> VIN GND <--> GND D12 <--> MISO D11 <--> MOSI D4 <--> CS D3 <--> G0/IRQ D2 <--> RST
Power supply is sufficient, according to NANO's datasheet there should be 950 mA. All digital pins of NANO are interrupt capable. In the example sketches I'm working with following customization:
I was able to start LoRa communication with the minimalistic LoRaSender and LoRaReceiver sketches, not caring about interrupts and callbacks. So this works with or without D3 <--> G0/IRQ connected. Output as expected:
Using LoRaSimpleGateway and LoRaReceiverCallback sketches, I'm running into problems. First try was with LoRaSimpleGateway. When RFM95W's G0/IRQ pin is connected to NANO's D3 pin, then the Serial Monitor is freezing after exactly one packet was sent outward from gateway. This gateway freeze happens in any case - without node transmissions (powered off) and with node transmissions (node working properly without freeze).
When disconnecting D3 <--> G0/IRQ the gateway does not stop working after first packet sent, again independent from node transmissions.
Next try was with LoRaReceiverCallback (just receiving, not sending) in combination with (proven working) LoRaSender. Unfortunately no confirmed readings:
For further investigation, if the Receiver received a packet at all, I checked RFM95W's G0/IRQ pin (disconnected from NANO's D3) with a logic analyzer. Powering the receiver after starting logic analyzer recording makes visible, that G0/IRQ pin goes from LOW to HIGH immediately after powering.
Inserting a delay of 10 seconds into the setup function of the Receiver (LoRaReceiverCallback) makes visible, that G0/IRQ pin goes from LOW to HIGH 10 seconds after powering.
I repeated this WITHOUT Sender powered and noticed, that that G0/IRQ pin remains LOW.
I investigated with the LoRaSimpleGateway sketch, RFM95W's G0/IRQ pin not connected to NANO's D3 pin, but connected to the logic analyzer. G0/IRQ pin goes from *LOW to HIGH with (or after) first transmission. Repeatingly after 3 seconds (during each transmission) it goes to LOW for 74 ms (milliseconds) and back again to HIGH.
LoRaDumpRegisters with my (above mentioned) customized pins and frequency shows following output:
I continued reading SX1276's datasheet and source code of LoRa.cpp, searching for the code, which initializes RegIrqFlags (0x12), leading to handleDio0Rise() function and writeRegister(REG_IRQ_FLAGS, ...). This is the point where my skills are limited.
I suspect something is wrong with the library (RFM95W does not give interrupt signals, while for very sure it receives packets, so I suspect it was not properly initialized), but I can't prove it.
Any ideas?
Edit: Similar problem discussed here: https://forum.arduino.cc/t/no-callback-interrupt-from-rfm95-lora-using-radiohead/527106