Author Topic: ESP32 DCF77 Transmitter - Time Drifting  (Read 3243 times)

0 Members and 1 Guest are viewing this topic.

Offline MitiTopic starter

  • Super Contributor
  • ***
  • Posts: 1534
  • Country: ca
ESP32 DCF77 Transmitter - Time Drifting
« on: January 06, 2023, 01:40:10 am »
I made a DCF77 transmitter using this ESP32 board:
https://learn.adafruit.com/adafruit-huzzah32-esp32-feather/pinouts
The Arduino sketch is here:
https://github.com/SensorsIot/DCF77-Transmitter-for-ESP32/tree/master/DFC77_ESP32
First, I thought everything is well but being in the development phase, I kept resetting the ESP32 board. Once I left it running a longer time, I saw that the time on the clock was drifting. Even though it was apparently getting the time from the NTP every hour, the time wasn't correct but adding almost a minute every hour.
If I pressed the reset button, the time would be correct again.
I read somewhere that ESP32 has an internal RTC which drifts badly while in deep sleep, so I tried light sleep with no success.
I gave up looking for a SW solution and I decided to do a hardware reset every time it wakes up by connection a digital output to the reset input of the board.
That solved the time accuracy issue but then I found that the go to sleep time drifts now. It is set to wake up at about ten to the hour and go to sleep at the top of the hour. It wakes up always on time but going to slip is delayed more and more.. It is almost like it has two independent RTCs, one that gets the time from the NTP server and is used to wake up and send the DCF77 signal and another one that is set only once at power up and drifts a lot when the device is in sleep and is used to go to sleep.
Do you gurus have an explanation for this behavior?

Cheers,
Miti
« Last Edit: January 06, 2023, 01:42:17 am by Miti »
Fear does not stop death, it stops life.
 

Offline bidrohini

  • Regular Contributor
  • *
  • Posts: 201
  • Country: bd
Re: ESP32 DCF77 Transmitter - Time Drifting
« Reply #1 on: January 06, 2023, 01:19:12 pm »
You can check this regarding the ESP32  time drift issues: https://esp32.com/viewtopic.php?t=4941
 

Offline MitiTopic starter

  • Super Contributor
  • ***
  • Posts: 1534
  • Country: ca
Re: ESP32 DCF77 Transmitter - Time Drifting
« Reply #2 on: January 07, 2023, 02:39:55 pm »
You can check this regarding the ESP32  time drift issues: https://esp32.com/viewtopic.php?t=4941

Yes, I read that, thanks. I don't think it applies to me.
Fear does not stop death, it stops life.
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 16266
  • Country: fr
Re: ESP32 DCF77 Transmitter - Time Drifting
« Reply #3 on: January 07, 2023, 08:38:02 pm »
Speaking of DCF77, I designed a clock with a DCF77 receiver years ago and it used to work absolutely fine.
But for about a few months now, it doesn't receive any usable DCF77 signal - much too noisy at almost any hour now. Same area.
Has anyone else noticed something similar?
 

Offline wek

  • Frequent Contributor
  • **
  • Posts: 560
  • Country: sk
Re: ESP32 DCF77 Transmitter - Time Drifting
« Reply #4 on: January 07, 2023, 09:54:03 pm »
> But for about a few months now, it doesn't receive any usable DCF77 signal - much too noisy at almost any hour now. Same area.

My place is around 650km from Frankfurt. A commercial clock which used to lock in reliably during any night, this year twice it displayed wrong hours correct minutes.

My parents live some 200km further away in a relatively undeveloped area, and my mum told me that this year it took a week for the DCF clock to adjust to winter time.

The switching revolution, yay!

JW
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 16266
  • Country: fr
Re: ESP32 DCF77 Transmitter - Time Drifting
« Reply #5 on: January 07, 2023, 09:55:31 pm »
> But for about a few months now, it doesn't receive any usable DCF77 signal - much too noisy at almost any hour now. Same area.

My place is around 650km from Frankfurt. A commercial clock which used to lock in reliably during any night, this year twice it displayed wrong hours correct minutes.

My parents live some 200km further away in a relatively undeveloped area, and my mum told me that this year it took a week for the DCF clock to adjust to winter time.

The switching revolution, yay!

JW

Any idea what's the cause? A change in the transmission power of the DCF77 signal, or just the EM noise that has grown exponentially everywhere?
 

