FORUM

Sx1276 stops receiving at random times

I am working on a remote control project using ESP32 and LoRa.

I have included a Hoperf RFM95 that has a SX1276 on board. I have made 5 PCB’s and had them assembled. I have two devices on my board using SPI, the LoRa chip and a LCD display.
I use Visual Studio / PlatformIO / Sandeep Mistry Lora library.
Everything else on my board is working flawlessly but the LoRa part I have big difficulties with.
It is easy to get it up and running communicating with other boards. The trouble is that a board will stop receiving at a random time. Only a hardware reset of the Lora board will make it start receiving again.
In my software I have tried to work around the problem by implementing a software WDT on the receiver that resets the LoRa chip using a MCU i/o connected to LoRa reset.
If the board does not receive any packages within a certain timeframe the MCU will reset the LoRa.

I have been suspecting a software bug causing the trouble. So far I have been unable to find it.

The LoRa chip raises the DIO0 pin for about 50uSec when the chip has received a package.

In my case the payload is 9 bytes including an addressing scheme.

When measuring the DIO0 output from the radio I notice that when the radio stops receiving it is no longer raising the DIO0 pin. This makes me believe that the problem is not in software.
When setting up 2 receiver boards and logging the data they receive I notice that both boards will fail. But at random times. One board will happily receive the incoming packets while the other is frozen. This makes me conclude that the problem is not the transmitter either.

In the hope that some of the internal registers of the SX1276 would reveal why this happens I wrote a small routine that only receives packages and print them out. When the radio stops working it prints out the register content, then I hw-reset the radio and re-initialize it, and prints out the new register content after reset.
I leave this running for a long time.

I did two tests the last 2 days.

First test - Send packages with very short delay (100 - 300 mSec):

Start test, time: 14:58:57
End test, time: 20:22:27
Running time: 5:23:30
Number of times radio Rx stopped working: 104
Number of successful packages: 192.211
Errors per hour 19.3

Second test- Send packages with ca 16 Seconds delay:

Start test, time: 20:39:48
End test, time: 20:28:24 (next day)
Running time: 23:48:36
Number of times radio stopped working: 57
Number of successful packages: 5.335
Errors per hour 2.39

As expected, and as experienced earlier, the time between each package received contributes to the error count. Short time - more errors. But even if minutes pass between every package I still get lots of lock-ups on the LoRa.

And it has to be reset to start working again. But it does communicate over SPI even if it has stopped receiving.

Worried that I might have a hw-problem I breadboard - prototyped a ESP-32 module (DevKit-C) and connected a different LoRa radio - the Ra-02 that use the same family of chips. I set it up as a receiver and have had it running for around 3.5 hours now. So far 3 necessary resets.

Too early to conclude but it seems to have a lower error rate. I use 16 secs between the packages sent.
I write n desperation :slight_smile:
Can you please give me some advice here?

I have googled it but do not find a lot on the subject.

Maybe you can take a look at the registers - including the “reserved” ones, and see if you can understand why this happens.

And - if it is unavoidable: Is there a way to poll the SX127x so that I know that the radio has stopped before I notice the missing packages ?

Perhaps this problem sets a particular bit in one of the registers. Then I could easily poll that and reset when it happened. That would make a huge difference.

I have timestamped log files of all the tests I have done.

Here included one examples from the log file. Register content before (When radio is not receiving) and after reset (When radio has been set up again and is working).

I have many more.

Best regards,

Per Inge Kvindesland

Electronic engineer

Kretskort Service AS

Norway

[2021-05-03 21:36:23.836] Diff ID: 0 Rx-RSSI: -55 To: 200 From: 203 ID: 009 [8][84][114][111][117][98][108][101][115]

[2021-05-03 21:36:39.016] Diff ID: 0 Rx-RSSI: -56 To: 200 From: 203 ID: 010 [8][84][114][111][117][98][108][101][115]

[2021-05-03 21:36:54.196] Diff ID: 0 Rx-RSSI: -55 To: 200 From: 203 ID: 011 [8][84][114][111][117][98][108][101][115]

[2021-05-03 21:37:09.383] Diff ID: 0 Rx-RSSI: -53 To: 200 From: 203 ID: 012 [8][84][114][111][117][98][108][101][115]

[2021-05-03 21:37:24.556] Diff ID: 0 Rx-RSSI: -55 To: 200 From: 203 ID: 013 [8][84][114][111][117][98][108][101][115]

[2021-05-03 21:37:45.085] Receiver has not gotten any messages for 20 Secs. Will reset. This is Reset Nr.: 2

