Go to file
2023-03-02 20:50:49 +01:00
os Changed to python3 2023-03-02 20:20:28 +01:00
simulation Create diet files 2022-01-23 18:29:02 +01:00
tools Upload into temporary file; Rename it after upload was finished 2022-01-06 16:46:33 +01:00
unit Remove display_countcharacters_de and display_countwords_de 2019-04-20 21:39:50 +02:00
.gitignore Ignore the shrinked LUA scripts, which are uploaded to the ESP 2021-10-28 21:06:49 +02:00
commands.lua Each rows background can be set 2021-01-23 19:17:30 +01:00
displayword.lua Refactored files to modules 2022-01-23 18:30:46 +01:00
ds18b20.lua Temperatur measurement via DS18B20 added 2021-01-23 18:10:53 +01:00
init.lua Websever can be started at runtime 2022-12-09 22:32:40 +01:00
main.lua Removed heap logging messages 2023-03-02 20:34:07 +01:00
mqtt2.lua Seperated new logic into a new mqtt file 2022-01-23 20:30:48 +01:00
mqtt.lua Merged 2022-12-09 20:48:13 +01:00
Readme.md Seperated new logic into a new mqtt file 2022-01-23 20:30:48 +01:00
telnet.lua used new example with pipe based telnet server 2021-03-14 16:23:33 +01:00
timecore.lua Refactored files to modules 2022-01-23 18:30:46 +01:00
webpage.html Selected colors are shown in expected position 2023-03-02 20:50:49 +01:00
webserver.lua Clear rgb buffer before updating it 2022-12-09 23:47:01 +01:00
wordclock.lua Refactored files to modules 2022-01-23 18:30:46 +01:00

ESP Wordclock

Setup

Initial Setup

Install the firmware on the ESP: The ESP must be set into the bootloader mode, like this

The firmware can be downloaded with the following script:

cd os/
./flash.sh ttyUSB0

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:

file.format()
node.restart()

Then disconnect the serial terminal and copy the required files to the microcontroller:

./tools/initialDietFlash.sh /dev/ttyUSB0

Install the optional packages:

./tools/initialDietFlash.sh /dev/ttyUSB0 mqtt.lua
./tools/initialDietFlash.sh /dev/ttyUSB0 mqtt2.lua
./tools/initialDietFlash.sh /dev/ttyUSB0 ds18b20.lua

Upgrade

Determine the IP address of your clock and execute the following script:

./tools/remoteFlash.sh IP-Address

Hardware Setup

Mandatory:

  • GPIO2 LEDs
  • GPIO0 Bootloader (at start)
  • GPIO0 factory reset (long during operation)

Optional:

  • ADC VT93N2, 48k light resistor
  • GPIO4 DS18B20 Temperatur sensor

MQTT Interface

Status

  • basetopic/brightness Current brightness in percent
  • basetopic/background Current background color
  • basetopic/color Current foreground color
  • basetopic/color1 Current foreground color for first minute
  • basetopic/color2 Current foreground color for second minute
  • basetopic/color3 Current foreground color for third minute
  • basetopic/color4 Current foreground color for fourth minute
  • basetopic/row1 Current background color
  • basetopic/temp Temperatur

Commands

  • basetopic/cmd/single
    • 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
  • basetopic/cmd/color
    • 0-255,0-255,0-255 Foreground color is set to decimal representation of red, green an blue
  • basetopic/cmd/color1
    • 0-255,0-255,0-255 Foreground color for first minute is set to decimal representation of red, green an blue
  • basetopic/cmd/color2
    • 0-255,0-255,0-255 Foreground color for second minute is set to decimal representation of red, green an blue
  • basetopic/cmd/color3
    • 0-255,0-255,0-255 Foreground color for third minute is set to decimal representation of red, green an blue
  • basetopic/cmd/color4
    • 0-255,0-255,0-255 Foreground color for fourth minute is set to decimal representation of red, green an blue
  • basetopic/cmd/telnet
    • ignored Stop MQTT server, clock and start telnetserver at port 23
  • basetopic/cmd/row1
    • 0-255,0-255,0-255 Background color is set to decimal representation of red, green an blue
  • 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

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" ]
}