Archived project - This functionality is now being continued in https://github.com/sjefferson99/pico-boat-assistant
Pico W based relay controller for web based control of DC and AC circuits onboard.
This code is built around the Pimoroni Pico W firmware v1.19.9: https://github.com/pimoroni/pimoroni-pico/releases/download/v1.19.9/pimoroni-picow-v1.19.9-micropython.uf2
-
Uses Pico W board mounted on the PiHut relay board: https://thepihut.com/products/raspberry-pi-pico-relay-board
-
Optional LiPo and charger shim allows the Pico to reset circuits it is powered by without shutting down, you will need to connect VSYS to VBUS to power the relays from the shim.
- Populate wifi SSID and password in the config.py file
- Set the startup relay states in the config.py file using the dictionary format example given.
- Determine pico IP from DHCP server (hostname appears to be "PYBD")
- Navigate to http://:80 for further instructions
The board has a power LED to show that the Pico AND the relay board have power i.e. 5v on VBUS as opposed to just VSYS.
The relays each have an LED to show relay state on/off.
The Pico LED is normally off in proper operation.
When connecting to the wifi the LED will flash once per second. Should the conection fail, the LED will flash 5 times per second for the retry backoff period then loop back to connecting.
Refer to the config file comments for options to enable polling a specified website at a given interval for a successful http response and take action to reset a specified relay and rerun the wifi connection on any failures.