What code are you using. Error Message: CMSIS-RTOS error: ISR Queue overflow is an error coming from the FreeRTOS part of mBed. We are not using FreeRTOS functions in our code examples.
Please why When I configure LORAWAN_ADR_OFF the module does not receive message downlink?, the module RAK11300 receives downlink messages when LORAWAN_ADR_ON.
I have another query: my module needs receive downlink message 77 01 00 to activate a relay, and 77 02 00 to deactivate the relay. Do you have some example to do that? to add that code in lorawan_rx_handler function.
Downlinks have nothing to do with ADR. More with the device class.
In Class A LoRaWAN nodes can only receive downlinks after they sent an uplink.
In Class C LoRaWAN nodes are in receive mode always.
But some LoRaWAN servers (like Chirpstack), allow an downlink only after the node has sent at least one uplink.
For the downlink decoding, I have an example that could be adapted to your application.
This code part checks the received packet and then parses the received data:
void lorawan_rx_handler(lmh_app_data_t *app_data)
{
Serial.printf("LoRa Packet received on port %d, size:%d, rssi:%d, snr:%d, data:%s\n",
app_data->port, app_data->buffsize, app_data->rssi, app_data->snr, app_data->buffer);
for (int idx = 0; idx < app_data->buffsize; idx++)
{
Serial.printf("%02X", app_data->buffer[idx]);
}
Serial.println("");
// Check if uplink was a send frequency change command
if ((app_data->port == 3) && (app_data->buffsize == 6))
{
if (app_data->buffer[0] == 0xAA)
{
if (app_data->buffer[1] == 0x55)
{
uint32_t new_send_frequency = 0;
new_send_frequency |= (uint32_t)(app_data->buffer[2]) << 24;
new_send_frequency |= (uint32_t)(app_data->buffer[3]) << 16;
new_send_frequency |= (uint32_t)(app_data->buffer[4]) << 8;
new_send_frequency |= (uint32_t)(app_data->buffer[5]);
Serial.printf("Received new send frequency %ld s\n", new_send_frequency);
// Save the new send frequency
LORAWAN_APP_INTERVAL = new_send_frequency * 1000;
// Set the timer to the new send frequency
xTimerStop(appTimer, 0);
if (LORAWAN_APP_INTERVAL != 0)
{
xTimerChangePeriod(appTimer, LORAWAN_APP_INTERVAL / portTICK_PERIOD_MS, 0);
}
}
}
}
}
Sorry, I copied the code snippet from the wrong example. xTimer… functions are FreeRTOS functions and I use them on the RAK4631 and RAK11200, they are not available on the RAK11300/RAK11310. On the RAK11300 the mbed::Ticker class is used.
On The RAK11300 (when using the LoRaWAN_OTAA_ABP.ino example) it would be something like:
void lorawan_rx_handler(lmh_app_data_t *app_data)
{
Serial.printf("LoRa Packet received on port %d, size:%d, rssi:%d, snr:%d, data:%s\n",
app_data->port, app_data->buffsize, app_data->rssi, app_data->snr, app_data->buffer);
for (int idx = 0; idx < app_data->buffsize; idx++)
{
Serial.printf("%02X", app_data->buffer[idx]);
}
Serial.println("");
// Check if uplink was a send frequency change command
if ((app_data->port == 3) && (app_data->buffsize == 6))
{
if (app_data->buffer[0] == 0xAA)
{
if (app_data->buffer[1] == 0x55)
{
uint32_t new_send_frequency = 0;
new_send_frequency |= (uint32_t)(app_data->buffer[2]) << 24;
new_send_frequency |= (uint32_t)(app_data->buffer[3]) << 16;
new_send_frequency |= (uint32_t)(app_data->buffer[4]) << 8;
new_send_frequency |= (uint32_t)(app_data->buffer[5]);
Serial.printf("Received new send frequency %ld s\n", new_send_frequency);
// Save the new send frequency
LORAWAN_APP_INTERVAL = new_send_frequency * 1000;
// Set the timer to the new send frequency
appTimer.detach();
if (LORAWAN_APP_INTERVAL != 0)
{
appTimer(tx_lora_periodic_handler, (std::chrono::microseconds)(LORAWAN_APP_INTERVAL * 1000));
}
}
}
}
}
Hi BeeGee. thank you very much, don´t worry I can resolve the problem and now I can say the firmware is operating perfectly, I am sending a event when the cover is removed from the energy meter (alarm), sending Frame ONLINE status every 20 seconds, read the meter with demand, in the same way to send the command to cut electrical service and restore the electrical service.
I am sending to manufactures some PCB to place in production, all information is arriving to TTI, we are developing the application to integrate the data from TTI.