[2021-05-03 21:37:45.085] RX RSSI: -55

[2021-05-03 21:37:45.085] Dumpreg before resets:

[2021-05-03 21:37:45.085] 0x0: 0xC8

[2021-05-03 21:37:45.085] 0x1: 0x86

[2021-05-03 21:37:45.085] 0x2: 0x1A

[2021-05-03 21:37:45.085] 0x3: 0xB

[2021-05-03 21:37:45.085] 0x4: 0x0

[2021-05-03 21:37:45.085] 0x5: 0x52

[2021-05-03 21:37:45.105] 0x6: 0x6C

[2021-05-03 21:37:45.105] 0x7: 0x40

[2021-05-03 21:37:45.105] 0x8: 0x0

[2021-05-03 21:37:45.105] 0x9: 0x8F

[2021-05-03 21:37:45.105] 0xA: 0x9

[2021-05-03 21:37:45.105] 0xB: 0x2B

[2021-05-03 21:37:45.105] 0xC: 0x23

[2021-05-03 21:37:45.105] 0xD: 0x1

[2021-05-03 21:37:45.105] 0xE: 0x0

[2021-05-03 21:37:45.105] 0xF: 0x0

[2021-05-03 21:37:45.105] 0x10: 0x0

[2021-05-03 21:37:45.105] 0x11: 0x0

[2021-05-03 21:37:45.105] 0x12: 0x0

[2021-05-03 21:37:45.105] 0x13: 0xC

[2021-05-03 21:37:45.105] 0x14: 0x0

[2021-05-03 21:37:45.105] 0x15: 0xE9

[2021-05-03 21:37:45.105] 0x16: 0x0

[2021-05-03 21:37:45.145] 0x17: 0xE5

[2021-05-03 21:37:45.145] 0x18: 0x24

[2021-05-03 21:37:45.145] 0x19: 0x13

[2021-05-03 21:37:45.145] 0x1A: 0x6D

[2021-05-03 21:37:45.145] 0x1B: 0x31

[2021-05-03 21:37:45.145] 0x1C: 0x40

[2021-05-03 21:37:45.145] 0x1D: 0x72

[2021-05-03 21:37:45.145] 0x1E: 0x74

[2021-05-03 21:37:45.145] 0x1F: 0x64

[2021-05-03 21:37:45.145] 0x20: 0x0

[2021-05-03 21:37:45.145] 0x21: 0x8

[2021-05-03 21:37:45.145] 0x22: 0x1

[2021-05-03 21:37:45.145] 0x23: 0xFF

[2021-05-03 21:37:45.145] 0x24: 0x0

[2021-05-03 21:37:45.145] 0x25: 0x0

[2021-05-03 21:37:45.145] 0x26: 0x4

[2021-05-03 21:37:45.145] 0x27: 0x0

[2021-05-03 21:37:45.145] 0x28: 0xF

[2021-05-03 21:37:45.145] 0x29: 0x5B

[2021-05-03 21:37:45.145] 0x2A: 0x40

[2021-05-03 21:37:45.145] 0x2B: 0x0

[2021-05-03 21:37:45.145] 0x2C: 0x10

[2021-05-03 21:37:45.145] 0x2D: 0x50

[2021-05-03 21:37:45.145] 0x2E: 0x14

[2021-05-03 21:37:45.145] 0x2F: 0x45

[2021-05-03 21:37:45.145] 0x30: 0x55

[2021-05-03 21:37:45.145] 0x31: 0xC3

[2021-05-03 21:37:45.145] 0x32: 0x5

[2021-05-03 21:37:45.145] 0x33: 0x27

[2021-05-03 21:37:45.145] 0x34: 0x1C

[2021-05-03 21:37:45.145] 0x35: 0xA

[2021-05-03 21:37:45.145] 0x36: 0x3

[2021-05-03 21:37:45.145] 0x37: 0xA

[2021-05-03 21:37:45.145] 0x38: 0x42

[2021-05-03 21:37:45.145] 0x39: 0x32

[2021-05-03 21:37:45.145] 0x3A: 0x52

[2021-05-03 21:37:45.145] 0x3B: 0x1D

[2021-05-03 21:37:45.185] 0x3C: 0x0

[2021-05-03 21:37:45.185] 0x3D: 0xAF

[2021-05-03 21:37:45.185] 0x3E: 0x0

[2021-05-03 21:37:45.185] 0x3F: 0x0

[2021-05-03 21:37:45.185] 0x40: 0x0

