]> the.earth.li Git - esp8266-clock.git/blob - README.md
Add basic README.md
[esp8266-clock.git] / README.md
1 esp8266-clock
2 =============
3
4 This is a simple C / NON-OS SDK based firmware for the
5 [ESP8266](https://espressif.com/en/products/hardware/esp8266ex/overview)
6 devices to drive a
7 [MAX7219](https://www.maximintegrated.com/en/products/power/display-power-control/MAX7219.html)
8 based display of 4 8x8 LED matrix modules to display a 24 hour clock, synced
9 via NTP.
10
11 It uses the ESP8266 SPI interface to talk to the MAX7219, though repurposes
12 MISO to be CS as the MAX7219 isn't strictly an SPI device:
13
14 ```
15 ESP8266        MAX7219
16 GPIO13 (MOSI) -> DIN
17 GPIO14 (CLK)  -> CLK
18 GPIO12 (CS)   -> LOAD / nCS
19 ```
20
21 Building
22 --------
23
24 You will need an xtensa-lx106 toolchain and the Espressif [NONOS
25 SDK](https://github.com/espressif/ESP8266_NONOS_SDK). If the toolchain is in
26 the system path and the SDK resides in `/opt/esp8266-sdk` then a simple `make`
27 should output 2 ROM images (one for each flash slot).
28
29 If this is the first time you've built the project you'll need to modify
30 `project_config.h` to match your settings - in particular wifi details.
31
32 You can then flash to your device as follows (these addresses are for a 2MB
33 flash part, change the last 2 addresses to 0xFC000 & 0xFE000 for a smaller 1MB
34 part):
35
36 ```
37 esptool --port /dev/ttyUSB0 --baud 921600 write_flash \
38         0x0 boot_v1.7.bin \
39         0x1000 rom0.bin \
40         0x1FC000 esp_init_data_default_v08.bin \
41         0x1FE000 blank.bin
42 ```
43
44 (You might need a `--flash_size` and/or `--flash_mode` parameter to keep your
45 device happy - I found getting this wrong led to a failure to boot correctly.)
46
47 Upgrades
48 --------
49
50 Basic Over-the-Air upgrade functionality is included; `UPGRADE_HOST` and
51 `UPGRADE_PATH` must be set appropriately to form the base of the URL to check.
52 `version.txt` is looked for at the URL, and a `ESP8266-Upgrade-Version:` header
53 parsed to determine the version available for download. If this is later than
54 the running version then, depending on which flash slot is currently in use,
55 `rom0.bin` or `rom1.bin` will be downloaded into the non-running slot. If this
56 is successful the device will boot into the new image. A check for updated
57 firmware is made every time the wifi is reconnected to.
58
59 License
60 -------
61
62 All my code in this project is released under GPLv3 or later.