A simple MicroPython script to turn an ESP32 with oled into smart watch.
Currently it can connect to internet, get the weather and time. Next, Ill be adding access to Gmail using OAuth2ForDevices from Google and a script to save unread mail to Google Drive.
- Install MicroPython on your board.
- In the consts_exemple.py file, replace the following values with yours
NTW_LIST, WEATHER_API_KEY, GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET
- Rename the consts_exemple.py into consts.py.
- Upload the consts.py and the python files in the Libs and Sources folders at the root directory of your ESP32. You can use Ampy program to do so or the provided upload.sh scirpt. You can edit the .ampy file to change the default config.
- Run the main.py, you can use Ampy. For testing is like to use Esplorer.
The oled is not connected to the standard I2C pins, its SDA pin is 4 and SCL pin is 15. You can set this up by adding Wire.begin(4, 15) to your setup code. The display's I2C address is 0x3C. You will also need to use the OLED_RST pin to enable the display: pinMode(16,OUTPUT); digitalWrite(16, LOW); delay(50); digitalWrite(16, HIGH); After applying these settings I2CScan can find the display and most SSD1306 Arduino libraries work (for example the Adafruit SSD1306 works after changing Wire.begin() to Wire.begin(4, 15) and setting the reset pin and the I2C address).
Dimensions: 25.5mm height 50mm width 5.75mm thickness