t0mg/wordclock

Only 3 Leds light up (5, 6 and 7 in the chain)

Closed this issue ยท 8 comments

Hi,

I flashed the code to a Wemos D1 mini ESP32. I was able to connect to the Webserver and integrate it into my local WIFI Network. However, the only thing that changes is the LED color (if changed over the Webserver page). All other changes (show am/pm, changing the time manually or retrieving it over a time server) remain without any effect. Always the same 3 LEDs light up.

What could be the issue here?

t0mg commented

Hi Gordon,

wow that's pretty weird, never happened to me. Maybe an addressing issue ? I'd first check the wiring, then use a basic test sketch to turn all the LEDs on one by one (not all together unless you have a separate power upply and are not using USB power) just to make sure the entire LED chain is working. If that works, then in the wordclock code I'd turn on serial debugging (#define DEBUG 1) and put some DLOGLN() to see what's running, especially in the Display.cpp and ClockFace.cpp files.

Hi t0mg,

thanks for the quick response. Don't know what the issue was, maybe the incorrect face/matrix configuration?
I have a 10x10 matrix layout with a diffrent word/letter arrangement then in your english face config. After I adjusted some of the definitions in clockface.cpp an reuploaded the sketch (via Arduino IDE) and it seemed to work better, however the words/leds didn't match for a obvious reason. Since your code is pretty clean ๐Ÿ‘ :-) and well documented I was able to translate the definitions to my environment, woohoo.

However, I'm still having some issues/questions:

I eanbled logging and am getting this result:

Logging started.
DCHECK Line 22: (result) RTC didn't start
Config size: 261
Loaded config 'iwcThingName'= 'WordClock'
Loaded config 'iwcApPassword'= <hidden>
Loaded config 'iwcWifiSsid'= '***'
Loaded config 'iwcWifiPassword'= <hidden>
Loaded config 'iwcApTimeout'= '30'
Loaded config 'show_ampm'= '0'
Loaded config 'ldr_sensitivity'= '5'
Loaded config 'color'= '#0000ff'
Loaded config 'ntp_enabled'= '0'
Loaded config 'timezone'= '356'
Loaded config 'time'= '05:53:55'
Updating color
update state
Invalid minute 165
Time: 165:165
State changing from: 0 to 2
Setting up AP: WordClock
Use password: <hidden>
AP IP address: 192.168.4.1
State changed from: 0 to 2
State changing from: 2 to 3
Connecting to [***] (password is hidden)
State changed from: 2 to 3
WiFi connected
IP address: 192.168.44.41
State changing from: 3 to 4
Accepting connection
Wifi connected.
NTP time setting is disabled.
State changed from: 3 to 4

