Testing MicroPython with Watchy ESP32 hardware.
The files inside the upload
directory should be copied to your Watchy device after MicroPython has been setup. Installation notes can be found on the Community Wiki.
The file /upload/src/config.py
is used as a configuration/settings file. You should only need to add your trusted wireless networks as tuples, and modify the Open-Meteo arguments. The WorldTimeAPI, which is used for NTP sync, will use the weatherTZ
for its own timezone look up as well.
On my Debian 12 system, I ran pip install mpy-cross-v6.1
because I am working with MicroPython 1.21.0. Check the MPY-CROSS github docs for which version to install. Once it was installed, I ran /home/<username>/.local/bin/mpy-cross <filename>.py
and it made the MPY file. I first did the font files and replaced the PY files with the MPY files on the Watchy, and it loaded without issues, then I did the lib files as well.
- Fix
check_weather
function- After the Micropython 1.21.0 update, the
requests
will not reach out to HTTPS sites
- After the Micropython 1.21.0 update, the
- Clean-up ePaper partial updates
- Current partial is real grainy and hard to read
- Peter Hinch has been working on partial epaper updates for the Waveshare Pico, is his code adaptable?
- Monitor watchy voltages, adjust battery icon ranges
- Max is 4V (I'm seeing 4.01x or 4.02x)
- Min is 2.66? - Still monitoring and testing
- Added ADC width, Mouser docs confirmed 12BIT width
- Reconfirmed ADC atten, LiPO is 3.3V so 11DB is used
- Add docstrings to libraries, clean up errors/warnings
- writer needs docstrings added
- can display/epaper/writer be refactored/combined/slimmed down?
- Reduce memory usage
- Change const() with prefix _
- Cross-compile lib files as mpy
- Cross-compile font files as mpy
- Work with others to integrate the v1 and v1.5 hardware code
- Have both PCF8563 and DS3231 libraries on the watch, load the appropriate driver
- How to identify v1/v1.5/v2 so we can re-map ADC and BTN3 pins, might need to be a
config.py
/manual user process- Maybe add WATCHY_VERSION to boot.py?
- It is not possible to get the wakeup bit in MicroPython yet, see GH: micropython/issues/6981
- tl;dr: There is a delay in the wakeup process, by the time the ESP32 wakes up the MicroPython bit used to track the individual buttons is lost.
- Github: hueyy/watchy_py - this project is largely based on this code
- Github: mcauser/micropython-waveshare-epaper - ePaper driver
- Github: peterhinch/micropython-font-to-py - Writer interface and font-to-py script
- Github: lewisxhe/PCF8563_PythonLibrary - RTC driver for Watchy v2
- Sync time in MicroPython using NTP - used section on Timezones
- ESP32/ESP8266 Analog Readings with MicroPython | Random Nerd Tutorials
- MicroPython Documentation
- WorldTimeAPI - Gives us time JSON response for specific time zones, including DST true/false
- Microcontroller: ESP32-PICO-D4
- USB-Serial: CP2104
- E-Paper Display: GDEH0154D67
- Watchy screen is 200x200
- at 48px font, it is 5 characters wide
- at 32px font, it is 8 characters wide
- at 24px font, it is 10 characters wide
- Display Connector: AFC07-S24ECC-00
- 3-Axis Accelerometer: BMA423
- Real Time Clock v1.5/2.0: PCF8563
- Battery: LiPo 3.7V 200mAH
- LDO Voltage Regulator: ME6211C33M5G-N
- Battery Connector: BOOMELE 1.25T-2PWT
- Micro-USB Connector: U-F-M5DD-Y-L
- Tactile Buttons: K2-1114SA-A4SW-06
- Vibration Motor: 1020
- PCB Antenna: SWRA117D