arduino-lmic
arduino-lmic copied to clipboard
ttn-abp.ino only transmits first message
I am using ttn-abp.ino example with a single channel gateway (https://github.com/kersing/ESP-1ch-Gateway-v5.0).
When I reset my ESP32 the first run of do_send() function has LMIC.opmode with value 0x800 (which means "find a new channel"). The message is transmitted and received by my gateway.
Then, the second time the do_send() is called LMIC.opmode has the value 0x888 (which I have no idea what it means).
The function logic leads to the "OP_TXRXPEND, not sending" message and no further messages are scheduled.
Any clue of what might be happening? I cannot interpret this behavior...
Thanks in advance.
Old thread, but likely still worth responding to.
The "ESP-1ch-gateway" does not fully implement the LoraWan specs and due to the limitations of the Radio, it probably never will. This will likely cause some unexpected wierdness in node behavior, as the gateway cannot handle all the Channels which LoraWan supports.
In my case, I am seeing this behavior from the ttn-abp example
- The initial message is successfully sent to the [let's call this 1 channel device] "bridge"
- 7 following messages are "lost" in the air
From what I can get, looking at the code, the LMIC library seems to be hopping across multiple channels on every message sent (see "nextTx"). This is either to spread the load across multiple channels and avoid congestion, or perhaps to increase the likelyhood of reaching a gateway in noisy environments.
Forcing trafic on a single channel probably isn't ideal, but for testing you might want to try resetting the channels before sending a packet?
initDefaultChannels(1);
Here are some insights to your question about the opmode, which contains flags that are activated/deactivated using some simple binary logic. For example,
0x800 = OP_NEXTCHNL
0x8888 = OP_TXDATA, OP_TXRXPEND, OP_NEXTCHNL
Finally, the frequency in which the radio is operating will affect the behavior of the lmic stack. The US plan isn't as restrictive with regards to duty rate as the European plan does, for example, and thus the lmic code implementation is different for both.