/meteoink-esp32-s3

Meteostation based on E-Ink color display, ESP32 and micropython 1.20

Primary LanguagePythonMIT LicenseMIT

Meteoink

EPD 5.65 ACEP inch meteostation EPD 4.2 inch meteostation

What Meteoink is

Meteoink is home meteostation based on 4.2 inch dual color E-Ink display (BWY variant) or 5.65 inch 7 colors E-Ink display (ACEP variant), TTGO-T8-ESP32 and micropython 1.20. Meteostation is connected to your home WiFi and uses data from OpenWeatherMap project for obtaining weather forecast. It also uses DHT22 sensor for measuring indoor temperature and humidity. Whole system is powered from one 18650 Li-On battery charged through the USB on ESP board. Meteostation is usually operating half a year when refresh time is set to 20 minutes and there is good internet WiFi access.

Wiring

Meteostation wiring

Some pins can be moved to another position by changing config file pins.py.

but keep in mind that not all pins are available for any operation (some are not capable of ADC, some are not capable of SPI, ...). Also battery is not displayed in wiring as it has its own connector so its connection is obvious.

Box

Files for 3D printed parts are stored here.

Both variants of box are partialy screwed and partially glued as well as electronics. To stitch processor board or battery you can use acrylate 3M double side tape. DHT22 sensor is glued to chassis (grid for air access sahll be on the side pointing outside the box). When you glue it, apply glue very carefully as it shall not pass inside electronics (especially in the case of buttons or DHT sensor). When all electronics is inside, then chassis shall be either glued to frame (BWY variant) or screwed together (ACEP variant).

BWY (EPD 4.2)

3D printed frame 3D printed frame 3D printed frame

ACEP (EPD 5.65)

3D printed frame 3D printed frame 3D printed frame 3D printed frame

Micropython

To make software running on ESP32, you have to install Micropython first on it. You can install regular Micropython according to this tutorial, or simply use thonny IDE to do this job for you. Currently the metostation is tested with Micropython v. 1.20.

Upload python code

Once Micropython is installed, you can connect your ESP board to your computer by USB and attach to exposed UART (baudrate shall be 115200 Bd). Once yo are connected over serial port, you can start using python console provided through this port.

>>> import sys
>>> sys.implementation
(name='micropython', version=(1, 20, 0))

Just note that building Little FS is not necessary as it is created automatically in Micropython 1.20.

The last step is to upload all python code into created file sytem. This code is located in repository folder esp32/micropython. There are precompiled python files according to used variant of display. There is esp32/micropython/bwy folder for 4.2 inch Black/White/Yellow display, or esp32/micropython/acep folder for 5.65 7-color ACEP display. Code is precompiled to speed up startup of software (shorter time when CPU consuming juice from battery), and for better usage of RAM (compiler is not heavily involved). All files from selected folder shall be copied into board. For this purpose REPL based file access engine such as ampy or thonny IDE can be used for writing files into file system. Just keep in mind that you shall be disconnected from console otherwise this tools will not work properly.

Configuration - first run

With first run the metostation automatically switch to WiFi AP mode. You can use QR codes displayed on screen to setup your mobile phone WiFi and open suitable WEB page.

Initial screen

Once you are connected to meteostation, you shall see webpage similar to this one:

Config web page

To make station into operation you have to do following steps:

Add your location

You shall add at least one location at the beginning. This location will be later used in WiFi configuration. You can use more locations and bind them later to various WiFi, so when you are taking your weather station on holiday, it choose location according to WiFi in your location.

Add WiFi

Next step is to connect WiFi. When you attempt to connect WiFi, the list of available networks will be displayed. Then you can choose one you want to use, assign suitable location and store it.

Set OpenWeatherMap API key

The API key is long hash number which you shall get from OpenWeatherMap. There are some personal API keys which are for free however registration is required.

Meteostation

Here we go ... once all above is passed, then simply press reset and wait till station is connected and forecast displayed (it may take about one minute)

Forecast

Reconfiguration

If you want to get into setup WEB page again, then you have restart meteostation and immediately hold config button, till beep (it may take even half minute). Then QR codes appears on screen and configuration web server will be ready after next beep.

Others

Translations

Currently supported languages are English and Czech, however any support for translation to another language is welcommed. If someone wants to add the new language, it can be done in folder lang. Translation is always a dictionary where the key is english sentense and the value is its translation.

If some additional characters needs to be added, this shall be done in file font2png.py. There is a line just like following containing supported characters:

chars = 'aábcčdďeéěfghiíjklmnňoópqrřsštťuúůvwxyýzžAÁBCČDĎEÉĚFGHIÍJKLMNOÓPQRŘSŠTŤUÚŮVWXYÝZŽ0123456789'~!@#$%^&*()_+-[]{};\:"|,./<>?°' + "'"

You can add your missing characters here. Please add only characters which are used by meteostation as this will became to be part of bitmaps loaded into meteostation during startup. More characters means longer startup and shorter battery life per one charging cycle.

Meteoradar

Unfortunately meteoradar reading is really slooooow. That's because used python based variant of PNG reader is slow. This means that when meteoradar mode is used, then you have to expect your batery will be discharged way faster.