External Time Source -DS3231 need help

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
Dondolo
Normal user
Posts: 77
Joined: 03 Jul 2019, 06:56
Location: Germany

External Time Source -DS3231 need help

#1 Post by Dondolo » 18 Dec 2021, 08:42

Hi,
due to construction work we no longer have internet.

The idea is to make the time available with the IC2 DS3231.

I just have no idea how to set the system time with the DS3231.
ds3231.JPG
ds3231.JPG (20.45 KiB) Viewed 12522 times
ds3231IC2.JPG
ds3231IC2.JPG (26.96 KiB) Viewed 12522 times
Of course, you can do this via command:

Code: Select all

datetime, 2021-12-17.21: 13: 00
Is there a plugin e.g. No. 157

User avatar
Ath
Normal user
Posts: 3518
Joined: 10 Jun 2018, 12:06
Location: NL

Re: External Time Source -DS3231 need help

#2 Post by Ath » 18 Dec 2021, 09:47

That time source is available in the ESPEasy core, documentation is here: https://espeasy.readthedocs.io/en/lates ... l#advanced
It is intended to be used in an internet-limited situation, like yours.
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8754
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: External Time Source -DS3231 need help

#3 Post by TD-er » 18 Dec 2021, 10:37

Not just limited for use cases with limited or no internet, but also for logging + deep sleep setups.
I recently made a board for someone who needs to work as long as possible on a battery and WiFi reach is not guaranteed
So there is a GPS on board to get the time and turn off the GPS when a fix has been acquired. (thus also the time is set)
As soon as the time is set (either via the command mentioned or via NTP or GPS), it is stored in any present RTC chip.

At boot, the time is restored from the RTC chip.
The time source is also shown in the sysinfo page.

Dondolo
Normal user
Posts: 77
Joined: 03 Jul 2019, 06:56
Location: Germany

Re: External Time Source -DS3231 need help

#4 Post by Dondolo » 18 Dec 2021, 10:59

by Ath » 18 Dec 2021, 09:47
That time source is available in the ESPEasy core, documentation is here: https://espeasy.readthedocs.io/en/lates ... l#advanced
I saw the documentation too, but it didn't really help me.
I had to change the battery in the DS3231 chip and the following time is displayed when booting.




How can I tell the DS3231 chip the new/correct time?
Attachments
after Reboot.JPG
after Reboot.JPG (16.86 KiB) Viewed 12513 times

TD-er
Core team member
Posts: 8754
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: External Time Source -DS3231 need help

#5 Post by TD-er » 18 Dec 2021, 11:14

Just power cycle the board and if it does show a time which should match with the last seen time, then it is reading from the RTC chip and the chip is counting, powered from the coin cell.
Just set the time using NTP once, or use the datetime command

The command you gave was using a dot instead of a comma (and spaces)
See: https://espeasy.readthedocs.io/en/lates ... l-commands

Dondolo
Normal user
Posts: 77
Joined: 03 Jul 2019, 06:56
Location: Germany

Re: External Time Source -DS3231 need help

#6 Post by Dondolo » 18 Dec 2021, 12:08

Hi Td-er,
The command you gave was using a dot instead of a comma (and spaces)
See: https://espeasy.readthedocs.io/en/lates ... l-commands
that was a copy and past mistake.

Code: Select all

Datetime,2021-12-18,11:26:00
But it doesn't even work correctly spelled. After booting, 1970-01-01 is displayed again. With or without NTP.
after Reboot1.JPG
after Reboot1.JPG (16.86 KiB) Viewed 12509 times
I connected the chip to IC2 (D1 / D2),3V,GND. The chip has an additional pin header with SDA, SCl, 32K, SQW.
ds3132.JPG
ds3132.JPG (32.45 KiB) Viewed 12509 times
The following version is installed:
ESP_Easy_mega_20211005_normal_ESP8266_4M1M

User avatar
Ath
Normal user
Posts: 3518
Joined: 10 Jun 2018, 12:06
Location: NL

Re: External Time Source -DS3231 need help

#7 Post by Ath » 18 Dec 2021, 12:40

Datetime is an internal command, so you either set it from the Tools page or from a rule.
When setting it from the Tools page, does it show Ok as a result?
/Ton (PayPal.me)

