Error: MCCI_LoRaWAN_LMIC_library-3.0.99\src\lmic\oslmic.c:53

Dear TTN-fellows,

After flashing the code for LoRa-nodes for months flawlessly, I am having problems with this nasty error again (MCU: Atmega1284p, Arduino IDE and newest MCC LoRa library):

MCCI_LoRaWAN_LMIC_library-3.0.99\src\lmic\oslmic.c:53

The complete error msg looks as follows:

10:09:41.148 -> Starting...
10:09:41.183 -> Scanning...
10:09:41.183 -> I2C device found at address 0x23  !
10:09:41.183 -> I2C device found at address 0x76  !
10:09:46.218 -> FAILURE 
10:09:46.218 -> C:\Users\bobin\OneDrive\Dokumente\Arduino\libraries\MCCI_LoRaWAN_LMIC_library-3.0.99\src\lmic\oslmic.c:53

And occurs already in the setup function while calling os_init(); (verified with Serial.println after os_init):

void setup() {
  Serial.begin(115200);
  Wire.begin();
  Serial.println(F("Starting..."));
  pinMode(5, OUTPUT);
  pinMode(A3, INPUT);
  os_init();
  Serial.println("os_init successful");
  LMIC_reset();
  LMIC_setSession (0x1, DEVADDR, NWKSKEY, APPSKEY);
  LMIC_setLinkCheckMode(0);
  LMIC.dn2Dr = DR_SF9;
  LMIC_setDrTxpow(DR_SF9, 14);
  do_send(&sendjob);
}

Conttent of oslmic.c at line 53 is ASSERT(0);:

void os_init() {
    if (os_init_ex((const void *)&lmic_pins))
        return;
    ASSERT(0);
}

Thank you for your help!

Do you want answers posted here or in the Arduino forum, where the same question has been asked ?

2 Likes

I am just trying to reach out for some help :). Both forums combined address a larger audience but TTN is much more specific. Anyways, if you think it is offensive, I can remove my question on the Arduino forum. I didn’t see any problems in the first place.

Remember that both forums are populated by volunteers, so its less wasteful of their time to post in one forum and wait for replies. If you dont get a reply in one forum after a reasonable time, then try another forum.

2 Likes

And, please, DON’T open an issue in the MCCI github repo.
Ask Google, you will find many threads on the same topic.
Solution is always the same: Check your pin mappings and wiring. Your radio cannot be accessed by your CPU for some reason related to your hardware (which you have to figure out).

You used to have the error, solved it in some way, then had no problems for months and suddenly the problem is back again …

So tell us, what changed ?

1 Like

@LoRaTracker, you are right, I used a wrong pinmapping because old and new code have somhow got messed up. Next time, I see that error, I will know it is a communicatoin problem between CPU and Radio. I’ll also post it on the Arduino forum to save people’s time since I fully agree with your earlier comment.

1 Like

Just a further note to help future users who find this thread looking to solve similar issues…

My problem was also wiring related: specifically, none of the instructions I found online indicated that the SPI interface needs to be connected in addition to the PIO0/PIO1 pins. Connecting the SPI interface resolved my errors.

1 Like

Hello, I’m new to all these and need urgent help. (Trying to build a LoRa TTN node).

Could you please highlight me on what you mean by “the SPI interface needs to be connected in addition to the PIO0/PIO1 pins”?

image

Here is my connection layout, and as far as I can tell, the SPI interface (NSS, SCK, MOSI, MISO) are properly connected). Is there any additional connection needed here?

I have to under line, the Arduino sketch is uploaded properly to the Arduino Pro Mini, but the serial console says “~/Arduino/libraries/MCCI_LoRaWAN_LMIC_library/src/lmic/oslmic.c:53”.

Am I missing something? Please help

Your wiring is OK - it has the required connections. The error occurs because the software doesn’t match the wiring. You need to tell the library what connections you have made as per the detailed instructions AFTER you have upgraded to v3.3.0. You may need to turn off some of the Class B settings to reduce memory usage.

Can you explain why it is urgent?

Thanks for your reply @descartes. It’s a project for my studies, and I have to say I’m new to Arduino.

In my script, I’ve matched the wiring:

 // Pin mapping
const lmic_pinmap lmic_pins = {
   .nss = 10,
   .rxtx = LMIC_UNUSED_PIN,
   .rst = 5,
   .dio = {2, 3, LMIC_UNUSED_PIN},
};

But I still don’t know what is wrong. What do you mean by turning off some class B settings?

---------------------------------------[Update]------------------------------------
I don’t know how, but somehow I’m now getting the following message from the serial console:

image

Deadlines on new to Arduino & LoRaWAN - rock & roll!


I’ve edited the code block to format it as per guidelines - please use the </> and never ever post text as an image.

The good news is that the original problem has been solved and your device is now transmitting but is not hearing a response to its Join message. If you’re not clear what that is, read all of this: https://www.thethingsnetwork.org/docs/lorawan/. If you haven’t read all of it already, it’s the fundamentals that you should know and if you don’t, you will find the going very difficult as well as many requests for you to read it.

Do you have a gateway? If not, ouch, where is the nearest one to you? (https://www.thethingsnetwork.org/map/)

If you do have a gateway, what appears in the console when the device tries to Join?

Thanks a lot for your rapid replies. I have an indoor gateway 3m away and originally, nothing appeared on TTN console when I got the errors on the serial monitor.

But I got it all running now. The AppKey I used seemed to be the wrong one, wrong and in the wrong format (msb instead of lsb).

Thanks again, and sorry if I waisted your time with some beginner errors.

Cheers, F.

We’ve all been there - and for a change from some of the DIY device cries for help, you’ve got yourself sorted in double quick time - bodes well for your LoRaWAN journey.

2 Likes

As Nick says looking good - you might also get better experience and reduce risk of problems if you keep a good distance or an absorber such as a wall between your node and GW, 3m probably ok depending on type of antenna, orientation/alignment, intervening items etc., but give a couple meter more to be sure :wink:

1 Like

Hello Everyone,

I am getting a similar error in one of my nodes.
I work with a heltec esp32 v2 lora , which has lora in the hardware.

The node is flashed with my code, and works without problems for several days/hours, connecting and sending data packages to my application. Then after a certain time elapsed, it stops responding. I am it with deep sleep mode.
With the serial output, i could backtrack the error to this similar. As the LMIC_init, has an assert (0) this stops the code. But unfortunately, and even using the WDT to reset the device, the problem persists until i power cycle (hard-reset) the whole node. Then it starts working again immediately with the same behavior.
In my case the pin mapping is correct, as i can send data for a certain time.

Has anyone experienced anything similar?

The Heltec stack does not use LMIC and you are describing a hardware issue that manages to lock up even the WDT which normally would reset the MCU so has no bearing on this topic - I appreciate that you wanted to post but you need to either find something that relates to Heltec or read a bit more before you reach a level that allows you to start a topic.

What ever you do, you MUST post the serial output that you got as that will be the single most important piece of information you can provide.

1 Like