Closed Samuel-ZDM closed 3 years ago
Hello,
Looking at the code looks ok, but I have some questions:
😄
What microcontroller are you using?
Atmega328p
Where on the code the mic is resetting?
When the device receives a message, it does not finish executing the onReceive function and restarts the card. The weird part of it all is that sometimes it happens sometimes it doesn't. That's why I put that if with the variable canSleep and the return of the Lora_Busy function, because I thought I wasn't finishing something and I was having a problem.
Could you share the Serial output?
Length = 5 12:33:57.403 -> Value INTEIRO = 1 12:33:57.436 -> Value EM HEX = 16081Recebi 12:33:57.469 -> Valor em Hex60 12:33:57.469 -> 0 12:33:57.502 -> Valor em Hex81 12:33:57.502 -> 1 12:33:57.502 -> Valor em HexE2 12:33:57.536 -> 2 12:33:57.536 -> Valo⸮ LoRa init succeeded. 12:33:57.735 -> 12:34:02.482 -> Sleep 12:34:02.516 -> 0.26
If you remove the RTC the code works?!
Yes, but I tested the RTC using only LoRa, without the LoRaWAN protocol and it worked. I also tested in an ESP using LMIC and it worked too.
That's really strange, probably is something in your onReceive
implementation.
Some invalid buffer maybe. I never see the atmega328p reset yourself.
Realy curious!
It worked! Error with serial communication. I believe she was crashing the system. I removed some Serial.println and it worked.
Thank you very much.
I'm receiving 5 bytes via downlink and doing the transformation within the onReceive function:
Even before this function is finished, the device resets and starts all over again. I don't know why you're giving this. In the device loop, it looks like this:
I am doing this because I am updating an RTC timer.