You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[4.2 inch dual color E-Ink display](https://www.waveshare.com/4.2inch-e-paper-module-c.htm) (variant `bwy`) or
11
+
[T5-4.7 Inch E-paper](https://www.lilygo.cc/products/t5-4-7-inch-e-paper) (variant `epd47`). Platform running this meteostation is [micropython 1.20](https://micropython.org/) runningt on [TTGO-T8-ESP32](https://github.com/LilyGO/TTGO-T8-ESP32/tree/master)
12
+
compatible board.
13
+
14
+
Meteostation is connected to your home WiFi and uses data from [OpenWeatherMap](https://openweathermap.org/).
15
+
It also uses [DHT22](https://github.com/semestrinis/Arduino/wiki/DHT22-temperature-humidity-sensor)
14
16
sensor for measuring indoor temperature and humidity. Whole system is powered from one
Just note thatthere is many of possible frames e.g. on [Thingiverse](https://www.thingiverse.com/search?q=T5-4.7&page=1&type=things&sort=relevant) for this model of display.
53
62
54
63
## Micropython
55
64
56
65
To make software running on ESP32, you have to install Micropython first on it. You shall use
57
-
[custom built of Micropython](https://github.com/ondiiik/meteoink/blob/master/esp32/micropython.bin)
58
-
according to [this tutorial](https://docs.micropython.org/en/latest/esp32/tutorial/intro.html#deploying-the-firmware).
59
-
The reason for custom build is, that startup of meteostation is then way faster. This significantly reduce battery consumption.
60
-
You can also use [thonny IDE](https://randomnerdtutorials.com/getting-started-thonny-micropython-python-ide-esp32-esp8266/) to do
61
-
this job for you.
66
+
[custom built of Micropython](https://github.com/ondiiik/meteoink/blob/master/esp32/micropython.bin) which contains
67
+
all necessary, including required python code. This also allow meteostation to startup way faster, what significantly
68
+
reduce battery consumption.
69
+
70
+
### Flashing of micropython
71
+
72
+
All necessary files and upload script can be found in repository folder [esp32](https://github.com/ondiiik/meteoink/tree/master/esp32).
To flash firmware to your ESP32 board you can use [flash.sh](https://github.com/ondiiik/meteoink/raw/master/esp32/flash.sh)
80
+
shell script. Just note that you will need to have installed [python interpreter](https://www.python.org/downloads/) first.
81
+
You also need to have [esptool](https://pypi.org/project/esptool/) installed in your `python`. Once you have `python` installed
82
+
on your PC you can install `esptool` by following command:
83
+
84
+
```
85
+
pip install esptool
86
+
```
87
+
88
+
Then you can run [flash.sh](https://github.com/ondiiik/meteoink/raw/master/esp32/flash.sh) script to flash firmware into your
89
+
ESP32 board. You can use first argument to specify custom USB UART port where board is connected (otherwise `/dev/ttyUSB0`
90
+
is used by default). Just note that this script will erase flash on ESP32 including file system, so you can be sure that
91
+
your previous data will be definitely lost (good idea to backup them before flashing).
62
92
63
93
64
94
## Upload binary files
65
95
66
-
The last step is to upload required binary files into device file sytem. This binaries are located in repository folder
67
-
[esp32/micropython](https://github.com/ondiiik/meteoink/tree/master/esp32/micropython) for each variant of display. There is [esp32/micropython/bwy](https://github.com/ondiiik/meteoink/tree/master/esp32/micropython/bwy)
68
-
folder for 4.2 inch Black/White/Yellow display, or [esp32/micropython/acep](https://github.com/ondiiik/meteoink/tree/master/esp32/micropython/acep)
69
-
folder for 5.65 7-color ACEP display. All files from selected folder shall be copied into board.
70
-
For this purpose REPL based file access engine such as [ampy](https://techtutorialsx.com/2017/06/04/esp32-esp8266-micropython-uploading-files-to-the-file-system/) or
71
-
[thonny IDE](https://randomnerdtutorials.com/getting-started-thonny-micropython-python-ide-esp32-esp8266/) can be used for writing files into file system.
72
-
Just keep in mind that you shall be disconnected from console otherwise this tools will not work properly.
96
+
Each meteostation variant needs to upload also files with web content and binaries with graphics. This binaries are located in repository folder [esp32/micropython](https://github.com/ondiiik/meteoink/tree/master/esp32/micropython) for each variant of
97
+
display. There shall be also uploaded file `hw.json` into `cfg` describing in which mode and with which pins the meteostation
98
+
will work.
99
+
100
+
Once you have installed `python` on your PC you can use [ampy](https://techtutorialsx.com/2017/06/04/esp32-esp8266-micropython-uploading-files-to-the-file-system/) or
101
+
[Thonny IDE](https://randomnerdtutorials.com/getting-started-thonny-micropython-python-ide-esp32-esp8266/) to do this job for you.
102
+
Following files needs to be copied according to variant you use:
103
+
104
+
#### Files for variant ACEP
73
105
106
+

107
+
108
+
- all files from folder [esp32/micropython/acep](https://github.com/ondiiik/meteoink/tree/master/esp32/micropython/acep).
109
+
- following `JSON` file into `cfg/hw.json` (this is also created automatically by default when this file is missing).
110
+
111
+
```
112
+
{
113
+
"variant": "acep",
114
+
"pins": {
115
+
"sck": 13,
116
+
"mosi": 14,
117
+
"miso": 12,
118
+
"cs": 15,
119
+
"dc": 27,
120
+
"rst": 26,
121
+
"busy": 25,
122
+
"dht": 22,
123
+
"led": 21,
124
+
"vbat": 35,
125
+
"buzzer": 33
126
+
},
127
+
"buttons": {
128
+
"hotspot": 32,
129
+
"alert": -1,
130
+
"sleep": -1
131
+
}
132
+
}
133
+
```
134
+
135
+
#### Files for variant BWY
74
136
75
-
## Configuration - first run
137
+

76
138
77
-
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.
139
+
- all files from folder [esp32/micropython/acep](https://github.com/ondiiik/meteoink/tree/master/esp32/micropython/bwy).
140
+
- following `JSON` file into `cfg/hw.json`.
141
+
142
+
```
143
+
{
144
+
"variant": "bwy",
145
+
"pins": {
146
+
"sck": 13,
147
+
"mosi": 14,
148
+
"miso": 12,
149
+
"cs": 15,
150
+
"dc": 27,
151
+
"rst": 26,
152
+
"busy": 25,
153
+
"dht": 22,
154
+
"led": 21,
155
+
"vbat": 35,
156
+
"buzzer": 33
157
+
},
158
+
"buttons": {
159
+
"hotspot": 32,
160
+
"alert": -1,
161
+
"sleep": -1
162
+
}
163
+
}
164
+
```
165
+
166
+
#### Files for variant EPD47
167
+
168
+

169
+
170
+
- all files from folder [esp32/micropython/acep](https://github.com/ondiiik/meteoink/tree/master/esp32/micropython/gs).
171
+
- following `JSON` file into `cfg/hw.json`.
172
+
173
+
```
174
+
{
175
+
"variant": "lilygo_epd47",
176
+
"pins": {
177
+
"sck": 13,
178
+
"mosi": 14,
179
+
"miso": 12,
180
+
"cs": 15,
181
+
"dc": 27,
182
+
"rst": 26,
183
+
"busy": 25,
184
+
"dht": 22,
185
+
"led": 21,
186
+
"vbat": 35,
187
+
"buzzer": 33
188
+
},
189
+
"buttons": {
190
+
"hotspot": 32,
191
+
"alert": -1,
192
+
"sleep": -1
193
+
}
194
+
}
195
+
```
196
+
197
+
Just note that whenvariant `"lilygo_epd47"` is detected in config file after startup, firmware automatically set-up all pins
198
+
for you and switch variant to `"epd47"`.
199
+
200
+
201
+
## Initial configuration
202
+
203
+
When all files are uploaded and meteostation restarted, it creates all missing `JSON` files in folder `cfg`. However
204
+
this initial data are missing some important data (API key, WiFi setup, location, ...). This causes that metostation
205
+
automatically switch to WiFi AP mode. You can use QR codes displayed on screen to setup your mobile phone WiFi to attach
@@ -112,36 +241,100 @@ displayed (it may take about one minute)
112
241
113
242
## Reconfiguration
114
243
115
-
If you want to get into setup WEB page again, then you have restart meteostation and immediately hold **config**
116
-
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.
244
+
If you want to get into setup WEB page again, then you have restart meteostation when holding **config**
245
+
button, till beep (it may take a few seconds) and meteostation became to start to hotspot mode again.
246
+
Then QR codes appears on screen and configuration web server will be ready after next beep.
247
+
248
+
Just note that this is **bit more complicated with EPD47 variant** which needs to do one more reboot after
249
+
display is repainted (rebooting will happen automatically). In this case you have to hold **config** button
250
+
whole time till you hear short ascending melody signalizes that WEB server is running.
117
251
118
252
119
253
## Manual configuration
120
254
121
255
All items configured by WEB interface are at the end stored in [JSON](https://cs.wikipedia.org/wiki/JavaScript_Object_Notation) files
122
-
in root of internal file storage. If this files are missing, they are created automatically after first start of meteostation. This files
123
-
can be also edited manually, and are then used after restart. However be careful when editing them, especially files `connection.json`
124
-
and `location.json`, where `connection.json` which uses index to `location.json` as reference and is easy to break binding between
125
-
them.
256
+
in `cfg` folder on device. If this files are missing, they are created automatically after first start of meteostation. This files
257
+
can be also edited manually (e.g. using [Thonny IDE](https://randomnerdtutorials.com/getting-started-thonny-micropython-python-ide-esp32-esp8266/)),
258
+
and they are then used after restart. However be careful when editing them, especially files `connection.json`
259
+
and `location.json`, where `connection.json` which uses index to `location.json` as reference and is easy to break binding between them.
260
+
261
+
Items in some of this files are described here:
262
+
263
+
### hw.json
264
+
265
+
```
266
+
{
267
+
"variant": "acep",
268
+
"pins": {
269
+
"sck": 13,
270
+
"mosi": 14,
271
+
"miso": 12,
272
+
"cs": 15,
273
+
"dc": 27,
274
+
"rst": 26,
275
+
"busy": 25,
276
+
"dht": 22,
277
+
"led": 21,
278
+
"vbat": 35,
279
+
"buzzer": 33
280
+
},
281
+
"buttons": {
282
+
"hotspot": 32,
283
+
"alert": -1,
284
+
"sleep": -1
285
+
}
286
+
}
287
+
```
288
+
289
+
-`"variant"` - Variant of used board. Can be one of `"acep"`, `"bwy"` or `"epd47"`
290
+
(or `"lilygo_epd47"` which forces auto-setup of pins after reboot).
291
+
-`"pins"` - Configurations of pins used for communication with peripheries.
292
+
-`"buttons"` - Configurations of pins used for connecting of control buttons.
126
293
127
-
Some of this files are described here:
128
294
129
295
### api.json
130
296
297
+
```
298
+
{
299
+
"apikey": "",
300
+
"units": "metric",
301
+
"language": "en",
302
+
"variant": 4
303
+
}
304
+
```
305
+
306
+
-`"apikey"` - `apikey` obtained from [OpenWeatherMap](https://home.openweathermap.org/users/sign_up) used to download forecast.
131
307
-`"units"` - Which units shall be used (`"metric"` or `"imperial"`).
132
308
-`"language"` - Which language shall be used (`"cz"` or `"en"`).
133
309
-`"variant"` - How much days shall be displayed in forecast (number in range from 2 to 5, where 2 uses more detailed variant of forecast).
134
-
-`"apikey"` - `apikey` obtained from [OpenWeatherMap](https://home.openweathermap.org/users/sign_up) used to download forecast.
310
+
135
311
136
312
### beep.json
137
313
314
+
```
315
+
{
316
+
"temp_balanced": false,
317
+
"error_beep": false
318
+
}
319
+
```
320
+
138
321
-`"temp_balanced"` - Boolean telling if outdoor and indoor temperatures are balanced (so you can open window and start cooling your house).
139
322
-`"error_beep"` - Boolean telling if station shell you notify by beeping when some software error occur (goot for long time testing).
140
323
141
-
### spot.json
142
324
143
-
-`"ssid"` - Boolean telling if outdoor and indoor temperatures are balanced (so you can open window and start cooling your house).
144
-
-`"error_beep"` - Boolean telling if station shell you notify by beeping when some software error occur (goot for long time testing).
325
+
### sys.json
326
+
327
+
```
328
+
{
329
+
"exception_dump": 0,
330
+
"log_level": "info",
331
+
"led_enabled": false,
332
+
}
333
+
```
334
+
335
+
-`"exception_dump"` - Says how much bytes can be stored as exceptions dump into file system. Use 0 to disable this dumps.
336
+
-`"log_level"` - Verbosity of logging on UART terminal. Use one of `"debug"`, `"info"`, `"warning"`, `"error"` or `"critical"`.
337
+
-`"led_enabled"` - Tells if LED diode shall be used to report state of station (disable to safe a bit of battery juice).
145
338
146
339
147
340
## Others
@@ -150,7 +343,7 @@ Some of this files are described here:
150
343
151
344
Currently supported languages are English and Czech, however any support for translation to another language is welcommed.
152
345
If someone wants to add the new language, it can be done in folder [lang](https://github.com/ondiiik/meteoink/tree/master/simulator/lang).
153
-
Translation is always a dictionary where the key is english sentense and the value is its translation.
346
+
Translation is always a dictionary where the key is English sentence and the value is its translation.
154
347
155
348
If some additional characters needs to be added, this shall be done in file [font2png.py](https://github.com/ondiiik/meteoink/blob/master/graphics/font2png.py).
156
349
There is a line just like following containing supported characters:
0 commit comments