Offline MitiTopic starter

  • Super Contributor
  • ***
  • Posts: 1534
  • Country: ca
Re: ESP32 DCF77 Transmitter - Time Drifting
« Reply #6 on: January 07, 2023, 11:43:25 pm »
Any idea what's the cause? A change in the transmission power of the DCF77 signal, or just the EM noise that has grown exponentially everywhere?

Try now. I turned off my basement transmitter.
Fear does not stop death, it stops life.
 
The following users thanked this post: wek

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 16266
  • Country: fr
Re: ESP32 DCF77 Transmitter - Time Drifting
« Reply #7 on: January 07, 2023, 11:50:51 pm »
Any idea what's the cause? A change in the transmission power of the DCF77 signal, or just the EM noise that has grown exponentially everywhere?

Try now. I turned off my basement transmitter.

Lol. The fun part is that my clock actually just synced to DCF77. It hadn't in weeks.
 

Offline MitiTopic starter

  • Super Contributor
  • ***
  • Posts: 1534
  • Country: ca
Re: ESP32 DCF77 Transmitter - Time Drifting
« Reply #8 on: January 08, 2023, 12:02:20 am »
Any idea what's the cause? A change in the transmission power of the DCF77 signal, or just the EM noise that has grown exponentially everywhere?

Try now. I turned off my basement transmitter.

Lol. The fun part is that my clock actually just synced to DCF77. It hadn't in weeks.

  :-DD :-DD :-DD
Fear does not stop death, it stops life.
 

Offline jav

  • Contributor
  • Posts: 37
Re: ESP32 DCF77 Transmitter - Time Drifting
« Reply #9 on: January 08, 2023, 12:53:13 pm »
My place is around 650km from Frankfurt. A commercial clock which used to lock in reliably during any night, this year twice it displayed wrong hours correct minutes.

My parents live some 200km further away in a relatively undeveloped area, and my mum told me that this year it took a week for the DCF clock to adjust to winter time.
I'm 1400 km away from Frankfurt, and I need a clear night and an outside view for the clocks to sync.

I ended up building a transmitter out of a Raspberry Pi, so they're always in sync, and I can even include full local weather forecast in the signal. NTP syncs perfectly, and as the transmitter is using DMA, CPU load is negligible.
 

Offline PinheadBE

  • Regular Contributor
  • *
  • Posts: 206
  • Country: be
  • Pinball Freak
Re: ESP32 DCF77 Transmitter - Time Drifting
« Reply #10 on: January 10, 2023, 11:26:34 am »
For several months now, I also have a commercial clock never getting synchronized again.
I checked the presence of a typical DCF77 signal on the input pin of the µC, and it seems to be present.
Weird.....
Please keep our planet clean
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 16266
  • Country: fr
Re: ESP32 DCF77 Transmitter - Time Drifting
« Reply #11 on: January 10, 2023, 06:52:48 pm »
For several months now, I also have a commercial clock never getting synchronized again.
I checked the presence of a typical DCF77 signal on the input pin of the µC, and it seems to be present.
Weird.....

It's not that weird. DCF77 is very easily perturbed by noise.
And since transmission is very slow (1 bit per second) and a full frame spans over 60 s, the probability of getting a correct frame if your conditions are not ideal is pretty low.
Bad decoders will give you an erroneous time/date. Good ones will just not sync.

Many of us seem to have noticed a relatively recent degradation though, and as I haven't heard of any change for the transmitter, it's most likely due to an increase of environmental EMI.
To pinpoint exactly the source(s) of this EMI, you'd need to investigate with proper equipment. But nobody seems to care.
 

Offline 0xFFF0

  • Regular Contributor
  • *
  • Posts: 105
  • Country: de
Re: ESP32 DCF77 Transmitter - Time Drifting
« Reply #12 on: April 04, 2023, 07:48:58 pm »
you can check the status here:
https://dcf77logs.de/live

« Last Edit: April 10, 2023, 11:51:09 am by 0xFFF0 »
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 16266
  • Country: fr
Re: ESP32 DCF77 Transmitter - Time Drifting
« Reply #13 on: April 04, 2023, 07:54:54 pm »
I can confirm DCF77 reception has become absolutely atrocious especially in urban areas.
In my case it is currently absolutely unusable (can take several weeks to be able to sync just once), while it was still fine a couple years ago, same area (would sync at least once a day or more).
I know it has nothing to do with the emitter itself. Probably local interference that has gotten out of control.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf