39
LoRa® Communication
Arduino library for using the Microchip RN2483 LoRaWAN
module: OrangeRn2483
You can find a complete document on this library and its
functions in the library’s file
#include <OrangeRn2483.h>
// The following keys are for structure purpose only. You must define YOUR OWN.
const int8_t appEUI[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
const int8_t appKey[16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
bool joinNetwork()
{
OrangeRN2483.setDataRate(DATA_RATE_1); // Set DataRate to SF11/125Khz
return OrangeRN2483.joinNetwork(appEUI, appKey);
}
bool SendLoRaMessage()
{
const uint8_t size = 5;
int8_t port = 5;
int8_t data[size] = { 0x48, 0x65, 0x6C, 0x6C, 0x6F }; // Hello
return OrangeRN2483.sendMessage(data, size, port); // send unconfirmed message
}