- Hardware supported
- Software used
- How to use it
- Packet data format
- Setup Weather Kits
- Setup GNSS Kits
- Setup Air Quality Kits
This is a new approach for WisBlock. It scans the I2C bus and Serial to detect which WisBlock modules are attached to the WisBlock base and creates an LoRaWAN payload in Cayenne LPP with the data of the found modules.
This firmware is using the WisBlock API V2
This code can be used without changes for
Module | Function | Used in Kit |
---|---|---|
RAK4631 |
WisBlock Core module | - |
RAK5005-O |
WisBlock Base board | - |
RAK19007 |
WisBlock Base board | - |
RAK19003 |
WisBlock Mini Base board | - |
RAK19001 |
WisBlock Fullsize Base board | - |
RAK1901 |
WisBlock Temperature and Humidty Sensor | WisBlock Kit 1, RAK Developer Kit 2 |
RAK1902 |
WisBlock Barometer Pressure Sensor | WisBlock Kit 1, RAK Developer Kit 2 |
RAK1903 |
WisBlock Ambient Light Sensor | WisBlock Kit 1, RAK Developer Kit 2 |
RAK1904 |
WisBlock Acceleration Sensor (used for GNSS solutions) | WisBlock Kit 2 & 3, WisBlock Tracker for LoRaWAN, RAK Developer Kit 3 |
RAK1905 |
WisBlock 9 DOF sensor | - |
RAK1906 |
WisBlock Environment Sensor | WisBlock Kit 4, RAK Developer Kit 4 |
RAK1910 |
WisBlock GNSS Sensor | WisBlock Kit 2 & 3, RAK Developer Kit 3 |
RAK1921 |
WisBlock OLED display | (Status display) |
RAK5814 |
WisBlock ACC608 encryption module | - |
RAK12002 |
WisBlock RTC module | - |
RAK12003 |
WisBlock FIR sensor | - |
RAK12004 |
WisBlock MQ2 Gas sensor | - |
RAK12008 |
WisBlock SCT31 CO2 Gas sensor | - |
RAK12009 |
WisBlock MQ3 Alcohol Gas sensor | - |
RAK12010 |
WisBlock Ambient Light sensor | - |
RAK12014 |
WisBlock Laser ToF sensor | - |
RAK12019 |
WisBlock UV Light sensor | - |
RAK12025 |
WisBlock Gyroscope sensor | - |
RAK12023/RAK12035 |
WisBlock Soil Moisture and Temperature sensor | WisBlock Soil Sensor Solution |
RAK12027 |
WisBlock Earthquake Sensor | - |
RAK12032 |
WisBlock Acceleration Sensor | - |
RAK12034 |
WisBlock 9 DOF sensor | - |
RAK12037 |
WisBlock CO2 sensor | - |
RAK12039 |
WisBlock Particle Matter sensor | - |
RAK12040 |
WisBlock AMG8833 temperature array sensor | - |
RAK12047 |
WisBlock VOC sensor | - |
RAK12052 |
WisBlock MLX90640 32x24 temperature array sensor | - |
RAK12500 |
WisBlock GNSS Sensor | WisBlock Tracker for LoRaWAN |
RAK14002 |
WisBlock 3 button touch pad | - |
RAK14003 |
WisBlock LED bar display | - |
RAK14008 |
WisBlock Gesture sensor | - |
RAK15000 |
WisBlock EEPROM module | - |
RAK15001 |
WisBlock Flash module | - |
RAK14008 |
WisBlock Gesture sensor | - |
RAK16000 |
WisBlock DC current sensor | - |
- The RAK1904 module MUST be installed in
- Slot C of RAK5005-O, RAK19007 or RAK19001
- Slot A of RAK19003
- The RAK1905 module MUST be installed in
- Slot C of RAK5005-O, RAK19007 or RAK19001
- Slot A of RAK19003
- RAK1910 and RAK12500 cannot be used together (both are GNSS location trackers)
The MCU and LoRa transceiver go into sleep mode between measurement cycles to save power. I could measure a sleep current of 40uA of the whole system for a solution that enables sleep. Some solutions, like GNSS trackers or the RAK12047 VOC sensor, that require longer wake times or more frequent wake-ups, have a higher power consumption.
In addition, sensors like the MQ gas sensors that are using a heating element will consume more power as well.
- PlatformIO
⤴️ alternativeArduinoIDE⤴️ (Not compatible atm)- Adafruit nRF52 BSP
⤴️ - Raspberry Pi RP2040 BSP
⤴️ - Patch to use RAK4631 & RAK11310 with PlatformIO
⤴️
- Adafruit BME680 Library
⤴️ - Adafruit FRAM I2C
⤴️ - Adafruit LIS3DH
⤴️ - Adafruit LPS2X
⤴️ - Adafruit MCP23017 Arduino Library
⤴️ - Adafruit Unified Sensor
⤴️ - Adafruit Unified Sensor
⤴️ - Adafruit EPD
⤴️ - ClosedCube OPT3001
⤴️ - Coulomb Counter
⤴️ - D7S
⤴️ - INA219_WE
⤴️ - LPS35HW
⤴️ - Melopero RV3028
⤴️ - MPU9250
⤴️ - nRF52_OLED
⤴️ - Pololu VL53L0X
⤴️ - RAK12019_LTR390_UV_Light
⤴️ - RAK12035_SoilMoisture
⤴️ - RAKwireless RAK12034
⤴️ - RAKwireless CAP1293 Touch Pad library
⤴️ - RAK I3G4250D Gyroscope
⤴️ - RAKwireless MQx library
⤴️ - RAKwireless VEML Light Sensor
⤴️ - RAKwireless Storage
⤴️ - RevEng PAJ7620
⤴️ - Sensirion Core
⤴️ - Sensirion Gas Index Algorithm
⤴️ - Sensirion I2C SGP40
⤴️ - SparkFun SHTC3 Humidity and Temperature Sensor Library
⤴️ - SparkFun u-blox GNSS Arduino Library
⤴️ - SparkFun SCD30 Arduino Library
⤴️ - SparkFun STC3x Arduino Library
⤴️ - SparkFun MLX90632 Noncontact Infrared Temperature Sensor
⤴️ - SparkFun ADXL313 Arduino Library
⤴️ - SparkFun GridEYE AMG88
⤴️ - TinyGPSPlus
⤴️
... to be updated, check platformio.ini for a list of all libraries used
The project was developed using Platform IO. But for the users that still stick to Arduino IDE, an Arduino IDE compatible copy of the sources is in the ArduinoIDE folder. The code is not compiling on Arduino IDE atm.
The complete project for PIO is in the PlatformIO folder.
When using PlatformIO, the libraries are all listed in the platformio.ini
and are automatically installed when the project is compiled.
When using Arduino IDE all libraries need to be installed manually using the Arduino Library Manager.
Compile the firmware and flash it on a WisBlock with all required modules installed.
Connect over USB to setup the LPWAN credentials. Use the DevEUI printed on the RAK4631, use the AppEUI and AppKey from your LPWAN server. Do NOT activate automatic join yet. As weather sensor levels are not changing very fast, it might be sufficient to set the send frequency to every 10 minutes. The send frequency is set in seconds, so the value would be 10 * 60 ==> 600
Example AT commands:
AT+NWM=1
AT+NJM=1
AT+BAND=10
AT+DEVEUI=1000000000000001
AT+APPEUI=AB00AB00AB00AB00
AT+APPKEY=AB00AB00AB00AB00AB00AB00AB00AB00
AT+SENDINT=600
Command | Explanation |
---|---|
AT+NWM=1 | set the node into LoRaWAN mode |
AT+NJM=1 | set network join method to OTAA |
AT+BAND=10 | set LPWAN region (here AS923-3) see AT Command Manual |
AT+DEVEUI=1000000000000001 | set the device EUI, best to use the DevEUI that is printed on the label of your WisBlock Core module |
AT+APPEUI=AB00AB00AB00AB00 | set the application EUI, required on the LoRaWAN server |
AT+APPKEY=AB00AB00AB00AB00AB00AB00AB00AB00 | set the application Key, used to encrypt the data packet during network join |
AT+SENDINT=600 | set the interval the sensor node will send data packets. 600 == 10 x 60 seconds == 10minutes |
The manual for all AT commands can be found here: AT-Commands.md AT?
Use the WisBlock Toolbox
The packet data is made compatible with the extended Cayenne LPP encoding from ElectronicCats/CayenneLPP
The content of the packet depends on the modules installed on the WisBlock Base Board:
Data | Channel # | Channel ID | Length | Comment | Required Module | Decoded Field Name |
---|---|---|---|---|---|---|
Battery value | 1 | 116 | 2 bytes | 0.01 V Unsigned MSB | RAK4631 | voltage_1 |
Humidity | 2 | 104 | 1 byte | in %RH | RAK1901 | humidity_2 |
Temperature | 3 | 103 | 2 bytes | in °C | RAK1901 | temperature_3 |
Barometric Pressure | 4 | 115 | 2 bytes | in hPa (mBar) | RAK1902 | barometer_4 |
Illuminance | 5 | 101 | 2 bytes | 1 lux unsigned | RAK1903 | illuminance_5 |
Humidity 2 | 6 | 104 | 1 byte | in %RH | RAK1906 | humidity_6 |
Temperature 2 | 7 | 103 | 2 bytes | in °C | RAK1906 | temperature_7 |
Barometric Pressure 2 | 8 | 115 | 2 bytes | in hPa (mBar) | RAK1906 | barometer_8 |
Gas Resistance 2 | 9 | 2 | 2 bytes | 0.01 signed (kOhm) | RAK1906 | analog_9 |
GNSS stand. resolution | 10 | 136 | 9 bytes | 3 byte lon/lat 0.0001 °, 3 bytes alt 0.01 meter | RAK1910, RAK12500 | gps_10 |
GNSS enhanced resolution | 10 | 137 | 11 bytes | 4 byte lon/lat 0.000001 °, 3 bytes alt 0.01 meter | RAK1910, RAK12500 | gps_10 |
Soil Temperature | 11 | 103 | 2 bytes | in °C | RAK12023/RAK12035 | temperature_11 |
Soil Humidity | 12 | 104 | 1 byte | in %RH | RAK12023/RAK12035 | humidity_12 |
Soil Humidity Raw | 13 | 2 | 2 bytes | 0.01 signed | RAK12023/RAK12035 | analog_in_13 |
Soil Data Valid | 14 | 102 | 1 byte | bool | RAK12023/RAK12035 | presence_14 |
Illuminance 2 | 15 | 101 | 2 bytes | 1 lux unsigned | RAK12010 | illuminance_15 |
VOC | 16 | 138 | 2 bytes | VOC index | RAK12047 | voc_16 |
MQ2 Gas | 17 | 2 | 2 bytes | 0.01 signed | RAK12004 | analog_in_17 |
MQ2 Gas Percentage | 18 | 120 | 1 byte | 1-100% unsigned | RAK12004 | percentage_18 |
MG812 Gas | 19 | 2 | 2 bytes | 0.01 signed | RAK12008 | analog_in_19 |
MG812 Gas Percentage | 20 | 120 | 1 byte | 1-100% unsigned | RAK12008 | percentage_20 |
MQ3 Alcohol Gas | 21 | 2 | 2 bytes | 0.01 signed | RAK12009 | analog_in_21 |
MQ3 Alcohol Gas Perc. | 22 | 120 | 1 byte | 1-100% unsigned | RAK12009 | percentage_22 |
ToF distance | 23 | 2 | 2 bytes | 0.01 signed | RAK12014 | analog_in_23 |
ToF Data Valid | 24 | 102 | 1 byte | bool | RAK12014 | presence_24 |
Gyro triggered | 25 | 134 | 6 bytes | 2 bytes per axis, 0.01 °/s | RAK12025 | gyrometer_25 |
Gesture detected | 26 | 0 | 1 byte | 1 byte with id of gesture | RAK14008 | digital_in_26 |
LTR390 UVI value | 27 | 2 | 2 bytes | 0.01 signed | RAK12019 | analog_in_27 |
LTR390 UVS value | 28 | 101 | 2 bytes | 1 lux unsigned | RAK12019 | illuminance_28 |
INA219 Current | 29 | 2 | 2 bytes | 0.01 signed | RAK16000 | analog_29 |
INA219 Voltage | 30 | 2 | 2 bytes | 0.01 signed | RAK16000 | analog_30 |
INA219 Power | 31 | 2 | 2 bytes | 0.01 signed | RAK16000 | analog_31 |
Touchpad left | 32 | 102 | 1 byte | bool | RAK14002 | presence_32 |
Touchpad middle | 33 | 102 | 1 byte | bool | RAK14002 | presence_33 |
Touchpad right | 34 | 102 | 1 byte | bool | RAK14002 | presence_34 |
SCD30 CO2 concentration | 35 | 125 | 2 bytes | 1 ppm unsigned | RAK12037 | concentration_35 |
SCD30 temperature | 36 | 103 | 2 bytes | in °C | RAK12037 | temperature_36 |
SCD30 humidity | 37 | 104 | 1 byte | in %RH | RAK12037 | humidity_37 |
MLX90632 sensor temp | 38 | 103 | 2 bytes | in °C | RAK12003 | temperature_38 |
MLX90632 object temp | 39 | 103 | 2 bytes | in °C | RAK12003 | temperature_39 |
PM 1.0 value | 40 | 103 | 2 bytes | in ug/m3 | RAK12003 | voc_40 |
PM 2.5 value | 41 | 103 | 2 bytes | in ug/m3 | RAK12003 | voc_41 |
PM 10 value | 42 | 103 | 2 bytes | in ug/m3 | RAK12003 | voc_42 |
Earthquake event | 43 | 102 | 1 byte | bool | RAK12027 | presence_43 |
Earthquake SI value | 44 | 2 | 2 bytes | analog 10 * m/s | RAK12027 | analog_44 |
Earthquake PGA value | 45 | 2 | 2 bytes | analog 10 * m/s2 | RAK12027 | analog_45 |
Earthquake SHUTOFF alert | 46 | 102 | 1 byte | bool | RAK12027 | presence_46 |
LPP_CHANNEL_EQ_COLLAPSE | 47 | 102 | 1 byte | bool | RAK12027 | presence_47 |
Switch Status | 48 | 102 | 1 byte | bool | RAK13011 | presence_48 |
SensorHub Wind Speed | 49 | 190 | 2 byte | 0.01 m/s | SensorHub RK900-09 | wind_speed_49 |
SensorHub Wind Direction | 50 | 191 | 2 byte | 1º | SensorHub RK900-09 | wind_direction_50 |
Audio level | 49 |
Channel ID's in cursive are extended format and not supported by standard Cayenne LPP data decoders.
Example decoders for TTN, Chirpstack, Helium and Datacake can be found in the folder RAKwireless_Standardized_Payload repo
The compiled files are located in the ./Generated folder. Each successful compiled version is named as
WisBlock_SENS_Vx.y.z_YYYY.MM.dd.hh.mm.ss
x.y.z is the version number. The version number is setup in the ./platformio.ini file.
YYYY.MM.dd.hh.mm.ss is the timestamp of the compilation.
The generated .zip
file can be used as well to update the device over BLE using either WisBlock Toolbox
When using PlatformIO in addition a UF2 file for the RAK4631 is generated. You can force the RAK4631 into bootloader mode by double-pushing the reset button. A new USB drive will be installed. Pull the UF2 file into the new drive to flash the device.
Debug output can be controlled by defines in the platformio.ini
LIB_DEBUG controls debug output of the SX126x-Arduino LoRaWAN library
- 0 -> No debug outpuy
- 1 -> Library debug output (not recommended, can have influence on timing)
API_DEBUG controls debug output of the WisBlock-API library
- 0 -> No debug outpuy
- 1 -> Library debug output
MY_DEBUG controls debug output of the application itself
- 0 -> No debug outpuy
- 1 -> Application debug output
CFG_DEBUG controls the debug output of the nRF52 BSP. It is recommended to keep it off
[env:wiscore_rak4631]
platform = nordicnrf52
board = wiscore_rak4631
framework = arduino
build_flags =
; -DCFG_DEBUG=2
-DSW_VERSION_1=1 ; major version increase on API change / not backwards compatible
-DSW_VERSION_2=0 ; minor version increase on API change / backward compatible
-DSW_VERSION_3=0 ; patch version increase on bugfix, no affect on API
-DLIB_DEBUG=0 ; 0 Disable LoRaWAN debug output
-DAPI_DEBUG=0 ; 0 Disable WisBlock API debug output
-DMY_DEBUG=0 ; 0 Disable application debug output
-DNO_BLE_LED=1 ; 1 Disable blue LED as BLE notificator
lib_deps =
beegee-tokyo/SX126x-Arduino
beegee-tokyo/WisBlock-API-V2
sparkfun/SparkFun SHTC3 Humidity and Temperature Sensor Library
adafruit/Adafruit LPS2X
closedcube/ClosedCube OPT3001
sabas1080/CayenneLPP
extra_scripts = pre:rename.py
This guide can be used for WisBlock Kit 1 and RAK Developer Kit 2
- WisBlock Core RAK4631
- WisBlock Base RAK5005-O, RAK19007 or RAK19001
- RAK1901
- RAK1902
- RAK1903
Install the modules in any matching slot, following the Quick Start Guides in the RAKwireless Documentation Center
Setup the device using the AT command interface or the BLE application
This guide can be used for WisBlock Kit 2, WisBlock Kit 3, WisBlock GNSS Tracker for LoRaWAN and RAK Developer Kit 3
- WisBlock Core RAK4631
- WisBlock Base RAK5005-O, RAK19007, RAK19003 or RAK19001
- RAK1910 or RAK12500
- RAK1904
- RAK1906
The RAK1904 module MUST be installed in
Slot C of RAK5005-O, RAK19007, RAK19003 or RAK19001
If using the RAK1910, it MUST be installed in
Slot A of RAK5005-O
any matching slot of RAK19007 or RAK19001
If using the RAK12500, it can be installed in any matching slot of the Base Boards.
The RAK1906 can be installed in any matching slot of the Base Board.
For installation guides, following the Quick Start Guides in the RAKwireless Documentation Center
Setup the device using the AT command interface or the BLE application
RAK11700 GNSS Tracker for LoRaWAN is the default start mode for this setup.
If building the Helium Mapper Kit, the mode MUST be changed with the below AT command:
The solution can be set to 3 different working modes using the AT command AT+GNSS
:
Command | Input Parameter | Return Value | Return Code |
---|---|---|---|
AT+GNSS? | - | Get/Set the GNSS precision and format 0 = 4 digit, 1 = 6 digit, 2 = Helium Mapper |
OK |
AT+GNSS=? | - | 0 or 1 or 2 |
OK |
AT+GNSS=<Input Parameter> |
1 or 2 or 3 |
- | OK or AT_PARAM_ERROR |
The Cayenne LPP standard format uses only 4 digit for the location precision. This default location format is automatically supported by most LoRaWAN servers and Visualization platforms like MyDevices
.
It is the default and is set with the AT command AT+GNSS=0
.
Setting this option, the data is still sent in Cayenne LPP format, but uses a custom data identifier and 6 digits for a higher latitude and longitude resolution. To decode this format a custom data encoder is required. Data encoders for TTN, Chirpstack and Datacake can be found in the Custom Data Decoder folder.
The enhanced location resolution is set with the AT command AT+GNSS=1
.
This option sends the data in the Helium Mapper format, as explained in Make a Helium Mapper with the WisBlock.
Packet decoders for this format are provided in the above article.
The Helium Mapper functionality is set with the AT command AT+GNSS=2
.
This guide can be used for WisBlock Kit 4 and RAK Developer Kit 4
- WisBlock Core RAK4631
- WisBlock Base RAK5005-O, RAK19007, RAK19003 or RAK19001
- RAK1906
Install the modules in any matching slot, following the Quick Start Guides in the RAKwireless Documentation Center
Setup the device using the AT command interface or the BLE application