|
| 1 | +# Additional Functionality |
| 2 | + |
| 3 | +## Sending Data to the IOT Node - LoRaWAN board |
| 4 | + |
| 5 | +To demonstrate the ability to send commands to the IoT Node - LoRaWAN board, the firmware implements some simple commands to change the on-board RGB LED of the device. While simple, the commands demonstrate the flexibility of this functionality. |
| 6 | + |
| 7 | +### General Command Structure |
| 8 | + |
| 9 | +The LED command structure consist of a set of Hex (number) codes sent to the target SparkFun IoT Node - LoRaWAN board via port 2 of the LoRaWAN connection. |
| 10 | + |
| 11 | +And example of this in the Digi XON control panel for a IoT Node - LoRaWAN device is shown in the following image: |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | +This sends the command code **0x01FF0000**, which turns on the on-board LED and sets the color red. Note - the port value is set to 2. |
| 16 | + |
| 17 | +Command codes have the following general structure: |
| 18 | + |
| 19 | +**[Command Code - 1 byte][RGB Color - 3 bytes]** |
| 20 | + |
| 21 | +The available command codes: |
| 22 | + |
| 23 | +|Code| Payload | Description | |
| 24 | +|--|--|--| |
| 25 | +|01|RGB value | Turn on the LED, set to the provided RGB value| |
| 26 | +|02| <none> | Turn off the LED| |
| 27 | +|03|RGB Value | Blink the LED using the provided RGB value| |
| 28 | +|04|RGB Value | Fast blink the LED using the provided RGB value| |
| 29 | +|05| Brightness | Set the brightness of the LED - a 1 byte value: 0 - 255| |
| 30 | + |
| 31 | +## Button Events |
| 32 | + |
| 33 | +The SparkFun IoT Node - LoRaWAN board has a "user button". When pressed, the button will perform the following actions: |
| 34 | + |
| 35 | +|Type| Description| |
| 36 | +|--|--| |
| 37 | +|Momentary Press|When the button is momentary pressed, a log-event is triggered.| |
| 38 | +|Pressed and Held| When the on-board is pressed and held down for 30 seconds, the IoT Node - LoRaWAN board is reset: settings are erased and the board restarted.| |
0 commit comments