Hello,
I have some experience with LORA boards including TTN's UNO, which we have a number of working well. I just received the Arduino MKR 1300 today and have been getting familiar with it. I have it working but it does some odd things and I can't find complete documentation to it, so I am throwing these questions to the forum. The questions are:
What are the endPacket return values definitions. I get values of 4, 13 and 16. I would like to know what they mean.
On connection and and transmission of the initial payloads, the payloads received by the network is empty, as in no data was received . If I transmit again the payload will eventually be received by the network. I do not have this situation with the TTN UNO board.
Any thoughts and or suggestions would be appreciated.
Mike
If the return value is positive, it is the number of bytes sent. If a negative value, it is an error.
Errors are:
-1 response timeout
-2 LORA_ERROR
-3 LORA_ERROR_PARAM
-4 LORA_ERROR_BUSY
-5 LORA_ERROR_OVERFLOW
-6 LORA_ERROR_NO_NETWORK
-7 LORA_ERROR_RX
-8 LORA_ERROR_UNKNOWN
I noticed an ambiguity. -1 indicates a timeout or the packet length is greater than the max. In the latter case, the packet is dropped.
There were a few other ambiguities. I fixed them and submitted a PR for this.
See the following PR's:
arduino-libraries:master ← sslupsky:resolve-modemsend-return-ambiguity
opened 05:36PM - 04 Nov 19 UTC
There are some ambiguities with the return value from modemSend(). First, the t… imeout and packet larger than the max length return the same value. Also, the return status overlaps with the length values returned.
In an attempt to maximize compatibility, I have mapped the status values to negative values. I have resolved the timeout/packet length errors as separate return values. Unfortunately, the packet length error value needs to change.
This PR also requires https://github.com/arduino-libraries/MKRWAN/pull/66. The referenced PR removes some blocking and adds a function to check for confirmed packets which fixes issues waiting for confirmed packets in modemSend().
I also provide some documentation for modemSend() and waitResponse() in doxygen format.
arduino-libraries:master ← sslupsky:remove-blocking-code
opened 07:16PM - 20 Oct 19 UTC
This PR removes some blocking code and optimizes for sleep
poll(): The milli… s() function does not return reliable time when sleeping because the SysTick is stopped during sleep. So, the poll() is skipped if you call this function after waking from sleep. So, I removed the code that would otherwise return without checking the status of the modem. Since the caller is in control of when this function is called, this seems appropriate. Second, the function returns an int now and the value is return value of modemSend().
sendRXData(): This function was added to allow for polling the module for received data. This function is used when the modem firmware is modified to not automatically send a response. This avoids missing a response when the mcu is sleeping.
modemSend(): Removed the blocking wait for an ACK for a confirmed packet. This wait time is arbitrary and the actual time it takes the module to respond can at times exceed this delay by a significant amount depending on the region and a number of other factors. A new function is provided, getCFS(), to poll the module for the status of a confirmed packet.
getCFS(): This function polls the module for the status of a confirmed packet.
getJoinStatus(): This function was moved to make it a public function.