Go to file
2021-02-10 20:04:22 +01:00
diet Second flash script added, to compress lua on the host, not on the ESP8266 2021-02-08 19:47:35 +01:00
os Nodemcu-firmware has only integer support 2021-01-31 16:58:17 +01:00
simulation Display one color after the other 2019-05-22 21:25:33 +02:00
tools Clock is booting without mqtt 2021-02-09 19:58:59 +01:00
unit Remove display_countcharacters_de and display_countwords_de 2019-04-20 21:39:50 +02:00
.gitignore Ignore locally stored configuration files 2020-12-07 20:54:46 +01:00
commands.lua Each rows background can be set 2021-01-23 19:17:30 +01:00
displayword.lua Renamed briPercent to briPer 2021-02-10 20:04:22 +01:00
ds18b20.lua Temperatur measurement via DS18B20 added 2021-01-23 18:10:53 +01:00
init.lua Webserver is running without compiling anything 2021-02-08 19:18:55 +01:00
main.lua Renamed briPercent to briPer 2021-02-10 20:04:22 +01:00
mqtt.lua Renamed briPercent to briPer 2021-02-10 20:04:22 +01:00
Readme.md Each rows background can be set 2021-01-23 19:17:30 +01:00
telnet.lua Each rows background can be set 2021-01-23 19:17:30 +01:00
timecore.lua More local variables; ~ 2k more RAM 2016-06-19 15:57:57 +02:00
webpage.html Reduced html stuff 2020-02-12 20:14:01 +01:00
webserver.lua Move the complete logic of the http server into webserver.lua 2021-02-07 17:51:57 +01:00
wordclock.lua Shrinked wordclock struct 2021-02-10 19:45:08 +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/initialFlash.sh /dev/ttyUSB0

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) Optinal:
  • ADC VT93N2, 48k light resistor
  • GPIO4 DS18B20 Temperatur sensor

MQTT Interface

Status

  • basetopic/brightness Current brightness in percent
  • basetopic/background Current background color
  • 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/telnet
    • ignored Stop MQTT server 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" ]
}