Micropython project for Raspberry Pi Pico. Collects data from a onewire temperature sensor and feeds it to MQTT on a wireless connection. Before you can use it you need to: - connect onewire sensor to Pico, - set up MQTT broker on a server, - optionally, but highly advisable, setup ntpd server in local network, - set up certificates (check out the MQTT_for_pie repo), - provide settings in config.py. Skeleton in config.py.example Notes: In order to test Pico, best use Thonny. At the time of writing this (Jun 2024), you won't be able to see live interpreter in PyCharm You will need kernel config options enabled: (Most likely:) CONFIG_USB_SERIAL_GENERIC CONFIG_USB_SERIAL_SIMPLE (Definitely:) CONFIG_USB_ACM Device path should be /dev/ttyACM0 To connect to it, add your user to dialout group. Alternatively change permissions on that device to something like: chmod o+rw /dev/ttyACM0 Or change owner on that device to your user To address pin 25 with LED use "LED": from machine import Pin led = Pin("LED", Pin.OUT) Before using tls (mosquitto, requests) you'll need to set time, for instance: import ntptime ntptime.settime() Be aware that default timeout on a socket is 1 second, which may not be enough. I'm using usocket directly so that I can set timeout to a larger value. The hard part is to deal with timeout from ntp server. I managed to cut down timeouts drastically by running my own ntp server on local network. Another hard part is setting up certificates so that umqttsimple can use them. TLDR, do it like that: https://github.com/JustinS-B/Mosquitto_CA_and_Certs/blob/main/client_maker Update: Script from that link, now dead, provided here as client_maker.sh For background information: https://github.com/orgs/micropython/discussions/10559 Script for server running MQTT reading data from MQTT and updating rrd database in separate project, with Bash script generating rrd database and generating graph from this database. Controlling temperature with PID not tested.