Open ld21 opened 4 years ago
Same issue here.
Digging into the code, seems it is a null pointer structure assignment in LoRaMacConfirmQueueAdd()
because the BufferEnd
variable is not initialized. Looking at your code, i'm trying to set the same region LORAMAC_REGION_EU868
which leads me to the LoRaMacInitialization()
returning error code LORAMAC_STATUS_REGION_NOT_SUPPORTED
(which is not checked). Thus not initializing the aforementioned structure.
README say you should select the region in the Arduino IDE drop down menu. Unfortunately this menu doesn't show up for me. Since I'm not able to select it in the UI, I try to guess what define I should include but to no avail.
Still trying to figure out how to declare my region ...
hello, I have the exact same problem, could you find a solution?
thanks
Same issue here.
Digging into the code, seems it is a null pointer structure assignment in
LoRaMacConfirmQueueAdd()
because theBufferEnd
variable is not initialized. Looking at your code, i'm trying to set the same regionLORAMAC_REGION_EU868
which leads me to theLoRaMacInitialization()
returning error codeLORAMAC_STATUS_REGION_NOT_SUPPORTED
(which is not checked). Thus not initializing the aforementioned structure.README say you should select the region in the Arduino IDE drop down menu. Unfortunately this menu doesn't show up for me. Since I'm not able to select it in the UI, I try to guess what define I should include but to no avail.
Still trying to figure out how to declare my region ...
Hello, If you are using PlatformIO, use the flags inside the .ini file:
build_flags = -D REGION_EU868 -D ACTIVE_REGION=LORAMAC_REGION_EU868 -D LoRaWAN_DEBUG_LEVEL=0
Facing same issue...Help needed.
ESP-ROM:esp32s3-20210327 15:19:20.560 -> Build:Mar 27 2021 15:19:20.560 -> rst:0x5 (DSLEEP),boot:0x28 (SPI_FAST_FLASH_BOOT) 15:19:20.560 -> pro cpu reset by JTAG 15:19:20.560 -> SPIWP:0xee 15:19:20.560 -> mode:DIO, clock div:1 15:19:20.560 -> load:0x3fce3808,len:0x43c 15:19:20.560 -> load:0x403c9700,len:0xbec 15:19:20.560 -> load:0x403cc700,len:0x2a3c 15:19:20.560 -> SHA-256 comparison failed: 15:19:20.560 -> Calculated: dcde8d8a4817d9bf5d5d69a7247667264e4e10ac7493514868b61f5aa6146539 15:19:20.560 -> Expected: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 15:19:20.560 -> Attempting to boot anyway... 15:19:20.560 -> entry 0x403c98d8
@tusharvb19 did you ever solve your issue?
@tusharvb19 @fbenti It's crazy how Heltech is working, after their library was working fine they modified it to fix a bug related to validating the license of the Library, however, it seems that this modification damaged the main behavior of the LoRaWAN communication.
I took me a while after I saw that the crash happens during the downlink reception, hence I made a trick that works(for me). In the ESP32_LoRaWAN.cpp, I defined a bool variable that becomes true at the end of McpsIndication, as an indication that both UpLink and Downlink finished. In the main LoRaWAN cycle(inside the main.cpp) modify the DEVICE_STATE_SLEEP so it only goes to sleep after the boolean variable is set to true.
I believe there should be a group complaining about what Heltech did, they damaged the library that works with the V1 and V2 of their hardware(then made it obsolete) leaving their customers only for the other open-source solutions(LMIC..etc).
@AllTracking Thanks for the answer, could you please show the code you added/modified? I'm a bit lost since I'm completely new to LoRa
Sure, In the ESP32_LoRaWAN.h define an Extern variable:
extern bool LoRaWAN_Session; // To avoid the Crash after Receve a packet from the server
In the ESP32_LoRaWAN.cpp modify the variable like:
`/*!
containing indication attributes. / int ackrssi; static void McpsIndication( McpsIndication_t mcpsIndication ) { if( mcpsIndication->Status != LORAMAC_EVENT_INFO_STATUS_OK ) { return; }
ackrssi = mcpsIndication->Rssi;
lora_printf( "receive data: rssi = %d, snr = %d, datarate = %d\r\n",
mcpsIndication->Rssi,
(int)mcpsIndication->Snr,
(int)mcpsIndication->RxDatarate);
switch( mcpsIndication->McpsIndication ) { case MCPS_UNCONFIRMED: { break; } case MCPS_CONFIRMED: { break; } case MCPS_PROPRIETARY: { break; } case MCPS_MULTICAST: { break; } default: break; }
// Check Multicast // Check Port // Check Datarate // Check FramePending if( mcpsIndication->FramePending == true ) { // The server signals that it has pending data to be sent. // We schedule an uplink as soon as possible to flush the server. OnTxNextPacketTimerEvent( ); } // Check Buffer // Check BufferSize // Check Rssi // Check Snr // Check RxSlot if( mcpsIndication->RxData == false ) { LoRaWAN_RxData = false; } else { downLinkDataHandle(mcpsIndication); }
lora_printf( "McpsIndication: LoRaWAN_Session = true");
/
To avoid the Crash after receiving a packet from the server
Setting LoRaWAN_Session to true means that Uplink as well as Downlink are done.
/
LoRaWAN_Session = true;
}`
In your LoRaWAN_Cycle define the DEVICE_STATE_SLEEP:
`case DEVICE_STATE_SLEEP: { if(LoRaWAN_Session) { Radio.IrqProcess( ); MySleepRutin(); } else { LoRaWAN.sleep(loraWanClass, LoRaWAN_DEBUG_LEVEL); }
break;
}`
As I don't use the Heltech LoRaWAN.sleep function(the reason for the crash), I define another one like:
`void MySleepRutin(void) { esp_sleep_enable_timer_wakeup( use the tx period here in milliseconds ); // set the timer to wake
esp_deep_sleep_start(); }`
I hope I didn't miss other codes as I was using this a long time ago, hope it works for you.
Hi, I just received two Heltect ESP32 LORA devices: One V2 and one Wireless Stick. I registered them successfully both at your website and registered the device at TTN. Unfortunately, as soon as I upload the following code (using Arduino IDE), the devices keep on rebooting, saying
This is the code I'm using:
The exception decoder says the following:![exceptions](https://user-images.githubusercontent.com/4065975/76410245-e7e15980-638f-11ea-9fe8-17901817155e.png)
The panic comes when working on
What am I doing wrong? Thanks for your help, Dani