Code for the CuWatch PCB. The code is in MicroPython. Target is the Raspberry Pi Pico-W microcontroller.
Install micropython on the pico-w in the usual way (see micropython documentation.) Currently you can download the uf2 file for the pico-w from this web page. As of 11/4/2025 we are using version 1.26. To upload micropython on a Pico-W that is sitting on a Pepper baseboard, connect the Pico-w to your computer using a micro-USB cable. Hold down the reset button on the base board and the white button on the pico simultaneously. Release the reset button. The Pico-W will show up as a disk on your computer. Drag the uf2 file to that disk. The pico-w will reboot and disconnect from the computer.
Install mpremote and mpy-cross in your favorite local python enviromnent usins pip.
pip install mpremote mpy-crossEither download the zip file or use git to clone the local repo to your machine.
To be able to log onto the Pico-W web server, its MAC address must be registered with PhysIT. To get the mac address, plug the board into your computer and run the findmac.py script.
mpremote findmac.pyPhysIT will assign a (non-static) IP address to the Pico-W. Add the MAC address and corresponding number to the table here.
This file has the SSID and wifi password in it. The install scripts create one if none exists. For Physics 1110, this works, since RedRover does not require a password. If you had a wifi password, you'd need a password for the wifi network too.
PASS=None
SSID="RedRover"
MQTT_SERVER="pepper.physics.cornell.edu"
There is a shell script that should do what you want. See the script here.
Run as follows
sh ./install_mqtt.sh XXwhere XX is the number assigned to the PICO-W. This will allow students to know which board they are using.
At Cornell the device can be accessed via http://pepper.physics.cornell.edu (must be on-campus to see this board.)