An often more straightforward alternative to the Arduino IDE is the PlatformIO framework. It is integrated well into Visual Studio Code on all platforms and can also be used via a terminal, which is the recommended approach on Linux/Unix systems and is detailed in the following.
Install PlatformIO Core by following the official instructions.
If you want to test the library standalone, we recommend cloning the library code:
git clone [email protected]:Sensirion/arduino-upt-mqtt-client.git
Finally, it is possible to run the example by building and flashing it, and then monitoring the device:
pio run -e basicUsage -t upload && pio device monitor
Additional insight into the program's actions can be gained by enabling logging messages, which can be done by utilizing the develop
environment and setting the desired logging level in platformio.ini
.
Configuration of MQTT can be managed over the API. For more details refer to the API guide here. MQTT certificate and WiFi params can be configured in src/mqtt_cfg.h
as well.
Insights of the build process can be gained by examining the logs/buildlog.log
file generated by pio run
, which contains an environment dump.
The pio run
command automatically copies the example .ino
script file to a .cpp
file to successfully compile.
This library was developed utilizing the ESP logging library. To see info messages, be sure to set the desired verbosity level (see platformio.ini
).