A Raspberry Pi Pico W based soil monitoring system that publishes moisture readings to an MQTT broker.
Dirtie is a microcontroller application designed to monitor plant soil conditions using a Raspberry Pi Pico W. It reads soil moisture data from connected sensors and publishes the readings to an MQTT broker, enabling integration with other monitoring and automation systems.
- Contains broker and web server used for device provisioning and data collection
- Android application used for device setup and viewing data from the device
- Raspberry Pi Pico W
- Adafruit soil moisture sensor
- Pico SDK
- Relatively involved setup process for this
- arm-none-eabi toolchain
- CMake
cmake -B build -DPICO_BOARD=pico_wcmake --build build
Additional cmake Flags:
- -DMQTT_BROKER_IP
- Specifies the location of your mqtt broker
- -DCMAKE_EXPORT_COMPILE_COMMANDS
- Outputs compile_commands.json
- -DCMAKE_BUILD_TYPE=Debug
- Includes debug symbols in output so application can be debugged with gdb/openocd/picoprobe
Because this was a pain point for me :)
- Have clangd installed and set up in neovim
- Run the initial cmake command with the -DCMAKE_EXPORT_COMPILE_COMMANDS flag
- Symlink the output compile commands to the root of the repo
ln -s build/compile_commands.json ./compile_commands.json
- Create the following .clangd file (.gitignored already) in the root of the repo
If:
PathMatch: .*\.c$|.*\.h$
CompileFlags:
Add: [
"-isystem/usr/arm-none-eabi/include/"
]