[2021-05-03 21:37:45.185] 0x41: 0x0

[2021-05-03 21:37:45.185] 0x42: 0x12

[2021-05-03 21:37:45.185] 0x43: 0x24

[2021-05-03 21:37:45.185] 0x44: 0x2D

[2021-05-03 21:37:45.185] 0x45: 0x0

[2021-05-03 21:37:45.185] 0x46: 0x3

[2021-05-03 21:37:45.185] 0x47: 0x0

[2021-05-03 21:37:45.185] 0x48: 0x4

[2021-05-03 21:37:45.185] 0x49: 0x23

[2021-05-03 21:37:45.185] 0x4A: 0x0

[2021-05-03 21:37:45.185] 0x4B: 0x9

[2021-05-03 21:37:45.185] 0x4C: 0x5

[2021-05-03 21:37:45.185] 0x4D: 0x84

[2021-05-03 21:37:45.185] 0x4E: 0x32

[2021-05-03 21:37:45.185] 0x4F: 0x2B

[2021-05-03 21:37:45.185] 0x50: 0x14

[2021-05-03 21:37:45.185] 0x51: 0x0

[2021-05-03 21:37:45.185] 0x52: 0x0

[2021-05-03 21:37:45.185] 0x53: 0x10

[2021-05-03 21:37:45.185] 0x54: 0x0

[2021-05-03 21:37:45.185] 0x55: 0x0

[2021-05-03 21:37:45.185] 0x56: 0x0

[2021-05-03 21:37:45.185] 0x57: 0xF

[2021-05-03 21:37:45.185] 0x58: 0xE0

[2021-05-03 21:37:45.185] 0x59: 0x0

[2021-05-03 21:37:45.185] 0x5A: 0xC

[2021-05-03 21:37:45.185] 0x5B: 0xED

[2021-05-03 21:37:45.185] 0x5C: 0x6

[2021-05-03 21:37:45.185] 0x5D: 0x0

[2021-05-03 21:37:45.185] 0x5E: 0x5C

[2021-05-03 21:37:45.185] 0x5F: 0x78

[2021-05-03 21:37:45.185] 0x60: 0x0

[2021-05-03 21:37:45.185] 0x61: 0x1C

[2021-05-03 21:37:45.185] 0x62: 0xE

[2021-05-03 21:37:45.185] 0x63: 0x5B

[2021-05-03 21:37:45.185] 0x64: 0xCC

[2021-05-03 21:37:45.185] 0x65: 0x0

[2021-05-03 21:37:45.185] 0x66: 0x1

[2021-05-03 21:37:45.185] 0x67: 0x50

[2021-05-03 21:37:45.185] 0x68: 0x0

[2021-05-03 21:37:45.185] 0x69: 0x0

[2021-05-03 21:37:45.185] 0x6A: 0x0

[2021-05-03 21:37:45.185] 0x6B: 0x0

[2021-05-03 21:37:45.185] 0x6C: 0x0

[2021-05-03 21:37:45.185] 0x6D: 0x0

[2021-05-03 21:37:45.185] 0x6E: 0x0

[2021-05-03 21:37:45.185] 0x6F: 0xB

[2021-05-03 21:37:45.185] 0x70: 0xD0

[2021-05-03 21:37:45.185] 0x71: 0x0

[2021-05-03 21:37:45.185] 0x72: 0x13

[2021-05-03 21:37:45.185] 0x73: 0x0

[2021-05-03 21:37:45.185] 0x74: 0x0

[2021-05-03 21:37:45.185] 0x75: 0x0

[2021-05-03 21:37:45.185] 0x76: 0x0

[2021-05-03 21:37:45.185] 0x77: 0x0

[2021-05-03 21:37:45.185] 0x78: 0x0

[2021-05-03 21:37:45.185] 0x79: 0x0

[2021-05-03 21:37:45.185] 0x7A: 0x0

[2021-05-03 21:37:45.185] 0x7B: 0x0

[2021-05-03 21:37:45.185] 0x7C: 0x0

[2021-05-03 21:37:45.185] 0x7D: 0x0

[2021-05-03 21:37:45.185] 0x7E: 0x0

[2021-05-03 21:37:45.185] 0x7F: 0x0

[2021-05-03 21:37:45.185] -END LORA DumReg-

[2021-05-03 21:37:45.185] RFM95W Hardware reset now

[2021-05-03 21:37:45.205] Dumpreg AFTER reset and new RFM95W setup:

[2021-05-03 21:37:45.205] 0x0: 0xC8

[2021-05-03 21:37:45.205] 0x1: 0x81

