craigpeacock / RN2903-Demo

This example shows how to run your own code on the RN2903 LoRaWAN Module, eliminating the requirement for a 2nd microcontroller

Home Page:https://www.beyondlogic.org/rn2903-using-the-lorawan-library-plug-in-for-mplab-code-configurator-and-customising-for-the-au915-frequency-plan/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RN2903-Demo

Source code for the Microchip RN2903 Module.

Microchip RN2903 LoRa Breakout Board

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 Sensirion SHTC3 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:

This is a demo project using the Microchip LoRaWAN Library Stack on the RN2903A Module. For more information, please visit:

Frequency Band

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.

March 2022 Update

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.

The Things Network

Below is Javascript for the Payload Formatter for use on The 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,
  	};
}

Helium Network

Example session operating on the Helium Network:

RN2903 Test Program
Beyondlogic.org
Channel 08 Enabled: 916800000Hz
Channel 09 Enabled: 917000000Hz
Channel 10 Enabled: 917200000Hz
Channel 11 Enabled: 917400000Hz
Channel 12 Enabled: 917600000Hz
Channel 13 Enabled: 917800000Hz
Channel 14 Enabled: 918000000Hz
Channel 15 Enabled: 918200000Hz
Channel 65 Enabled: 917500000Hz
Join Response Successful
Sent message
Packet Received, 0 bytes, status = 1
Sent message
Packet Received, 0 bytes, status = 1
Sent message
Packet Received, 0 bytes, status = 1
Sent message
Packet Received, 0 bytes, status = 1

Helium Console:

Helium Device Console

About

This example shows how to run your own code on the RN2903 LoRaWAN Module, eliminating the requirement for a 2nd microcontroller

https://www.beyondlogic.org/rn2903-using-the-lorawan-library-plug-in-for-mplab-code-configurator-and-customising-for-the-au915-frequency-plan/


Languages

Language:C 99.4%Language:Makefile 0.6%