This is the sensor node part of a LoRaWAN network to save environmental data to a remote database. The software reads data from several sensors, namely the SPS30 particulate matter sensor, the SEN0170 anemometer, the BME680 temp, press etc module and the LPPYRA03AV pyranometer. A custom shield was also developed: schematics and the KiCad project files are available here.
- Install
kconfigwithsudo apt install kconfig-frontendsor whatever for your distro - Install
kconfiglibwithpip install kconfiglib - Install
PlatformIO Core(see below)
-
Install PlatformIO Core (needed cuz the plugin is still experimental) with
python3 -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/develop/scripts/get-platformio.py)" -
In CLion go to Edit->Settings->Plugins->Marketplace and search for "PlatformIO for CLion"
-
Install it (and restart CLion as prompted)
-
Go to Tools->PlatformIO->Home
-
[If CLion complains about paths, run (with
sudo)ln -s ~/.platformio/penv/bin/platformio /usr/local/bin/platformioln -s ~/.platformio/penv/bin/pio /usr/local/bin/pioln -s ~/.platformio/penv/bin/piodebuggdb /usr/local/bin/piodebuggdbThis will create links to make CLion believe paths are right. Restart CLion. Type "pio run" in CLion Terminal]
-
In the webpage it opens, click on "Open Project" and select the project's root folder
-
Re-open Clion, click on File->"Close project"
-
In the launcher window, click on open an existing project and select the project's root folder
-
In CLion, open the Terminal click Alt+F12 (or whatever in OS X)
-
Type in "platformio run"
-
Done, follow the steps below.
-
Commands to build, clean, upload etc are under Tools->PlatformIO
-
To build the Doxygen documentation, go to Build->"Build project", the docs is in html folder
2. Edit hal.h in src/hal/hal.h inside one of .pio library folders and replace in line 25 u1_t with unsigned char
- From a terminal (from the project root) type
menuconfigorguiconfig, edit prefs and save - Then type
genconfigto generate/update theconfig.hheader file
5. Compile and upload. For CLion, see above. Otherwise, use Visual Studio Code with the PlatformIO plugin or the command line
-
Step
3can be done in CLion's Terminal -
If Monitor (serial monitor) under Tools->PlatformIO doesn't work, please open a terminal and type
screen /dev/ttyUSB0 115200. Exit withCTRL+aCTRL+dAND typefuser -k /dev/ttyUSB0. -
You can generate the Doxygen documentation with
Build->Build Project