Dondolo
Normal user
Posts: 77
Joined: 03 Jul 2019, 06:56
Location: Germany

Re: External Time Source -DS3231 need help

#8 Post by Dondolo » 18 Dec 2021, 12:51

Hi Td-er,

everything back it works, I idiot inserted the battery incorrectly; - ((sorry

Now I wanted to update the time on other ESPs via the http command.
Why does this command work, time and date are transferred.

Code: Select all

SendToHTTP 192.1xxx,80,"/control?cmd=event,UhrzeitDatum=%systime%,%lcltime%"
This only transmits the date.

Code: Select all

SendToHTTP 192.168xxxx,80,"/control?cmd=event,DatumUhrzeit=%lcltime%,%systime%"
datum.JPG
datum.JPG (22.8 KiB) Viewed 12505 times

TD-er
Core team member
Posts: 8754
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: External Time Source -DS3231 need help

#9 Post by TD-er » 18 Dec 2021, 13:50

I think you may need to wrap the arguments in quotes.
It seems like either one of them is seen as a formula and interpreted as such.

Does seem like a bug though, but I have no idea where.
Seems like the sendToHttp is perhaps parsing one step too often.

Code: Select all

SendToHTTP 192.168xxxx,80,"/control?cmd='event,DatumUhrzeit=%lcltime%,%systime%'"
Wrapped the event command in different quotes (single quote)

Dondolo
Normal user
Posts: 77
Joined: 03 Jul 2019, 06:56
Location: Germany

Re: External Time Source -DS3231 need help

#10 Post by Dondolo » 18 Dec 2021, 17:42

CODE: Select all

SendToHTTP 192.168xxxx,80,"/control?cmd='event,DatumUhrzeit=%lcltime%,%systime%'"

Wrapped the event command in different quotes (single quote)
Unfortunately, wrapping doesn't work.

ESP that sends

Code: Select all

SendToHTTP 192.xxx,80,"/control?cmd=event,Uhrzeit=%systime%"
SendToHTTP 192.xxx,80,"/control?cmd=event,Datum=%unixtime%"
SendToHTTP 192.xxx,80,"/control?cmd='event,DatumUhrzeit=%lcltime%,%systime%'"
logsend.JPG
logsend.JPG (34.24 KiB) Viewed 12495 times
ESp who receives
log1.JPG
log1.JPG (19.15 KiB) Viewed 12495 times
Is it possible to use the Unix time? The only thing I don't know is the conversion.

User avatar
Ath
Normal user
Posts: 3518
Joined: 10 Jun 2018, 12:06
Location: NL

Re: External Time Source -DS3231 need help

#11 Post by Ath » 18 Dec 2021, 19:14

The first quote in your SendToHTTP command seems to be a single quote, but the given example has a double quote there. That might change things.
/Ton (PayPal.me)

User avatar
Ath
Normal user
Posts: 3518
Joined: 10 Jun 2018, 12:06
Location: NL

Re: External Time Source -DS3231 need help

#12 Post by Ath » 18 Dec 2021, 19:22

Hmm, looks like the SendToHTTP command does mess up the quotes in some way.
Dondolo wrote: 18 Dec 2021, 17:42 ESP that sends

Code: Select all

SendToHTTP 192.xxx,80,"/control?cmd=event,Uhrzeit=%systime%"
SendToHTTP 192.xxx,80,"/control?cmd=event,Datum=%unixtime%"
SendToHTTP 192.xxx,80,"/control?cmd='event,DatumUhrzeit=%lcltime%,%systime%'"
You might want to use the date and time separate:

Code: Select all

SendToHTTP 192.xxx,80,"/control?cmd=event,Uhrzeit=%systime%"
SendToHTTP 192.xxx,80,"/control?cmd=event,Datum=%unixtime%"
SendToHTTP 192.xxx,80,"/control?cmd=event,DatumUhrzeit=%sysyear_0%-%sysmonth_0%-%sysday_0%,%systime%"
[/quote]
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8754
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: External Time Source -DS3231 need help

#13 Post by TD-er » 18 Dec 2021, 20:28

Code: Select all

SendToHTTP 192.xxx,80,"/control?cmd=event,DatumUhrzeit=%sysyear_0%-%sysmonth_0%-%sysday_0%,%systime%"
If this does work, then it is the space in %lcltime% that messes things up here.

For example:

Code: Select all

%lcltime% => "2021-12-18 20:25:29"
When sending a command, a space and a comma are both considered as a parameter separator.
However, as a separator of event values, only the comma is considered.

I think we also need a %sysdate%, or let the datetime command also accept a unixtime.

Dondolo
Normal user
Posts: 77
Joined: 03 Jul 2019, 06:56
Location: Germany

Re: External Time Source -DS3231 need help

#14 Post by Dondolo » 19 Dec 2021, 03:20

You might want to use the date and time separate:
CODE: Select all
SendToHTTP 192.xxx,80,"/control?cmd=event,Uhrzeit=%systime%"
SendToHTTP 192.xxx,80,"/control?cmd=event,Datum=%unixtime%"
SendToHTTP 192.xxx,80,"/control?cmd=event,DatumUhrzeit=%sysyear_0%-%sysmonth_0%-%sysday_0%,%systime%"
Yes, it works, the date and time are transferred correctly.
Send ESP
Send ESP
dreisenden.png (12.33 KiB) Viewed 12471 times
ESP received
ESP received
dreievent.JPG (24.66 KiB) Viewed 12471 times

Code: Select all

SendToHTTP 192.xxx,80,"/control?cmd=event,DatumUhrzeit=%sysyear_0%-%sysmonth_0%-%sysday_0%,%systime%"
SendToHTTP 192.xxx,80,"/control?cmd=event,Datum=%sysyear_0%-%sysmonth_0%-%sysday_0%"
SendToHTTP 192.xxx,80,"/control?cmd=event,Uhrzeit=%systime%"
If I then execute the datetime command with the% eventvalue%, the time is not written correctly.

Code: Select all

on DatumUhrzeit do
if %sysyear_0% <= 1970
Datetime,%eventvalue%
endif
endon
Attachments
uhrzeit.JPG
uhrzeit.JPG (16.13 KiB) Viewed 12471 times

Dondolo
Normal user
Posts: 77
Joined: 03 Jul 2019, 06:56
Location: Germany

Re: External Time Source -DS3231 need help

#15 Post by Dondolo » 19 Dec 2021, 04:06

So everything is transmitted correctly and the receiver ESP can process it. Only the time is still an hour higher, maybe winter time or summer time?

Code: Select all

SendToHTTP 192.168.178.107,80,"/control?cmd=event,ClockDate=%sysyear_0%-%sysmonth_0%-%sysday_0%,%syshour_0%:%sysmin_0%:%syssec_0%"
send ESP
send ESP
send.JPG (11.13 KiB) Viewed 12469 times
ESP recieve
ESP recieve
receive.JPG (14.57 KiB) Viewed 12469 times
SysInfo
SysInfo
clockdate.JPG (14.59 KiB) Viewed 12469 times

User avatar
Ath
Normal user
Posts: 3518
Joined: 10 Jun 2018, 12:06
Location: NL

Re: External Time Source -DS3231 need help

#16 Post by Ath » 19 Dec 2021, 09:58

The sending command includes 2 arguments, one for the date and the second for the time.
As the datetime command expects 2 arguments, you will have to pass these separately:

Code: Select all

on DatumUhrzeit do
  if %sysyear_0% <= 1970
    Datetime,%eventvalue1%,%eventvalue2%
  endif
endon
NB: %eventvalue% is equivalent to %eventvalue1%.

The 1 hour diff is probably caused by the time-zone you're in, CET? Or DST setting (though we're not in DST, currently).
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8754
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: External Time Source -DS3231 need help

#17 Post by TD-er » 19 Dec 2021, 14:11

The time stored in the RTC clock is in Unixtime.
And I doubt it is converting back using the current timezone and DST.
Not sure if the default should be to interpret it as "wall time" or "local time".

Usually the time source is some unit that's outputting Unix time, like NTP or a GPS.

igorka
Normal user
Posts: 74
Joined: 17 Jul 2022, 13:41
Location: Ukraine

Re: External Time Source -DS3231 need help

#18 Post by igorka » 26 Oct 2022, 09:56

I ran into a problem, I can't configure the ESP to work with DS3231.
ESP-01S module (ESP_Easy_mega_20220616_normal_ESP8266_1M), RTC (HW-84) on a DS3231 chip.
In Tools/Time Source/External Time Source, I select DS3231.
External Time Source
External Time Source
3231.png (7.69 KiB) Viewed 6326 times
I go to the Scan for I2C devices tab, there are, as it should be, two addresses on the I2C line. AT24C32 - 0x057 and DS3231 - 0x68.
But the Supported devices column is empty!?
Scan for I2C devices
Scan for I2C devices
3231_1.png (13.09 KiB) Viewed 6326 times
In the Special and Experimental Settings/WD I2C Address, I set the address "104" (0x68).
Is it something I'm doing wrong, or do controllers with a small amount of memory (1M) not support this function?
Thanks!
Attachments
WD I2C Address, I set the address
WD I2C Address, I set the address
3231_2.png (33.23 KiB) Viewed 6326 times

User avatar
Ath
Normal user
Posts: 3518
Joined: 10 Jun 2018, 12:06
Location: NL

Re: External Time Source -DS3231 need help

#19 Post by Ath » 26 Oct 2022, 10:03

The Time Source and Watch Dog setting are in no way related, so please leave the WD setting at 0. It might unexpectedly reboot the unit.

Getting the Time Source to 'stick' (as in: actually use that Time Source) it expects the NTP setting to be off, and probably a few reboots.
/Ton (PayPal.me)

igorka
Normal user
Posts: 74
Joined: 17 Jul 2022, 13:41
Location: Ukraine

Re: External Time Source -DS3231 need help

#20 Post by igorka » 26 Oct 2022, 10:17

Ath wrote: 26 Oct 2022, 10:03 The Time Source and Watch Dog setting are in no way related, so please leave the WD setting at 0. It might unexpectedly reboot the unit.
Initially, I did not touch these settings, there was no difference. There is no DS3231 in Supported devices!

User avatar
Ath
Normal user
Posts: 3518
Joined: 10 Jun 2018, 12:06
Location: NL

Re: External Time Source -DS3231 need help

#21 Post by Ath » 26 Oct 2022, 10:34

The device names are removed in some builds (only available in Normal, Custom and Max, AFAIR) to save some .bin space. If the address is shown, a device is recognized, but unfortunately you can't see what (supported) device it is.

We have some plans to make that list external, but that's on low priority for now.
/Ton (PayPal.me)

igorka
Normal user
Posts: 74
Joined: 17 Jul 2022, 13:41
Location: Ukraine

Re: External Time Source -DS3231 need help

#22 Post by igorka » 26 Oct 2022, 10:44

Then the time synchronization from DS3231 should work correctly?Why doesn't it work for me?I ask for help, what settings do I need to make?Maybe I'm doing something wrong?

User avatar
Ath
Normal user
Posts: 3518
Joined: 10 Jun 2018, 12:06
Location: NL

Re: External Time Source -DS3231 need help

#23 Post by Ath » 26 Oct 2022, 10:52

You will need to set the date/time of the device correctly once it's configured, to have it stored: https://espeasy.readthedocs.io/en/lates ... l-commands
/Ton (PayPal.me)

TD-er
Core team member
Posts: 8754
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: External Time Source -DS3231 need help

#24 Post by TD-er » 26 Oct 2022, 12:08

Does your DS3231 have a battery?
If the device is present, and set to use it as an external time source, the time will be stored in the external RTC chip as soon as the time is set on the ESP.
For example via NTP or using the command described here: https://espeasy.readthedocs.io/en/lates ... l-commands
You can simply test the RTC functionality by setting the date to something in the past, like 1/1/2022 or something which is clearly different from the current time.
Just make sure NTP is off and set the time via the datetime (and a battery is present in the RTC module)
Then power cycle the ESP and you should see the set time appear as system time in ESPEasy. (+ some minutes/seconds later)
In very recent builds (not sure if already present in the latest official build) you should also see a reported time source, like GPS, RTC, ext.RTC, NTP.

igorka
Normal user
Posts: 74
Joined: 17 Jul 2022, 13:41
Location: Ukraine

Re: External Time Source -DS3231 need help

#25 Post by igorka » 26 Oct 2022, 12:18

Ath wrote: 26 Oct 2022, 10:52 You will need to set the date/time
Tools/Command Datetime,2022-10-26,12:03:00, Command Output OK.
System Info
System Info
3231_5.png (10.61 KiB) Viewed 6305 times
After restarting the ESP, the time is lost:
System Info
System Info
3331_3.png (10.91 KiB) Viewed 6305 times
Time Source
Time Source
3231_4.png (7.3 KiB) Viewed 6305 times
The battery in the module is new, the voltage is 3V33, the voltage on the legs DS3231 is also normal, external power is also ok...
I conclude that my DS3231 module is faulty or defective.Unfortunately, I don't have an oscilloscope right now and I can't see if there is a signal on the 32 kHz pin.

igorka
Normal user
Posts: 74
Joined: 17 Jul 2022, 13:41
Location: Ukraine

Re: External Time Source -DS3231 need help

#26 Post by igorka » 26 Oct 2022, 13:36

Could this problem be caused by the fact that I assigned GPIO1 to SDA(TX) and GPIO3 to SCL(RX)? Of course, in the Serial Settings, I removed the check mark from Enable Serial port, but maybe the module sends data to the Serial Port when loading, and therefore I'm not loading from the RTC module?
Changed SDA to GPIO2, no changes.Probably DS3231 is working (or partially working), because the scanner detects the address 0x68 i2c.
iog
iog
rtc.png (12.68 KiB) Viewed 6283 times
Ath wrote: 26 Oct 2022, 10:34 The device names are removed in some builds (only available in Normal, Custom and Max, AFAIR)
ESP_Easy_mega_20220616_normal_ESP8266_1M.

User avatar
Ath
Normal user
Posts: 3518
Joined: 10 Jun 2018, 12:06
Location: NL

Re: External Time Source -DS3231 need help

#27 Post by Ath » 26 Oct 2022, 16:40

igorka wrote: 26 Oct 2022, 13:36
Ath wrote: 26 Oct 2022, 10:34 The device names are removed in some builds (only available in Normal, Custom and Max, AFAIR)
ESP_Easy_mega_20220616_normal_ESP8266_1M.
Also excluded from 1M builds, didn't mention that, sorry :o
/Ton (PayPal.me)

igorka
Normal user
Posts: 74
Joined: 17 Jul 2022, 13:41
Location: Ukraine

Re: External Time Source -DS3231 need help

#28 Post by igorka » 26 Oct 2022, 17:28

I tried all pin combinations to connect i2c.When scanning the bus, it sees addresses, but it does not work to connect for time synchronization.Writes an error in the log as in the photo above.Maybe I should fill in another firmware for testing, and which one?

User avatar
Ath
Normal user
Posts: 3518
Joined: 10 Jun 2018, 12:06
Location: NL

Re: External Time Source -DS3231 need help

#29 Post by Ath » 26 Oct 2022, 17:50

Can you try that RTC on an ESP with more GPIOs, like a Wemos D1 (mini) or NodeMcu clone, to see if it actually works as intended? Also as the time-source? It's still possible the RTC is not working correctly.
/Ton (PayPal.me)

igorka
Normal user
Posts: 74
Joined: 17 Jul 2022, 13:41
Location: Ukraine

Re: External Time Source -DS3231 need help

#30 Post by igorka » 26 Oct 2022, 18:46

No, unfortunately, in the near future, I will not have such an opportunity.But I will definitely try to do it.
Thanks!

TD-er
Core team member
Posts: 8754
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: External Time Source -DS3231 need help

#31 Post by TD-er » 30 Oct 2022, 12:27

Just a quick update... I am currently working on the RTC implementation.
Though I don't have a DS3231 at hand, but am using a PCF8563.
I think the problem is not in the low level handling code of these RTC chips, but perhaps at another level.

Will update as soon as I have a test build for you.

igorka
Normal user
Posts: 74
Joined: 17 Jul 2022, 13:41
Location: Ukraine

Re: External Time Source -DS3231 need help

#32 Post by igorka » 30 Oct 2022, 12:40

TD-er wrote: 30 Oct 2022, 12:27 Will update as soon as I have a test build for you.
Thanks! You are making a huge contribution to the development of ESP Easy.

TD-er
Core team member
Posts: 8754
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: External Time Source -DS3231 need help

#33 Post by TD-er » 30 Oct 2022, 13:18

When it has finished, can you check this test build: https://github.com/letscontrolit/ESPEas ... 3355411170

I also show the UTC time stored in the RTC chip on the tools->Advanced page and on the sysinfo page.
This can be useful for debugging.

igorka
Normal user
Posts: 74
Joined: 17 Jul 2022, 13:41
Location: Ukraine

Re: External Time Source -DS3231 need help

#34 Post by igorka » 30 Oct 2022, 13:37

TD-er wrote: 30 Oct 2022, 13:18 When it has finished, can you check this test build: https://github.com/letscontrolit/ESPEas ... 3355411170
Of course I can.I have just one esp-01s board that is idle, for experiments.I'll try it during the next week, will it suit you?

TD-er
Core team member
Posts: 8754
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: External Time Source -DS3231 need help

#35 Post by TD-er » 30 Oct 2022, 13:43

Sure, whenever you're ready for it.
However, maybe there may have been newer commits added to it, so please check the Actions tab on GitHub for newer builds.
This is the related pull request: https://github.com/letscontrolit/ESPEasy/pull/4323

igorka
Normal user
Posts: 74
Joined: 17 Jul 2022, 13:41
Location: Ukraine

Re: External Time Source -DS3231 need help

#36 Post by igorka » 31 Oct 2022, 14:54

I guess I'm too stupid.I can't figure out how to download the firmware file :cry:.If it's not difficult for you, give a direct link to the file for the ESP-01S board (ESP_Easy_mega_XXXXXX_ESP8266_1M.bin).

TD-er
Core team member
Posts: 8754
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: External Time Source -DS3231 need help

#37 Post by TD-er » 31 Oct 2022, 15:15

Just any 1M build?

igorka
Normal user
Posts: 74
Joined: 17 Jul 2022, 13:41
Location: Ukraine

Re: External Time Source -DS3231 need help

#38 Post by igorka » 31 Oct 2022, 15:24

TD-er wrote: 31 Oct 2022, 15:15 Just any 1M build?
mega_ESP8266_1M.bin
Can you explain in private messages how to download from github?

TD-er
Core team member
Posts: 8754
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: External Time Source -DS3231 need help

#39 Post by TD-er » 31 Oct 2022, 15:24

Can you try this one?
https://www.dropbox.com/s/0u2nrnk4u26mr ... M.bin?dl=0
I just built it using the latest code changes I made less than an hour ago, regarding how the time is being dealt with in ESPEasy.

N.B. the "normal" 1M build was too big and thus doesn't fit. Have to look into that one too.

igorka
Normal user
Posts: 74
Joined: 17 Jul 2022, 13:41
Location: Ukraine

Re: External Time Source -DS3231 need help

#40 Post by igorka » 31 Oct 2022, 19:17

Unfortunately, the result is negative.Similarly, when scanning the I2C bus, two addresses 0x57 and 0x68 (DS3231) are read.I set the system time with the Datetime command,2020-10-10,10:00:00, it is worth turning off the power and turning it on again, the time is not read from the RTC, ExtRTC: Cannot get time from external time source.
The connection was made like this:
GPIOO.0 - SDA
GPIO.2 - SCL
and vice versa
GPIOO.0 - SCL
GPIO.2 - SDA
The I2C scanner sees the addresses on the bus and that's it.
I wanted to try on the TX, RX pins, but they are programmatically disabled in the firmware.

User avatar
Ath
Normal user
Posts: 3518
Joined: 10 Jun 2018, 12:06
Location: NL

Re: External Time Source -DS3231 need help

#41 Post by Ath » 31 Oct 2022, 19:31

igorka wrote: 31 Oct 2022, 19:17 I wanted to try on the TX, RX pins, but they are programmatically disabled in the firmware.
If you uncheck the "Enable Serial port" option on the Tools/Advanced page, you can use those pins.
/Ton (PayPal.me)

igorka
Normal user
Posts: 74
Joined: 17 Jul 2022, 13:41
Location: Ukraine

Re: External Time Source -DS3231 need help

#42 Post by igorka » 01 Nov 2022, 08:28

Ath wrote: 31 Oct 2022, 19:31 If you uncheck the "Enable Serial port" option on the Tools/Advanced page, you can use those pins.
Yes, yes, you're right.I did it earlier and wrote about it, this is my mistake :cry: .
TD-er wrote: 31 Oct 2022, 15:24 Можете ли вы попробовать это?
Unfortunately, this did not help, the RTC does not work, perhaps this problem is only with DS3231?Another thing I noticed in Client IP filtering settings are not saved!Also, after a few minutes of operation, the ESP module loses connection with wi-fi and freezes :roll:

TD-er
Core team member
Posts: 8754
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: External Time Source -DS3231 need help

#43 Post by TD-er » 01 Nov 2022, 12:56

Hmm sounds like there might be something seriously wrong with your setup.
For example a loose ground?
No pull-up resistors on the SDA/SCL lines?

igorka
Normal user
Posts: 74
Joined: 17 Jul 2022, 13:41
Location: Ukraine

Re: External Time Source -DS3231 need help

#44 Post by igorka » 01 Nov 2022, 13:19

TD-er wrote: 01 Nov 2022, 12:56 For example a loose ground?
No pull-up resistors on the SDA/SCL lines?
No, that's out of the question.Everything is on soldering, there is good contact everywhere.This is a photo of a mock-up for experiments.I specially assigned SDA and SCL to the RX, TX contacts so that external components on the ESP-01S board would not interfere.
P.S.Deleted a photo that won't clog up the forum topic...
Last edited by igorka on 01 Nov 2022, 13:45, edited 1 time in total.

TD-er
Core team member
Posts: 8754
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: External Time Source -DS3231 need help

#45 Post by TD-er » 01 Nov 2022, 13:29

I just checked my order history on Ali Express and I should have these DS3231 boards somewhere.
I will search through all my boxes later this evening to find them and then I will check if the code is (still) working on those units.

igorka
Normal user
Posts: 74
Joined: 17 Jul 2022, 13:41
Location: Ukraine

Re: External Time Source -DS3231 need help

#46 Post by igorka » 02 Nov 2022, 17:42

Sorry for the question. I wanted to know if you managed to start the DS3231 correctly?

TD-er
Core team member
Posts: 8754
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: External Time Source -DS3231 need help

#47 Post by TD-er » 02 Nov 2022, 19:02

I managed to find one... That's all I did with it right now.

igorka
Normal user
Posts: 74
Joined: 17 Jul 2022, 13:41
Location: Ukraine

Re: External Time Source -DS3231 need help

#48 Post by igorka » 06 Nov 2022, 10:51

In the photo, there is a signal from the output 32K of the DS3231 module.Based on this, I am more and more inclined that the problems are in the firmware or ESP-01S.
32kHz.png
32kHz.png (37.4 KiB) Viewed 5711 times
Do not pay attention that the signal is bipolar, the oscilloscope input is closed.I forgot to turn it off...

TD-er
Core team member
Posts: 8754
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: External Time Source -DS3231 need help

#49 Post by TD-er » 08 Nov 2022, 00:08

Finally came to testing the board and it does work just fine on my test setup.
2022-11-08 00_07_15-MAX ESP32.png
2022-11-08 00_07_15-MAX ESP32.png (9.08 KiB) Viewed 5615 times
Also tested with power cycle to be sure it wasn't set, tested to reboot and see what time source was reported.
And as can be seen on the screenshot, the tools->Advanced page does show what is stored inside the RTC module.

igorka
Normal user
Posts: 74
Joined: 17 Jul 2022, 13:41
Location: Ukraine

Re: External Time Source -DS3231 need help

#50 Post by igorka » 08 Nov 2022, 08:24

This is good news for anyone who uses ESP Easy, but bad news specifically for me. For reference, which ESP controller card are you using and which pins are connected to the I2C bus?

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 132 guests