- Notifications
You must be signed in to change notification settings - Fork0
This example shows how to run your own code on the RN2903 LoRaWAN Module, eliminating the requirement for a 2nd microcontroller
craigpeacock/RN2903-Demo
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Source code for theMicrochip RN2903 Module.
This example shows how to run your own code on the RN2903 LoRaWAN Module, eliminating the requirement for a 2nd microcontroller. This code interrogates a SensirionSHTC3 Temperature and Humidity Sensor every 10 minutes and sends the data to a LoRaWAN Network - tested with The Things Network & Helium.
The RN2903 Module includes a:
- Microchip PIC18LF46K22 MCU
- Semtech SX1276 Radio Transceiver
- Microchip 24AA02E64T 2Kb I2C Serial EEPROM with Pre-Programmed EUI-64™ MAC ID
This is a demo project using the Microchip LoRaWAN Library Stack on the RN2903A Module. For more information, please visit:
This code is set-up for the AU915 Frequency Plan.
Channels 8 to 15 (Sub Band 2) are enabled for use with The Things Network or Helium.
While Microchip has never updated the LoRaWAN Library in MPLAB Code Configurator (MCC), recently they released the source code for the 'UART Modules' and this uses the same stack. We have copied/updated to the mature stack that is running on the RN2903 SA AU915 v1.0.3 modules.
Please note the project requires the XC8 V1.45 Cross Compiler. Using V2.x of the compiler appears to result in timing issues, i.e. the Receive Window 1 and 2 can be either increased four fold, or fails to operate at all.
Below is Javascript for the Payload Formatter for use onThe Things Network
function decodeUplink(input) {var data = {};var temp_raw = (input.bytes[1] << 8) + input.bytes[0];var humd_raw = (input.bytes[3] << 8) + input.bytes[2];data.temp = -45 + 175 * (temp_raw / 65536);data.RH = 100 * (humd_raw / 65536); return { data: data, };}
Example session operating on the Helium Network:
RN2903 Test ProgramBeyondlogic.orgChannel 08 Enabled: 916800000HzChannel 09 Enabled: 917000000HzChannel 10 Enabled: 917200000HzChannel 11 Enabled: 917400000HzChannel 12 Enabled: 917600000HzChannel 13 Enabled: 917800000HzChannel 14 Enabled: 918000000HzChannel 15 Enabled: 918200000HzChannel 65 Enabled: 917500000HzJoin Response SuccessfulSent messagePacket Received, 0 bytes, status = 1Sent messagePacket Received, 0 bytes, status = 1Sent messagePacket Received, 0 bytes, status = 1Sent messagePacket Received, 0 bytes, status = 1
Helium Console: