This is the electronics/code setup for a Raspberry Pi Pico (running circuitPython) to do the following:
- Connect to local WiFi
- Set the correct board time
- Fetch a static website
- Parse the website for specific data (using regex)
- Set a servo position based on the data (Yes/No/Help)
- Sleep for the remainder of the hour
This is a project using circuitPython - info here: https://circuitpython.org/
It also uses Adafruit circuitPython bundle - info here: https://circuitpython.org/libraries
To get the clock working it needs to know the wifi name and password, and the beach name it's checking water quality for, all this comes from a file named settings.toml, and it should look like this:
CLOCK_WIFI_SSID = "my_WiFi_name"
CLOCK_WIFI_PASSWORD = "my_secret_password"
CLOCK_BEACH_NAME = "Gyllingvase"
To update the Raspberry Pi Pico, mount it as a USB drive, then copy the files code.py and settings.toml (with correct WiFi settings).
Also copy over the whole modules and lib folders.
- Install the CircuitPython extension:
- use
Shift + Command + P (Mac) / Ctrl + Shift + P (Windows/Linux)to open the command palette. - run circuitpython.openSerialMonitor from the command palette
- in the open terminal window, choose the board that is connected
- CTRL-D to reload terminal