The repo contains my code for connecting a DHT22 temperature and humidity sensor to the internet via a Raspberry Pi Pico W and MicroPython. You can think of it as a very early attempt at IoT / telemetry.
I'm still learning MicroPython and Raspberry Pi Pico - so please expect these instructions to change as I learn better ways of programming the device!
- Flash MicroPython onto the Pico. Here's the official guide.
- Copy the contents of the
/srcdirectory to the root directory of the Pico's internal storage. - In Thonny, add the
micropython-mcronpackage to the board. View source. This package is used for accurate timekeeping between readings. - You'll need to tweak line 200 of
lib/mcron/__init__.pyto betimer = machine.Timer(). This GitHub thread explains why. - In
secrets.py, change the values forWIFIto match your network. You'll also need to reconfigure the HTTP request code in/services/telemetry.pyto match your infrastructure.
- Add temeprature data from the onboard temperature chip.
- Improve handling of situations where the network connection is lost.
- Better cron-like scheduling of sensor events.
- Better HTTP telemetry code. Dweet is for testing only.