Author Topic: Deye Hybrid Inverter RTC Problem  (Read 13943 times)

0 Members and 3 Guests are viewing this topic.

Offline rteodor

  • Frequent Contributor
  • **
  • Posts: 480
  • Country: ro
Re: Deye Hybrid Inverter RTC Problem
« Reply #25 on: June 14, 2025, 05:16:55 pm »
Anyone knows what MCU is there ?
I just looked at GD32F407x and GD32F303x and both have internal RTC.
 

Online NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9741
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Deye Hybrid Inverter RTC Problem
« Reply #26 on: June 16, 2025, 12:27:10 am »
Might there be a chance that the flux has not been properly cleaned off causing some leakage that disturbs the oscillator?
Cryptocurrency has taught me to love math and at the same time be baffled by it.
Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
BTC: 18813fu8LQEdDwH9YLM1ABed3XwCfeSeFi
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 42004
  • Country: au
    • EEVblog
Re: Deye Hybrid Inverter RTC Problem
« Reply #27 on: June 16, 2025, 05:23:17 am »
Might there be a chance that the flux has not been properly cleaned off causing some leakage that disturbs the oscillator?

RC oscillators are internal to the chip.
 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 9041
  • Country: ca
Re: Deye Hybrid Inverter RTC Problem
« Reply #28 on: June 16, 2025, 09:33:16 pm »
An RTC can lose time if it is not read properly, cheaper ones are not double-buffered, some have a busy flag or hoops to jump when doing a read etc. so the counters fall behind if you are reading the RTC in a constant barrage or doing it wrong. They are slow, simple state machines.
An RTC can run fast due to poor PCB layout with high speed traces near the xtal oscillator traces, you get extra clock counts. Or EMI from the inverter loose wiring, ungrounded xtal case etc.
One check is with the inverter powered off, how the RTC does running off just battery for say a day.
 

Offline thm_w

  • Super Contributor
  • ***
  • Posts: 9705
  • Country: ca
  • Non-expert
Re: Deye Hybrid Inverter RTC Problem
« Reply #29 on: June 16, 2025, 11:23:44 pm »
That is conformal coating, not flux, though its kind of nonsensically applied. Normally you'd cover all fine pitch pins.

Teardown part numbers:
- GD32F427
- DS1302Z

Assuming this "Deye SUN-5K-SG04LP1 5kW" is the same as Daves unit.

The spec for the GD32 with RTC on is less than 10uA, so that would last 2.5+ years on the shelf, maybe that wasn't enough for them, or they couldn't get that number, or didn't want to bother and put the RTC IC in.

I don't see any issues with the layout.
Profile -> Modify profile -> Look and Layout ->  Don't show users' signatures
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 42004
  • Country: au
    • EEVblog
Re: Deye Hybrid Inverter RTC Problem
« Reply #30 on: June 16, 2025, 11:42:03 pm »
Assuming this "Deye SUN-5K-SG04LP1 5kW" is the same as Daves unit.
The spec for the GD32 with RTC on is less than 10uA, so that would last 2.5+ years on the shelf, maybe that wasn't enough for them, or they couldn't get that number, or didn't want to bother and put the RTC IC in.
I don't see any issues with the layout.

Mine is the same unit, just like the extreme teardown here:


But Deye have hinted that there is a new design board. So maybe I've got an old design that uses RC timer.
It would be really hard to goof up the design of a proper RTC chip like that. The only way would be in the implementation, e.g. you read the time out once on boot-up and then rely on an internal CPU timer or whatever from that point on.
I guess I could test that by entirely powering off the unit at night and then switching it back on. And if the time comes back correct then they have goofed it as described.
I do actually have that spare board form that teardown, but it's practically impossible to replace, as you have to gut the entire unit to get to it.
So even if they sent me new board, I really wouldn't be able to replace it.
 
The following users thanked this post: thm_w

Offline Peabody

  • Super Contributor
  • ***
  • Posts: 2743
  • Country: us
Re: Deye Hybrid Inverter RTC Problem
« Reply #31 on: June 17, 2025, 03:36:33 am »
The DS1302 has twin 6pf crystal load capacitors built in.  If there are also external load capacitors, as it appears is the case, perhaps that's slowing things down.

 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 42004
  • Country: au
    • EEVblog
Re: Deye Hybrid Inverter RTC Problem
« Reply #32 on: June 17, 2025, 03:59:51 am »
The DS1302 has twin 6pf crystal load capacitors built in.  If there are also external load capacitors, as it appears is the case, perhaps that's slowing things down.

Possible. But not something I can easily test.
 

Online kripton2035

  • Super Contributor
  • ***
  • Posts: 2893
  • Country: fr
    • kripton2035 schematics repository
