2016-04-12 18:24:21 +02:00
# ESP Wordclock
2016-04-12 18:07:25 +02:00
## Setup
2019-04-18 16:32:35 +02:00
### Initial Setup
2016-06-23 20:45:07 +02:00
Install the firmware on the ESP:
The ESP must be set into the bootloader mode, like [this ](https://www.ccc-mannheim.de/wiki/ESP8266#Boot_Modi )
The firmware can be downloaded with the following script:
< pre >
cd os/
./flash.sh ttyUSB0
< / pre >
2019-07-26 21:33:48 +02:00
Connect to the ESP via a terminal emulator like screen using a baud rate of 115200. Then format the filesystem and reboot the ESP with the following commands:
2016-06-23 20:45:07 +02:00
< pre >
file.format()
2019-07-26 21:33:48 +02:00
node.restart()
2016-06-23 20:45:07 +02:00
< / pre >
Then disconnect the serial terminal and copy the required files to the microcontroller:
2016-04-12 18:07:25 +02:00
< pre >
2016-06-23 20:45:07 +02:00
./tools/initialFlash.sh /dev/ttyUSB0
2016-04-12 18:07:25 +02:00
< / pre >
2019-04-18 16:32:35 +02:00
### Upgrade
Determine the IP address of your clock and execute the following script:
< pre >
./tools/remoteFlash.sh IP-Address
< / pre >
2021-01-15 18:39:23 +01:00
## Hardware Setup
2021-01-23 10:00:15 +01:00
Mandatory:
2016-04-12 18:07:25 +02:00
* GPIO2 LEDs
2021-01-15 18:39:23 +01:00
* GPIO0 Bootloader (at start)
* GPIO0 factory reset (long during operation)
2021-01-23 10:00:15 +01:00
Optinal:
* ADC VT93N2, 48k light resistor
2021-01-23 18:10:53 +01:00
* GPIO4 DS18B20 Temperatur sensor
2021-01-15 18:39:23 +01:00
## MQTT Interface
2021-01-23 10:00:15 +01:00
### Status
* **basetopic**/brightness **Current brightness in percent**
* **basetopic**/background **Current background color**
2021-01-23 10:05:18 +01:00
* **basetopic**/row1 **Current background color**
2021-01-23 18:10:53 +01:00
* **basetopic**/temp **Temperatur**
2021-01-23 10:00:15 +01:00
### Commands
2021-01-15 19:03:20 +01:00
* **basetopic**/cmd/single
2021-01-23 09:55:13 +01:00
* ON **Set brightness to 100%**
* OFF **Set brightness to 0%**
* 0-100 **Set brightness to given value**
* #rrggbb **Background color is set to hex representation of red, green and blue**
* 0-255,0-255,0-255 **Background color is set to decimal representation of red, green an blue**
2021-01-15 18:39:23 +01:00
* **basetopic**/cmd/telnet
2021-01-23 09:55:13 +01:00
* ignored **Stop MQTT server and start telnetserver at port 23**
2021-01-23 10:05:18 +01:00
* **basetopic**/cmd/row1
* 0-255,0-255,0-255 **Background color is set to decimal representation of red, green an blue**
2021-01-23 19:17:30 +01:00
* **basetopic**/cmd/row1
* 0-255,0-255,0-255 **Background color is set to decimal representation of red, green an blue**
* **basetopic**/cmd/row2
* 0-255,0-255,0-255 **Background color is set to decimal representation of red, green an blue**
* **basetopic**/cmd/row3
* 0-255,0-255,0-255 **Background color is set to decimal representation of red, green an blue**
* For all rows...
* **basetopic**/cmd/row10
* 0-255,0-255,0-255 **Background color is set to decimal representation of red, green an blue**
2021-01-15 20:21:57 +01:00
## OpenHAB2
Tested MQTT with binding-mqtt 2.5.x
### Configuration
```
Thing mqtt:topic:wordclock "Wordclock" (mqtt:broker) @ "MQTT" {
Channels:
Type dimmer : dim "Dimming" [ stateTopic="basetopic/brightness", commandTopic="basetopic/cmd/single" ]
Type string : cmd "Command" [ commandTopic="basetopic/cmd/single" ]
Type switch : active "Active" [ commandTopic="basetopic/cmd/single" ]
Type colorRGB : background "Background" [ stateTopic="basetopic/background", commandTopic="basetopic/cmd/single", on="28,0,0", off="0,0,0" ]
}
```