- Based on LMIC librairy.
- Modified to get C++ style.
- Only class A and C device (no class B)
- Add some sleep of arduino board and ESP.
- Add SX1262 chip
This library try to comply with lorawan 1.0.3 but do not implement all feature. For example FSK datarate is not implemented.
For a more complete Lorawan library based on lmic, please have a look to https://github.com/mcci-catena/arduino-lmic
For the SX1262 it only support board with TCXO.
Tested with Arduino Pro Mini and RFM95 on EU868 frequencies. Examples:
- simple Minimal example, send one analog value.
- balise Example, send one analog value with deepsleep using watchdog.
- tempsensor Example, send temps reads from onewire with deepsleep using watchdog.
Tested with HelTec
- esp32 Minimal example, send one value.
- esp32-deepsleep Example, send one analog value with deepsleep using RTC and state save in RTC RAM.
- simple_rak811 Minimal example for RAK811
Work with platformio with Arduino framework.
Copy balise exemple in a new directory.
Open with platformio (VSCODE with Platformio extension)
In src
directory create a file named lorakeys.h
wich contain the keys declared in network (for exemple https://www.thethingsnetwork.org)
Exemple of file:
// Application in string format.
// For TTN issued EUIs the first bytes should be 70B3D5
constexpr char const appEui[] = "70B3D5XXXXXXXXXX";
// Device EUI in string format.
constexpr char const devEui[] = "XXXXXXXXXXXXXXXX";
// Application key in string format.
constexpr char const appKey[] = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
Use define in platformio.ini build_flags
to change activated part.
- ENABLE_SAVE_RESTORE enable save and restore functions
- LMIC_DEBUG_LEVEL set to 0,1 or 2 for different log levels (default value 1)
In main.cpp
replace the content of do_send()
with the data you want to send.
To launch unit test under windows you need to install msys2 in the following path C:\msys64
.
add_msys_path.py
script will add msys64 path to your environment and copy_msys_dll.py
will copy dll to the build directory.
Most source files in this repository are made available under the Eclipse Public License v1.0. Some of the AES code is available under MIT like license. Refer to each individual source file for more details.