[2021-05-03 21:37:45.205] 0x2: 0x1A

[2021-05-03 21:37:45.205] 0x3: 0xB

[2021-05-03 21:37:45.205] 0x4: 0x0

[2021-05-03 21:37:45.205] 0x5: 0x52

[2021-05-03 21:37:45.205] 0x6: 0x6C

[2021-05-03 21:37:45.205] 0x7: 0x40

[2021-05-03 21:37:45.205] 0x8: 0x0

[2021-05-03 21:37:45.205] 0x9: 0x8F

[2021-05-03 21:37:45.205] 0xA: 0x9

[2021-05-03 21:37:45.205] 0xB: 0x2B

[2021-05-03 21:37:45.205] 0xC: 0x23

[2021-05-03 21:37:45.205] 0xD: 0x1

[2021-05-03 21:37:45.205] 0xE: 0x0

[2021-05-03 21:37:45.205] 0xF: 0x0

[2021-05-03 21:37:45.205] 0x10: 0x0

[2021-05-03 21:37:45.205] 0x11: 0x0

[2021-05-03 21:37:45.205] 0x12: 0x0

[2021-05-03 21:37:45.205] 0x13: 0x0

[2021-05-03 21:37:45.205] 0x14: 0x0

[2021-05-03 21:37:45.205] 0x15: 0x0

[2021-05-03 21:37:45.205] 0x16: 0x0

[2021-05-03 21:37:45.205] 0x17: 0x0

[2021-05-03 21:37:45.205] 0x18: 0x10

[2021-05-03 21:37:45.205] 0x19: 0x0

[2021-05-03 21:37:45.205] 0x1A: 0x0

[2021-05-03 21:37:45.245] 0x1B: 0x0

[2021-05-03 21:37:45.245] 0x1C: 0x0

[2021-05-03 21:37:45.245] 0x1D: 0x72

[2021-05-03 21:37:45.245] 0x1E: 0x74

[2021-05-03 21:37:45.245] 0x1F: 0x64

[2021-05-03 21:37:45.245] 0x20: 0x0

[2021-05-03 21:37:45.245] 0x21: 0x8

[2021-05-03 21:37:45.245] 0x22: 0x1

[2021-05-03 21:37:45.245] 0x23: 0xFF

[2021-05-03 21:37:45.245] 0x24: 0x0

[2021-05-03 21:37:45.245] 0x25: 0x0

[2021-05-03 21:37:45.245] 0x26: 0x4

[2021-05-03 21:37:45.245] 0x27: 0x0

[2021-05-03 21:37:45.245] 0x28: 0x0

[2021-05-03 21:37:45.245] 0x29: 0x0

[2021-05-03 21:37:45.245] 0x2A: 0x0

[2021-05-03 21:37:45.245] 0x2B: 0x0

[2021-05-03 21:37:45.245] 0x2C: 0x0

[2021-05-03 21:37:45.245] 0x2D: 0x50

[2021-05-03 21:37:45.245] 0x2E: 0x14

[2021-05-03 21:37:45.245] 0x2F: 0x45

[2021-05-03 21:37:45.245] 0x30: 0x55

[2021-05-03 21:37:45.245] 0x31: 0xC3

[2021-05-03 21:37:45.245] 0x32: 0x5

[2021-05-03 21:37:45.245] 0x33: 0x27

[2021-05-03 21:37:45.245] 0x34: 0x1C

[2021-05-03 21:37:45.245] 0x35: 0xA

[2021-05-03 21:37:45.245] 0x36: 0x3

[2021-05-03 21:37:45.245] 0x37: 0xA

[2021-05-03 21:37:45.245] 0x38: 0x42

[2021-05-03 21:37:45.245] 0x39: 0x32

[2021-05-03 21:37:45.245] 0x3A: 0x52

[2021-05-03 21:37:45.245] 0x3B: 0x1D

[2021-05-03 21:37:45.245] 0x3C: 0x0

[2021-05-03 21:37:45.245] 0x3D: 0xAF

[2021-05-03 21:37:45.245] 0x3E: 0x0

[2021-05-03 21:37:45.245] 0x3F: 0x0

[2021-05-03 21:37:45.245] 0x40: 0x0

[2021-05-03 21:37:45.245] 0x41: 0x0

[2021-05-03 21:37:45.245] 0x42: 0x12

[2021-05-03 21:37:45.245] 0x43: 0x24

[2021-05-03 21:37:45.245] 0x44: 0x2D

[2021-05-03 21:37:45.245] 0x45: 0x0