Despite diabling the ntp time feature and setting the time to eg. 05:53:55 the clock is showing "it is ten" (which is the correct time, but I guess it should display the manual time? (which seems to have been stored correctly)
I also notice that the display doesn't seem to update, despite outputing "Updating display" in the serial monitor.

Then I changed the time to NTP again and get this output, but the display (it is ten) stays the same. Any clue what I'm doing wrong?

Updating configuration
Value of arg 'iwcThingName' is:WordClock
iwcThingName='WordClockWordClock'
Value of arg 'iwcApPassword' is:
iwcApPassword was not changed
Value of arg 'iwcWifiSsid' is:***
iwcWifiSsid='***'
Value of arg 'iwcWifiPassword' is:
iwcWifiPassword was not changed
Value of arg 'show_ampm' is:0
show_ampm='00'
Value of arg 'ldr_sensitivity' is:5
ldr_sensitivity='55'
Value of arg 'color' is:#0000ff
color='#0000ff#0000ff'
Value of arg 'ntp_enabled' is:1
ntp_enabled='11'
Value of arg 'timezone' is:356
timezone='356356'
Value of arg 'time' is:
time=''
Saving config 'iwcThingName'= 'WordClock'
Saving config 'iwcApPassword'= <hidden>Saving config 'iwcWifiSsid'= '***'
Saving config 'iwcWifiPassword'= <hidden>Saving config 'iwcApTimeout'= '30'
Saving config 'show_ampm'= '0'
Saving config 'ldr_sensitivity'= '5'
Saving config 'color'= '#0000ff'
Saving config 'ntp_enabled'= '1'
Saving config 'timezone'= '356'
Saving config 'time'= ''
Configuration was updated.
Updating color
RTC set to:Sunday, January 16 2022 09:38:48
Timezone:Europe/Berlin

I noticed that the output of iwcWifiSsid return 2 times the actual WiFi SSID. Not sure where the output comes from, since I couldn't find this string in your code.

And this happens, when pushing the reset buttons of the wemos d1 mini esp32:

ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:10124
load:0x40080400,len:5856
entry 0x400806a8
Logging started.
DCHECK Line 22: (result) RTC didn't start
Config size: 261
Loaded config 'iwcThingName'= 'WordClock'
Loaded config 'iwcApPassword'= <hidden>
Loaded config 'iwcWifiSsid'= '***'
Loaded config 'iwcWifiPassword'= <hidden>
Loaded config 'iwcApTimeout'= '30'
Loaded config 'show_ampm'= '0'
Loaded config 'ldr_sensitivity'= '5'
Loaded config 'color'= '#0000ff'
Loaded config 'ntp_enabled'= '1'
Loaded config 'timezone'= '356'
Loaded config 'time'= ''
Updating color
Wifi not connected, cannot set time from NTP.
update state
Invalid minute 165
Time: 165:165
State changing from: 0 to 2
Setting up AP: WordClock
Use password: <hidden>
AP IP address: 192.168.4.1
State changed from: 0 to 2
State changing from: 2 to 3
Connecting to [***] (password is hidden)
State changed from: 2 to 3
WiFi connected
IP address: 192.168.44.41
State changing from: 3 to 4
Accepting connection
Wifi connected.
RTC set to:Sunday, January 16 2022 09:45:23
Timezone:Europe/Berlin
State changed from: 3 to 4

The output Invalid minute/invalid hour, refers to the timeserver not beeing set since the wifi is not connected I guess?

However, lot's of questions and not understood things in my head. Would appreciate your support very much :-)

Nevermind?

I thought die RTC module is optional, since the esp32 has wifi and time can be otained via wifi?

I just soldered a RTC module to the esp32 and voila, the clocks works now. I'm really impressed by your software. Very well done :-)

https://www.directupload.net/file/d/6430/bjy5mj5n_jpg.htm

Well, there is still one little little issue left I could need some assistance.

One minute, before the next time display occurs, the third pixel/letter "u" (between it and is) lights up. Cannot figure out why that is. No word is defined at this coordinate or before with a length larger 2:

Do you have a clue why?

Here is my clockface definition:

//     0123456789
// 09: ITUISJAXMY
// 08: TWENTYHALF
// 07: HAPPYHFIVE
// 06: TENQUARTER
// 05: TOPASTBDAY
// 04: ONEFOURTWO
// 03: FIVESIXTEN
// 02: THREESEVEN
// 01: TWELVEIGHT
// 00: NINELEVENJ

// All the segments of words on the board. The first too numbers are the
// coordinate of the first letter of the word, the last is the length. A word
// must always be on one row.

#define EN_S_IT 0, 9, 2
#define EN_S_IS 3, 9, 2

#define EN_H_ONE 0, 4, 3
#define EN_H_TWO 7, 4, 3
#define EN_H_THREE 0, 2, 5
#define EN_H_FOUR 3, 4, 4
#define EN_H_FIVE 6, 7, 4
#define EN_H_SIX 4, 3, 3
#define EN_H_SEVEN 5, 2, 5
#define EN_H_EIGHT 5, 1, 5
#define EN_H_NINE 0, 0, 4
#define EN_H_TEN 7, 3, 3
#define EN_H_ELEVEN 3, 0, 6
#define EN_H_TWELVE 0, 1, 6

#define EN_H_AM 6, 9, 2
#define EN_H_PM 7, 9, 2

#define EN_M_A 6, 9, 1
#define EN_M_PAST 2, 5, 4
#define EN_M_TO 0, 5, 2

#define EN_M_TEN 0, 6, 3
#define EN_M_QUARTER 3, 6, 7
#define EN_M_TWENTY 0, 8, 6
#define EN_M_TWENTYFIVE 0, 7, 10
#define EN_M_FIVE 6, 7, 4
#define EN_M_HALF 6, 8, 4
#define EN_M_QUART 3, 6, 7
#define EN_M_QUARTS 3, 6, 7

#define EN_M_OCLOCK 0, 9, 1

Here is a picture showcasing the problem:

https://s20.directupload.net/images/220116/vhscwe6o.jpg

t0mg commented

Yes I was going to write that it looks like you have no RTC module. This clock was designed with the RTC module in mind, setting the time via NTP was added later as a bonus. So yes in the code the RTC module is taken for granted. Even if you use NTP time, currently it gets the time once after you save the settings and then stores this in the RTC module. The idea is that you don't need wifi to use the clock once it has been setup.

But you can certainly change that and make it so that the clock checks for NTP every time it powers up, and remove the RTC module :)

Thanks for the picture, looks great ๐Ÿ‘
Congratulations on building your new clock! ๐Ÿ™‚

t0mg commented

Re. the letter turning one 1 minute before the time change its probably because the led strip normally starts with 4 LEDs (one in each corner) that each indicate a minute, so eg when it is 10:13, the clock reads "it is ten past ten" and three of the 4 corner LEDs light up to indicate that you need to add +3 to the text.

Now it looks like you don't have corner LEDs? The first LEDs in your chain are not corner leds so it's probably some code that you need to comment out to remove this behavior.

Correct, no corner LEDs, that's why i thought this code change would fit my enviroment :-)

// The number of LEDs connected before the start of the matrix.
#define NEOPIXEL_SIGNALS 0

The default was 4, assuming for the 4 corner LEDs?

So does that mean the value "0" in this parameter does not work with the current version of the software?

Solved it by removing "switch (leftover)" in Clockface.cpp :-)