Skip to content

Latest commit

 

History

History
53 lines (38 loc) · 2.47 KB

platformio_usage.md

File metadata and controls

53 lines (38 loc) · 2.47 KB

Usage with PlatformIO

Installation

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

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.

Compile

The pio run command automatically copies the example .inoscript file to a .cpp file to successfully compile.

Logging

This library was developed utilizing the ESP logging library. To see info messages, be sure to set the desired verbosity level (see platformio.ini).