[2021-05-03 21:37:45.245] 0x46: 0x3

[2021-05-03 21:37:45.245] 0x47: 0x0

[2021-05-03 21:37:45.245] 0x48: 0x4

[2021-05-03 21:37:45.245] 0x49: 0x23

[2021-05-03 21:37:45.245] 0x4A: 0x0

[2021-05-03 21:37:45.245] 0x4B: 0x9

[2021-05-03 21:37:45.275] 0x4C: 0x5

[2021-05-03 21:37:45.275] 0x4D: 0x84

[2021-05-03 21:37:45.275] 0x4E: 0x32

[2021-05-03 21:37:45.275] 0x4F: 0x2B

[2021-05-03 21:37:45.275] 0x50: 0x14

[2021-05-03 21:37:45.275] 0x51: 0x0

[2021-05-03 21:37:45.275] 0x52: 0x0

[2021-05-03 21:37:45.275] 0x53: 0x10

[2021-05-03 21:37:45.275] 0x54: 0x0

[2021-05-03 21:37:45.275] 0x55: 0x0

[2021-05-03 21:37:45.275] 0x56: 0x0

[2021-05-03 21:37:45.275] 0x57: 0xF

[2021-05-03 21:37:45.275] 0x58: 0xE0

[2021-05-03 21:37:45.275] 0x59: 0x0

[2021-05-03 21:37:45.275] 0x5A: 0xC

[2021-05-03 21:37:45.275] 0x5B: 0xEB

[2021-05-03 21:37:45.275] 0x5C: 0x6

[2021-05-03 21:37:45.275] 0x5D: 0x0

[2021-05-03 21:37:45.275] 0x5E: 0x5C

[2021-05-03 21:37:45.275] 0x5F: 0x78

[2021-05-03 21:37:45.275] 0x60: 0x0

[2021-05-03 21:37:45.275] 0x61: 0x1C

[2021-05-03 21:37:45.275] 0x62: 0xE

[2021-05-03 21:37:45.275] 0x63: 0x5B

[2021-05-03 21:37:45.275] 0x64: 0xCC

[2021-05-03 21:37:45.275] 0x65: 0x0

[2021-05-03 21:37:45.275] 0x66: 0x1

[2021-05-03 21:37:45.275] 0x67: 0x50

[2021-05-03 21:37:45.275] 0x68: 0x0

[2021-05-03 21:37:45.275] 0x69: 0x0

[2021-05-03 21:37:45.275] 0x6A: 0x0

[2021-05-03 21:37:45.275] 0x6B: 0x0

[2021-05-03 21:37:45.275] 0x6C: 0x0

[2021-05-03 21:37:45.275] 0x6D: 0x0

[2021-05-03 21:37:45.275] 0x6E: 0x0

[2021-05-03 21:37:45.275] 0x6F: 0xB

[2021-05-03 21:37:45.275] 0x70: 0xD0

[2021-05-03 21:37:45.275] 0x71: 0x0

[2021-05-03 21:37:45.275] 0x72: 0x13

[2021-05-03 21:37:45.275] 0x73: 0x0

[2021-05-03 21:37:45.275] 0x74: 0x0

[2021-05-03 21:37:45.275] 0x75: 0x0

[2021-05-03 21:37:45.275] 0x76: 0x0

[2021-05-03 21:37:45.275] 0x77: 0x0

[2021-05-03 21:37:45.275] 0x78: 0x0

[2021-05-03 21:37:45.275] 0x79: 0x0

[2021-05-03 21:37:45.275] 0x7A: 0x0

[2021-05-03 21:37:45.275] 0x7B: 0x0

[2021-05-03 21:37:45.275] 0x7C: 0x0

[2021-05-03 21:37:45.275] 0x7D: 0x0

[2021-05-03 21:37:45.275] 0x7E: 0x0

[2021-05-03 21:37:45.275] 0x7F: 0x0

[2021-05-03 21:37:45.275] -END LORA DumReg-

Try going back to basics, that library has sample TX and RX sketches, do they run without error ?

Bear in mind that Semtech might not offer support for a third party LoRa Library.

I have had receiver fails to but i now have a software reboot and its not a problem for me now happy to pas it on if it might help

Hi Peringek,
I have been trying for some time finding a solution for the same issue of a class C device, for some freezes checking the third bit of 0x18 register (RX on-going == 1) helps identify a hug but it not always works, I have to implement a routine to reset if expected messages are not received, that is not a good way for communication.
Have you found a reliable way to test LoRa module healthy status?