Our #NuttX App resends the same Nonce to the #LoRaWAN Gateway ... Which (silently) rejects the Join Request due to Duplicate Nonce ... Let's fix our Random Number Generator
https://gist.github.com/lupyuen/b38434c3d27500444382bb4a066691e5
#LoRaWAN gets the Nonce from the Secure Element's Random Number Generator ... Let's simulate the Secure Element on Apache #NuttX OS
https://github.com/lupyuen/LoRaMac-node-nuttx/blob/master/src/mac/LoRaMacCrypto.c#L980-L996
Here's how we generate #LoRaWAN Nonces on #NuttX OS ... With Strong Random Numbers thanks to Entropy Pool
https://github.com/lupyuen/LoRaMac-node-nuttx/blob/master/src/nuttx.c#L136-L153
Our #NuttX App now sends Random #LoRaWAN Nonces to the LoRaWAN Gateway ... And are happily accepted by the gateway! 🎉
Log: https://gist.github.com/lupyuen/8f012856b9eb6b9a762160afd83df7f8
Our #NuttX App was too busy to receive the #LoRaWAN Join Response ... Let's disable the logging
Log: https://gist.github.com/lupyuen/8f012856b9eb6b9a762160afd83df7f8
After disabling logging, our #NuttX App successfully joins the #LoRaWAN Network! 🎉 Now we transmit some Data Packets over LoRaWAN
Log: https://gist.github.com/lupyuen/0d301216bbf937147778bb57ab0ccf89
Our #LoRaWAN Gateway receives Data Packets from #NuttX OS! 🎉 The Message Payload is empty ... Let's figure out why 🤔
Log: https://gist.github.com/lupyuen/0d301216bbf937147778bb57ab0ccf89
Our #NuttX App sent an empty #LoRaWAN Message because our message is too long for LoRaWAN Data Rate 2 (max 11 bytes) ... Let's increase the Data Rate to 3
https://gist.github.com/lupyuen/5fc07695a6c4bb48b5e4d10eb05ca9bf
Here's how we increase the #LoRaWAN Data Rate to 3 in our #NuttX App
https://github.com/lupyuen/lorawan_test/blob/main/lorawan_test_main.c#L57-L70
#LoRaWAN Data Rate has been increased to 3 ... Max Message Size is now 53 bytes for our #NuttX App
https://gist.github.com/lupyuen/83be5da091273bb39bad6e77cc91b68d
#LoRaWAN Gateway now receives the correct Data Packet from our #NuttX App! 🎉
https://gist.github.com/lupyuen/83be5da091273bb39bad6e77cc91b68d
Here's how we send a #LoRaWAN Data Packet on #NuttX OS ... And validate the Packet Size before sending
https://github.com/lupyuen/lorawan_test/blob/main/lorawan_test_main.c#L311-L339
NimBLE Porting Layer doesn't work for multiple Callout Timers on #NuttX OS, unless we loop the thread ... Will submit a Pull Request to Apache NimBLE 👍
Switching a #NuttX GPIO Interrupt Pin to Trigger On Rising Edge ... Crashes with an Assertion Failure ... I'll submit a NuttX Issue, meanwhile I have disabled the assertion
https://github.com/lupyuen/incubator-nuttx/blob/lorawan/drivers/ioexpander/gpio.c#L544-L547
Here's why we need GPIO Interrupts Triggered on Rising Edge for #LoRa on #NuttX
https://lupyuen.github.io/articles/sx1262?88#initialise-gpio
We handle SX1262 GPIO Interrupts in #NuttX with a Background Thread ... That inserts into an Event Queue
https://lupyuen.github.io/articles/sx1262?89#start-dio1-thread
How we handle SX1262 GPIO Interrupts in #NuttX OS ... With NimBLE Porting Layer
https://lupyuen.github.io/articles/sx1262?90#multithreading-with-nimble-porting-layer
#LoRaWAN on #Apache NuttX OS ... Here's what we'll do
https://lupyuen.github.io/articles/lorawan3?4#lorawan-objective
Here's what we'll do with #LoRaWAN on Apache #NuttX OS
https://lupyuen.github.io/articles/lorawan3?5#lorawan-objective
Source Code for #LoRaWAN on Apache #NuttX OS
https://lupyuen.github.io/articles/lorawan3?6#download-source-code
Setting the #LoRaWAN Device EUI and App Key in #NuttX OS
https://lupyuen.github.io/articles/lorawan3?7#device-eui-join-eui-and-app-key
Building a Secure #IoT Device? #LoRaWAN works with a Hardware Secure Element
https://lupyuen.github.io/articles/lorawan3?8#secure-element
Setting the #LoRaWAN Frequency for #NuttX OS
https://lupyuen.github.io/articles/lorawan3?9#lorawan-frequency
On #NuttX OS, NimBLE Porting Library needs POSIX Timers and Message Queues
https://lupyuen.github.io/articles/lorawan3?11#appendix-posix-timers-and-message-queues
Our #LoRaWAN Library needs a Strong Random Number Generator with Entropy Pool on #NuttX OS
https://lupyuen.github.io/articles/lorawan3?12#appendix-random-number-generator-with-entropy-pool
Building the #LoRaWAN Firmware for Apache #NuttX OS
https://lupyuen.github.io/articles/lorawan3?15#build-the-firmware
Running the #LoRaWAN Firmware for Apache #NuttX OS ... To join a LoRaWAN Network
https://lupyuen.github.io/articles/lorawan3?16#run-the-firmware
Here's how we join a #LoRaWAN Network in our #NuttX App
https://lupyuen.github.io/articles/lorawan3?17#join-lorawan-network
#NuttX joins #LoRaWAN Network ... Watch what happens at the LoRaWAN Gateway
https://lupyuen.github.io/articles/lorawan3?18#check-lorawan-gateway
Here's how we transmit a #LoRaWAN Data Packet in our #NuttX App
https://lupyuen.github.io/articles/lorawan3?19#send-data-to-lorawan
#LoRaWAN Max Message Size depends on 1️⃣ Data Rate 2️⃣ LoRaWAN Region
Running our #LoRaWAN Firmware on Apache #NuttX OS ... And transmitting LoRaWAN Messages
https://lupyuen.github.io/articles/lorawan3?22#rerun-the-firmware
Here's why #LoRaWAN on #NuttX needs a Strong Random Number Generator (with Entropy Pool)
https://lupyuen.github.io/articles/lorawan3?24#lorawan-nonce
How we generate #LoRaWAN Nonces ... With the Strong Random Number Generator on #NuttX OS
https://lupyuen.github.io/articles/lorawan3?25#strong-random-number-generator
How we handle #LoRaWAN Events ... With NimBLE Porting Layer on Apache #NuttX OS
https://lupyuen.github.io/articles/lorawan3?26#lorawan-event-loop
Inside our #LoRaWAN Event Loop for Apache #NuttX OS
https://lupyuen.github.io/articles/lorawan3?27#lorawan-event-loop
Troubleshooting #LoRaWAN on Apache #NuttX OS
https://lupyuen.github.io/articles/lorawan3?28#troubleshoot-lorawan
#LoRaWAN is Time Sensitive! Here's why
https://lupyuen.github.io/articles/lorawan3?29#lorawan-is-time-sensitive
Watch out for Empty #LoRaWAN Message Payloads
https://lupyuen.github.io/articles/lorawan3?30#empty-lorawan-message
@lupyuen
I just use /dev/random for all my RNG needs.
Inspecting the ChirpStack Log ... For #LoRaWAN Messages transmitted by Apache #NuttX OS
https://lupyuen.github.io/articles/lorawan3?23#check-lorawan-gateway-1