Re: Deye Hybrid Inverter RTC Problem
« Reply #33 on: June 17, 2025, 06:07:52 am »
Quote
So even if they sent me new board, I really wouldn't be able to replace it.
so the solution I gave you earlier to sent the time from ntp using the inverter serial port make sense...
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4529
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: Deye Hybrid Inverter RTC Problem
« Reply #34 on: June 17, 2025, 06:37:22 am »
What I wanted to say: if the problem would be internal firmware (actual software) it would drift with the same rate for all users, most likely.
Probably they wanted to save on MCU pins and/or XTAL and used an internal RC oscillator. If I am right it then the new board should have some extra XTAL and maybe a slightly different MCU.
ATmega's for example have for the internal RC oscillator, a factory calibration accuracy +/-10% and user calibration accuracy +/-1%. In the latter case it would mean a drift up to +/-864 seconds/day.

Yes, that's what I'm seeing, something like 600 seconds per day.
Can it even measure mains frequency within the required 10 mHz if it's off this much?
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 42004
  • Country: au
    • EEVblog
Re: Deye Hybrid Inverter RTC Problem
« Reply #35 on: June 17, 2025, 06:39:54 am »
Quote
So even if they sent me new board, I really wouldn't be able to replace it.
so the solution I gave you earlier to sent the time from ntp using the inverter serial port make sense...

The problem is that Solar Assistant does not allow this, and it currently uses the serial port.
 

Online kripton2035

  • Super Contributor
  • ***
  • Posts: 2893
  • Country: fr
    • kripton2035 schematics repository
Re: Deye Hybrid Inverter RTC Problem
« Reply #36 on: June 17, 2025, 10:09:35 am »
there may also be a rs485 port, or a can port that can be used ?
 

Offline rteodor

  • Frequent Contributor
  • **
  • Posts: 480
  • Country: ro
Re: Deye Hybrid Inverter RTC Problem
« Reply #37 on: June 17, 2025, 10:37:03 am »
Quote
So even if they sent me new board, I really wouldn't be able to replace it.
so the solution I gave you earlier to sent the time from ntp using the inverter serial port make sense...

The problem is that Solar Assistant does not allow this, and it currently uses the serial port.

It should not be a big hassle to the SA guys to implement a simple command (except if they did but the command is botched as with the RTC).
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 12537
  • Country: nz
Re: Deye Hybrid Inverter RTC Problem
« Reply #38 on: June 17, 2025, 10:10:23 pm »
Can you give Home Assistant access to the device, maybe in conjunction with an ESPHome using UART output mode, Edit: or modbus if it's one of those ones.
Then script HA/ESPHome to login once an hour/day and set the time correctly.

You'd probably have to use lambdas in ESPHome if you need some intelligent back and forward uart comms.
Would be easier to setup if you can simply send some command to the Deye blind.
Might be easier to pass the UART from ESPhome directly into HA and do the logic in HA, but i've never done that myself

I've setup UART stuff on HA with ESPHome before, i use it to turn my projector on/off over RS485 so i know it works.
It's really down to how complex the UART protocol is, and how complex the ESPhome script becomes, but should be possible .

https://esphome.io/components/uart.html
« Last Edit: June 17, 2025, 10:43:17 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 42004
  • Country: au
    • EEVblog
Re: Deye Hybrid Inverter RTC Problem
« Reply #39 on: June 17, 2025, 11:44:25 pm »
there may also be a rs485 port, or a can port that can be used ?

Yes, I have ordered an RS485 cable to connect to the Solar Assistant, freeing up the RS232 for the Wifi thingo, but I can't find that  :palm:
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 42004
  • Country: au
    • EEVblog
Re: Deye Hybrid Inverter RTC Problem
« Reply #40 on: June 19, 2025, 11:45:50 pm »
Deye have now offered to replace the entire inverter for me.
I'm actually not sure if this is worth it, as there is significant effort in physically replacing it, AND they want me to return the old unit.
And I might be getting a battery upgrade this year under the new government rebate scheme, and AERL have offered a their new 10kW inverter (no details yet though) to replace the 5kW Deye. So if that goes ahead, seems like a waste of time to replace to the Deye?
PLus I haven't tried the RS465 cable and Wifi dongle yet (still can't find it though).
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 42004
  • Country: au
    • EEVblog
Re: Deye Hybrid Inverter RTC Problem
« Reply #41 on: June 23, 2025, 03:29:33 am »
 

Offline Tooms

  • Supporter
  • ****
  • Posts: 105
  • Country: dk
Re: Deye Hybrid Inverter RTC Problem
« Reply #42 on: June 23, 2025, 04:15:59 am »

so what the serial command for setting the time
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 42004
  • Country: au
    • EEVblog
Re: Deye Hybrid Inverter RTC Problem
« Reply #43 on: June 23, 2025, 05:12:53 am »
so what the serial command for setting the time

Solar Assistant cannot do it, so  :-//
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 12537
  • Country: nz
Re: Deye Hybrid Inverter RTC Problem
« Reply #44 on: June 23, 2025, 07:23:24 am »
I asked Grok, Google AI and ChatGPT about commands to set the clock on deye inverters over rs232.
Pretty sure Google AI and ChatGPT and just making shit up, but you never know. Probably just giving RS232 command formats similar to other devices it has been trained on.

