RS-485: how to check a bus step by step
337 Views •Modbus RTU timeout: 6 checks before blaming the wiring
313 Views •Modbus register 40001 or address 0? 6 checks
143 Views •Modbus RTU master and slave with two ESP32 PLC, step by step
158 Views •4G PLC not connecting: 6 checks before blaming the code
220 Views •LoRa works on the desk, fails in the field: 6 checks before you install
246 Views •LoRaWAN node won't join: 6 checks, in order
192 Views •Choosing a PLC 2: which communications do you really need
192 Views •PLC on Ethernet with no ping? 6 checks
122 Views •Digital input not reading: NPN or PNP, step by step
379 Views •4-20 mA input reading wrong: check it step by step
368 Views •Scaling a 4-20 mA signal in the PLC: formula, constants and code
355 Views •RS-485: how to check a bus step by step
337 Views •Modbus RTU timeout: 6 checks before blaming the wiring
313 Views •Relay or transistor output: which one and how to check it
306 Views •Upload fails: 6 checks before blaming the code
251 Views •LoRa works on the desk, fails in the field: 6 checks before you install
246 Views •SD card corrupted? 6 habits for Linux in the field
234 Views •Touch panel: screen turned, touch didn't. 6 checks
222 Views •4G PLC not connecting: 6 checks before blaming the code
220 Views •Choosing a PLC 1: count the I/O and leave spare
199 Views •Arduino IDE compile error: 6 checks before the code
198 Views •LoRaWAN node won't join: 6 checks, in order
192 Views •Choosing a PLC 2: which communications do you really need
192 Views •Modbus RTU master and slave with two ESP32 PLC, step by step
158 Views •Node-RED not starting after a reboot? 6 checks
154 Views •Modbus register 40001 or address 0? 6 checks
143 Views •PLC on Ethernet with no ping? 6 checks
122 Views •LoRaWAN node won't join: 6 checks, in order
Short answer: when a LoRaWAN node keeps sending join requests and never gets a join accept, check the activation mode, the keys and their byte order, the frequency plan, the gateway, the counters and the timing, in this order.
Download the checklist (PDF, 2 pages)
Descarga la lista de comprobación (PDF, 2 páginas)
These checks apply to any LoRaWAN node or PLC, on any network server (The Things Stack, ChirpStack or others). If the radio link itself is weak, start with the LoRa lesson on range in the field.
Six checks, in this order
| Check | What to do | Good result |
|---|---|---|
| 1. Activation | Use OTAA when you can: node and server agree new session keys at every join. With ABP the session keys are fixed in the device and nothing is negotiated. | The device is registered in the server with the same activation mode as the node. |
| 2. Keys | DevEUI, JoinEUI (AppEUI in older versions) and AppKey must be identical in the node and in the server, in the byte order your library expects (MSB or LSB). | The server receives the join request with no MIC error. |
| 3. Region | Node, gateway and server on the same frequency plan, for example EU868 in Europe or US915 in North America. In US915 a gateway often listens to one sub-band of 8 channels: the node has to use the same one. | Same plan and same sub-band at every point. |
| 4. Gateway | Check that the gateway is connected to the server and that its events show traffic from your node. If the server never sees the join request, the cause is before it: radio, coverage or gateway. | The join request appears in the gateway and server events. |
| 5. Counters | In LoRaWAN 1.0.4 and 1.1 the DevNonce is a counter that has to keep increasing, also after a power cycle: store it in non-volatile memory. In ABP, do not reset the frame counters: the server can drop the uplinks. | No "DevNonce has already been used" or "DevNonce is too small" errors. |
| 6. Timing | Space join retries with a growing, random delay and respect the duty cycle of your region (often 1 % in Europe). If the gateway is far, start with a higher spreading factor; ADR adjusts it after the join. | Join accepted, then uplinks with ADR. |
What the server log tells you
- MIC mismatch: different AppKey, or keys in the wrong byte order.
- "DevNonce has already been used" or "too small": the DevNonce is not kept after a reset.
- No join request in the log: radio, coverage or a gateway that does not forward the uplinks.
- Join accept sent, node still joining: the accept arrives late (slow gateway backhaul) or the node does not hear it (coverage).
- ABP uplinks dropped: frame counters reset in the device.
MSB or LSB
The same DevEUI can be written in two orders: 70B3D57ED005A1F2 (MSB) or F2A105D07ED5B370 (LSB). Some libraries expect the EUIs in LSB and the AppKey in MSB; others take everything in MSB. Check the example of your library and copy the keys from the server console in the format it asks for.
Example: the same keys in two byte orders
In the Arduino LMIC library (MCCI), DevEUI and JoinEUI go least significant byte first and the AppKey goes as the console shows it, as the comments of its OTAA example say. Other libraries can expect another order: check their documentation. The values below are examples, not real keys.
// Arduino LMIC (MCCI): the console shows DevEUI 70B3D57ED0012345 (MSB).
// LMIC wants DevEUI and JoinEUI (AppEUI) LSB first: the same bytes, reversed.
static const u1_t PROGMEM DEVEUI[8] = { 0x45, 0x23, 0x01, 0xD0, 0x7E, 0xD5, 0xB3, 0x70 };
void os_getDevEui(u1_t* buf) { memcpy_P(buf, DEVEUI, 8); }
// JoinEUI 0000000000000001 (MSB) becomes:
static const u1_t PROGMEM APPEUI[8] = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
void os_getArtEui(u1_t* buf) { memcpy_P(buf, APPEUI, 8); }
// AppKey is copied as the console shows it (MSB), not reversed.
static const u1_t PROGMEM APPKEY[16] = {
0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6,
0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C };
void os_getDevKey(u1_t* buf) { memcpy_P(buf, APPKEY, 16); }Next steps
- LoRa works on the desk, fails in the field: 6 checks before you install
- Free course: First steps with LoRa and LoRaWAN
- What is LoRaWAN
Sources
LoRa Alliance: TS001-1.0.4 LoRaWAN L2 1.0.4, RP002 Regional Parameters and LoRaWAN 1.0.x Join Synch Issues Remedies. The Things Stack documentation: troubleshooting devices, ABP vs OTAA and best practices.
Commenting is not enabled on this course.