The examples require RUI3 V4.1.1.
Older RUI3 versions do not support the LinkCheck functionality!
In addition the format of API calls for LoRa P2P have changed in RUI3 V4.1.1!
The examples for RUI3 V4.1.0 and older versions are in the branch V4.1.0-older.
Installation guides for Arduino IDE and Visual Studio Code can be found in the RAK Documentation Center.
This repo provides additional examples for RUI3. It focuses on low power consumption and practical examples for range tests, location tracking and sensing applications using the WisBlock Modular System.
A collection of tips and tricks about the usage or RUI3 is as well available in the Tips-n-Tricks file.
Due to the limited Flash and RAM size of the RAK3172, some of the examples require code size reduction before they fit into the available memory!
Actions to reduce code size can be
- Limit the supported LoRaWAN regions in the
Arduino Board Manager Menu
- Disable the debug output of the examples code. This is done by setting
#define MY_DEBUG 0
in the fileapp.h
of the examples
All examples are prepared to work in either LoRaWAN or LoRa P2P mode.
All examples are using AT commands for setup of the device instead of hard-coding the parameters with API calls!.
Some of the examples are using RUI3 libraries for the WisBlock modules. These libraries are simplified (to save code space on the RAK3172) and can be downloaded as ZIP files from
- RAKwireless_RAK1901_Temperature_and_Humidity_SHTC3.zip
- RAKwireless_RAK1902_Pressure_LPS22HB.zip
- RAKwireless_RAK1903_Optical_OPT3001.zip
- RAKwireless_RAK1904_Accelerate_LIS3DH.zip
- RAKwireless_RAK1906_Environment_BME680.zip
- RAKwireless_RAK1910_GPS_UBLOX7.zip
- RAKwireless_RAK5860_LTE_NBIoT_Module.zip
The libraries can be installed with the "Install from ZIP" function in the ArduinoIDE Library Manager.
The libraries can be installed as well manually by unzipping the content into the default Arduino Library folder.
The following modules are supported by RUI3:
WisDuo modules and EVB's | WisBlock Core Modules |
---|---|
RAK3172 stamp module | RAK4631-R |
RAK3272S breakout board | RAK3372 |
RAK3172 evaluation board | RAK11722 |
RAK3172-SiP chip | |
RAK3272-SiP breakout board | |
RAK4630 stamp module | |
RAK11720 stamp module | |
RAK11721 breakout board |
The simpliest example is just showing how to design an application that is event based and keeps the MCU and LoRa transceiver in low power mode whenever possible.
It includes as well a simple example how to implement custom AT commands.
A simple sensor application based on RAK1901 and RAK1902. It reads temperature, humidity and barometric pressure from these sensors and sends them in a configurable interval.
This example is using the Cayenne LPP data format to send the formatted payload.
A simple sensor application based on RAK1906 and optional RAK1903 or RAK12010. It reads temperature, humidity and barometric pressure and environment light from these sensors. It displays the values on the RAK14000 and sends them in a configurable interval.
This example is using the Cayenne LPP data format to send the formatted payload.
Due to the memory required for driving the EPD, when using with the RAK3172, the LoRaWAN regions have to be reduced to a few to have enough flash available.
Same example as RUI3-Sensor-Node-EPD-2.13
, but this project uses some of the VSC tricks from the Tips-n-Tricks for Visual Studio Code.
This example uses the RAK12007 ultrasonic sensor module to measure the water level in a water tank.
This example is using the Cayenne LPP data format to send the formatted payload.
A motion based location tracker using the RAK12500 and RAK1904 WisBlock modules. Based on the RUI3-LowPower-Example code.
This example is using the Cayenne LPP data format to send the formatted payload.
A door or window alarm system using the RAK13011 magnetic relay switch module. This examples features the usage of a queue to collect events. For the alarm system (or open/close counter), this was necessary, because events could be triggered faster than the uplink packets can be sent over LoRaWAN.
Example code for using the RAK5811 0-5V analog input module with RUI3. For lowest power consumption, the RAK5811 is powered down until a data reading is required. The interval time for reading the data can be setup with AT command.
Example code for using the RAK12022 PT100 sensor module with RUI3. For lowest power consumption, the RAK120221 is powered down until a data reading is required. The interval time for reading the data can be setup with AT command.
A sensor application that combines temperature, humidity, barometric pressure, CO2 and VOC sensing. It detect automatically which sensors are attached and adjusts its payload to the available sensor data. It supports WisBlock RAK1906, RAK12037 and RAK12047 sensor modules
This is a PoC of a very basic signal tester. It works in both LoRa P2P and LoRaWAN mode. It uses a simple OLED display and has no GUI. All settings are done over USB with RUI3 AT commands.
It is a very simple (~30 US$ cheap) device that can help to check LoRa and LoRaWAN coverage. It does not claim to be a super precise instrument, it is just an affordable small instrument to check signal coverage.
A control application that changes the status of a relay depending on a received data packet. This is as well an example how to use LoRaWAN Class C to be able to receive downlink packets from the LoRaWAN server at any time. It supports WisBlock RAK13001 and RAK13007 relay modules
This example is a simple Modbus Master that reads sensor values from a Modbus Slave. For easy testing a Modbus Slave application is available for another WisBlock/WisDuo based module with a temperature, humidity and barometric pressure sensor.
This example uses a modified version of the Modbus-Master-Slave-for-Arduino library. This library was choosen because of its small code size. However, due to some incompatible definitions, it did not compile with RUI3. The library was slightly modified to work with RUI3 and is included as project files RUI3_ModbusRtu.cpp
and RUI3_ModbusRtu.h
.
The original libray is licensed under the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1
RUI3 code example for a simple LoRa P2P communication. LoRa_P2P_TX is sending packets in intervals (can be setup with custom AT command ATC+SENDINT=xxx (xxx in seconds)). LoRa_P2P_RX is listening to incoming packets and response within a second with its own packet.
This is a PoC of a simple LoRa Mesh Network. It includes everything to setup a Mesh Network (compatible with WisBlock-API-Mesh).
It supports a limited number of Mesh nodes (15 with the RAK3172 and 30 with the RAK4630 and RAK11720) and sends a dummy data packet.
Beside of packet broadcasting it supports sending data to a specific other node and it is as well possible to define a master node to which all other nodes are sending the packets.
RUI3 code example for the WisBlock Kit 1 which includes RAK1901 (temperature and humidity), RAK1902 (barometric pressure) and RAK1903 (light) sensor support. Ideal if the Kit 1 is changed to use RUI3 for lower the power consumption, specially if the RAK4631 is replaced with a RAK3372 WisBlock Core Module (RAK3172).
RUI3 code example for the WisBlock Kit 4 which uses the RAK1906 (temperature, humidity and barometric pressure) sensor. Ideal if the Kit 4 is changed to use RUI3 for lower the power consumption, specially if the RAK4631 is replaced with a RAK3372 WisBlock Core Module (RAK3172).
RUI3 code example for an I2C or serial connected GNSS module based on u-blox MAX-7Q (RAK1910) or u-blox ZOE-M8Q (RAK12500).
Then it starts a location acquisition in the time interval set with ATC+SENDINT. It will try to get a location in 1/2 the time of the acquisition time.
If a location was aquired, it will send the location in Cayenne LPP format over LoRaWAN or LoRa P2P. If no location was found, it will send only the battery voltage.
This library is tested with u-blox MAX-7Q (RAK1910) and u-blox ZOE-M8Q (RAK12500).
It uses Sparkfun libraries over I2C (RAK12500) or Serial (RAK1910) and UBX messages, which are shorter than NMEA messages and reduce the communication effort.
For the u-blox MAX-7Q (RAK1910) an adapted version of the Sparkfun library is used.
RUI3 had at the time of release timing problems with OneWire communications. This example code uses a changed open source library GyverDS18 provided by Alex Gyver for the communication.
The example reads the sensor ID and the sensor values in an interval that can be setup with ATC+SENDINT
. It sends the sensor values in Cayenne LPP packet format over LoRaWAN or LoRa P2P.
This example works only with the RAK3172 modules. It is not compatible with the RAK4630 or RAK11720.
Get a RAKwireless RUI3 WisDuo stamp module, breakout board or evaluation board from our store
Get a RAKwireless RUI3 WisBlock Core module from our store