Grok was the best. Bit too long to post what it said here, but Grok at least did admitted that there isn't much info available.
Grok did find a reference to Deye modbus and time command registers on a diysolarforum.com forum post here.
https://diysolarforum.com/threads/deye-inverter-modbus-time-information.76195/
So that is interesting.

Google AI
Quote
To set the clock on a Deye inverter via RS232, you need to send a specific command string to the inverter. The command format is typically: ##0101YYYYMMDDhhmmSS# where: ## is the header, 0101 is the command code for time setting, YYYY is the year, MM is the month, DD is the day, hh is the hour, mm is the minute, SS is the second, and # is the terminator. For example, to set the time to June 23, 2025, 10:30:00, the command would be ##010120250623103000#.
Here's a more detailed breakdown:
Command Header: ## - This signifies the beginning of a command.
Command Code: 0101 - This specific code is for setting the real-time clock.
Year: YYYY - The current year (e.g., 2025).
Month: MM - The current month (e.g., 06 for June).
Day: DD - The current day (e.g., 23).
Hour: hh - The current hour in 24-hour format (e.g., 10 for 10 AM).
Minute: mm - The current minute (e.g., 30).
Second: SS - The current second (e.g., 00).
Terminator: # - This signifies the end of the command.
Example:
To set the clock to June 23, 2025, 10:30:00, the full command would be:
##010120250623103000#
You would then send this command string to the inverter through the RS232 interface.


ChatGPT
Quote
^P[command][parameters][CRC][CR]
^P — Command prefix
[command] — The specific instruction (e.g., RTC set command)
[parameters] — Values like time and date
[CRC] — Checksum (for data integrity)
[CR] — Carriage return
The exact command for setting the RTC is model-dependent, but in many Deye inverters, you may need to:
Send a command like ^P004 or similar (this is hypothetical; actual codes depend on model docs)
Include date and time in YYMMDDhhmmss format
Append checksum
Send via RS232 at the correct baud rate (usually 9600 or 115200 bps)
example
^P004250623143000XYZ\r
Where:
250623143000 → 25 June 2023, 14:30:00
XYZ → CRC checksum (needs to be calculated)
\r → Carriage return (hex 0x0D)
You must compute the checksum per Deye’s protocol (often a simple XOR or sum of bytes modulo 256).


« Last Edit: June 23, 2025, 07:44:48 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 
The following users thanked this post: EEVblog

Online kripton2035

  • Super Contributor
  • ***
  • Posts: 2893
  • Country: fr
    • kripton2035 schematics repository
Re: Deye Hybrid Inverter RTC Problem
« Reply #45 on: June 23, 2025, 10:17:30 am »
my wks inverter uses the "max protocol" that many inverter seems to use.
I attached the pdf of it , don't know for the deye but this protocol seems ok among many inverters.


EDIT: seems the deye uses a complete different protocol !
found this : https://fr.scribd.com/document/838419980/MODBUS-RTU-DEYE

« Last Edit: June 23, 2025, 10:24:35 am by kripton2035 »
 
The following users thanked this post: EEVblog

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 11043
  • Country: fi
Re: Deye Hybrid Inverter RTC Problem
« Reply #46 on: June 23, 2025, 10:58:05 am »
Maybe modbus registers 62-64?
 
The following users thanked this post: EEVblog

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 42004
  • Country: au
    • EEVblog
Re: Deye Hybrid Inverter RTC Problem
« Reply #47 on: June 23, 2025, 12:11:57 pm »
Maybe modbus registers 62-64?

Thanks.
I've ordered an RS485 lead, so worth trying. Maybe the Raspberry Pi can run a script every hour to update the time and date.
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 42004
  • Country: au
    • EEVblog
Re: Deye Hybrid Inverter RTC Problem
« Reply #48 on: June 23, 2025, 12:13:52 pm »
I asked Grok, Google AI and ChatGPT about commands to set the clock on deye inverters over rs232.
Pretty sure Google AI and ChatGPT and just making shit up, but you never know. Probably just giving RS232 command formats similar to other devices it has been trained on.

Grok was the best. Bit too long to post what it said here, but Grok at least did admitted that there isn't much info available.

I got the same halucination when I used Grok for this, it also admitted it may not actually know.
I've had a couple of poeple tell me it's not possible, but who knows.
« Last Edit: June 23, 2025, 12:15:50 pm by EEVblog »
 

Online Psi

  • Super Contributor
  • ***
  • Posts: 12537
  • Country: nz
Re: Deye Hybrid Inverter RTC Problem
« Reply #49 on: June 23, 2025, 01:36:26 pm »
I think the trick will be finding the right way to write data to registers 62-64,  you'll probably be able to read them ok.
Greek letter 'Psi' (not Pounds per Square Inch)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf