Hello everyone,
I am experiencing an issue with a setup where I use a Multitech mDot LoRa node that sends periodic messages. These messages are received by a RAK5146 concentrator attached to a Raspberry Pi 4. The data is forwarded to my MQTT server, where I can monitor it with custom software. I also send downlink messages back to the node via the MQTT topic gateway/{gateway-id}/command/down
.
The issue I’m facing is that after receiving and sending a few messages (sometimes 3, 5, or 10, it varies), both uplink and downlink communication stops. I no longer receive uplink messages on MQTT, nor do the downlink messages get transmitted to the mDot. On the mDot side, it seems like the node continues transmitting, but no messages are received until I power cycle the mDot (completely turn off and on the device).
Here are the steps and setup I have:
- Multitech mDot is configured to send periodic messages.
- RAK5146 concentrator on a Raspberry Pi 4 is receiving the messages and forwarding them to MQTT.
- I can see the uplink messages in my custom software, and I send downlink messages via the
gateway/{gateway-id}/command/down
topic. - Communication works for a few cycles, but then completely stops, requiring me to restart the mDot to re-establish communication.
I’ve also attached a simplified version of the code I’m using for the LoRa communication below:
`
int main()
{
radio = new SX1272_LoRaRadio(
LORA_MOSI,
LORA_MISO,
LORA_SCK,
LORA_NSS,
LORA_RESET,
LORA_DIO0,
LORA_DIO1,
LORA_DIO2,
LORA_DIO3,
LORA_DIO4,
LORA_DIO5,
NC,
NC,
LORA_TXCTL,
LORA_RXCTL,
NC,
NC,
NC
);
radio_events *revents = new radio_events;
revents->rx_done = &on_rx_done;
revents->rx_error = &on_rx_error;
revents->rx_timeout = &on_rx_timeout;
revents->tx_done = &on_tx_done;
revents->tx_timeout = &on_tx_timeout;
radio->lock();
radio->init_radio(revents);
radio->set_public_network(false);
radio->unlock();
while(true)
{
auto time_now = chrono::system_clock::now();
if (ts_time + 5s < time_now)
{
radio->lock();
radio->set_channel(8671E5);
radio->set_tx_config(
MODEM_LORA, 20, 0, 0,
7, 1,
MBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH,
false, true, false,
0, false, 3000
);
radio->unlock();
uint32_t uid = UID_BASE;
uint8_t buffer[sizeof(uid)];
memcpy(buffer, &uid, sizeof(uid));
radio->send((uint8_t*)buffer, sizeof(buffer));
auto time = radio->time_on_air(MODEM_LORA, sizeof(buffer));
ThisThread::sleep_for(chrono::milliseconds(time + 20));
radio->lock();
radio->set_rx_config(
MODEM_LORA, 0, 7,
1, 0, MBED_CONF_LORA_UPLINK_PREAMBLE_LENGTH,
0, false, 255,
true, false, 0,
false, true
);
radio->unlock();
ThisThread::sleep_for(20ms);
ts_time = chrono::system_clock::now();
}
radio->receive();
}
delete radio;
delete revents;
}
`
Has anyone experienced a similar issue or have any suggestions on how I might resolve this problem?
Thanks in advance for any help!