arduino-lmic icon indicating copy to clipboard operation
arduino-lmic copied to clipboard

Assertion failure at radio.c line 923

Open CHMSFlix opened this issue 4 years ago • 3 comments

Hi,

I getting this error while I run the code in Arduino UNO. using ttn_abp.ino

Serial Monitor. Error: Starting 7143: EV_TXSTART Packet queued FAILURE C:\Users\issel\Documents\Arduino\libraries\arduino-lmic-master\src\lmic\radio.c:923

lmic_pins configuration is:

const lmic_pinmap lmic_pins = { .nss = 10, // chip select on feather (rf95module) CS .rxtx = LMIC_UNUSED_PIN, .rst = 9, // reset pin .dio = {2, 6, 7}, }; I checked the connection. It's perfectly connected. let me know what will be the problem.

Please help to resolve this.

Environment:-

  • Version of Arduino IDE being used: 1.8.15
  • Network provider (The Things Network, Swisscom, ChirpStack, etc.) TTN
  • Region (EU868, US915, etc.) EU868
  • Board (MCCI Catena, Adafruit Feather M0, Heltec Wi-Fi LoRa 32 v2, etc.)
  • Radio (HopeRF, SX1276, etc.) HpDTek V1.1.

CHMSFlix avatar Oct 14 '21 09:10 CHMSFlix

Sorry you're having problems. The failure points us to line 926 of radio.c. There we see:

https://github.com/mcci-catena/arduino-lmic/blob/26326e4fc30fd6ee95cf8d5f78e16f34e957d38b/src/lmic/radio.c#L922-L923

This means.

  1. The LMIC sent a SPI command to put the radio into LoRa mode.
  2. The LMIC read back the mode register, and the radio is not in LoRa mode.

This is not anything software can recover from, as it indicates unspecified behavior in the SX1276. It will be necessary to investigate the hardware connections more carefully.

I do not know your background, and you haven't posted photos of your setup. My recommendations therefore may seem either too simple or too complicated. Apologies in advance.

My guess is grounding or power supply issues. Check your grounds, make sure you have adequate decoupling, make sure you have short wires. Use an oscilliscope to look at the AC noise on Vdd and GND while operating the radio. Modify the code at line 923 so that it loops for ever doing opmodeLoRa() followed by readReg(RegOpMode) -- nothign else in a while(1) loop. Then you can use a scope to look at signal quality on the SPI clk and data lines as well as Vdd and gnd.

Good luck!

terrillmoore avatar Oct 14 '21 12:10 terrillmoore

Hi terrillmoore,

Now, I am not getting the error. But TX_COMPLETE event has not occurred. Now, my console looks like this:

Starting Configure CFG_eu868 7154: EV_TXSTART Packet queued

After this, it goes to the loop()function. I am not getting any errors on radio.c file. What will be the issue here?

CHMSFlix avatar Oct 20 '21 12:10 CHMSFlix

I wouldn't put assertion onto external sources, noise on SPI can bring down the whole system (e.g. pump controller).

All it should do is to start a comms reinit.

Field experience: once in a while a MEMS device got into an undocumented state, which should have never happened, but after a reinit it works for a long time again.

mrx23dot avatar Feb 16 '22 20:02 mrx23dot