Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New inverter protocol: Sungrow CAN #552

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

dalathegreat
Copy link
Owner

@dalathegreat dalathegreat commented Oct 21, 2024

What

This PR implements Sungrow CAN, which emulates a Sungrow SBR064 battery

Why

To increase compatibility with more inverters

How

Massive thanks to Chair_Stealer for the CAN logs, and to mathl® for the reverse engineering! 🙌

@dalathegreat dalathegreat marked this pull request as ready for review October 22, 2024 16:42
@itsallanetwork
Copy link

Please! Im dying to impliment this new Sungrow CAN! 👍

itsallanetwork
itsallanetwork approved these changes Nov 6, 2024
@dalathegreat
Copy link
Owner Author

dalathegreat commented Nov 8, 2024

Hi @itsallanetwork
We wont merge this until it has been tested. Feel free to give it a go if you want!

https://github.com/dalathegreat/Battery-Emulator/archive/refs/heads/feature/sungrow-can.zip

@dalathegreat
Copy link
Owner Author

@sm133 Your inverter supports BYD CAN. We can stop discussing anything in this PR related to your troubleshooting, since you will not be able to use Sungrow CAN.

Please make a new Issue for troubleshooting your install: https://github.com/dalathegreat/Battery-Emulator/issues

I will be deleting all comments from here, since this PR focuses on integrating Sungrow CAN, not on troubleshooting your BYD_CAN install.

Repository owner deleted a comment from sm133 Nov 22, 2024
Repository owner deleted a comment from sm133 Nov 22, 2024
Repository owner deleted a comment from sm133 Nov 22, 2024
Repository owner deleted a comment from sm133 Nov 22, 2024
Repository owner deleted a comment from sm133 Nov 22, 2024
Repository owner deleted a comment from sm133 Nov 22, 2024
@itsallanetwork
Copy link

itsallanetwork commented Dec 9, 2024

Hi @dalathegreat,

I am happy to test this now I have my hardware in place. I am running a Tesla M3 82kwh Battery (penhouse fully intact) with Sungrow SH5.0RS Inverter. I have 10a fuse for capacitor (outside penthouse) and 32a for pos and neg from HV to Inverter.

Battery contacters are proven to work. I have not attempted connecting Inverter yet, but I am ready to do so.

I have setup a single Lilygo, but I read sungrow and leaf battery do not work well together given sungrow's 'bug'. I am not sure if this would be applicable given the M3 Tesla battery has a penthouse that is the brains for the battery, I would think the penthouse would protect the battery anyhow. Though of course I can install a CAN-FD MCP2518 board.

What do you recommend for this test?

@itsallanetwork
Copy link

itsallanetwork commented Dec 13, 2024

I have tried MCP2518 board, reverted to Dual lillygo, thinking it may be the board (I had 2 lillygo's on hand). Connection to the 2021 Model 3 (M3) Tesla battery is perfect in everyway, I am having troulbe connecting to the Sungrow SH5.0RS inverter.

Tesla Battery Situation:
On software 7.9 or 7.6 (dev for Sungrow):
I have logged comms over R364 to the other lilygo and I am seeing the battery data come over accurately.
I can use all of the buttons on the webserver and all function correctly.
Battery lilygo LED is GREEN
No issues.

Sungrow SH5.0RS situation:
Inverter on OLDER Software:
Module Name Module Current Version
SDSP SUNSTONE-H_04011.02.03
MDSP SUNSTONE-H_03011.02.33
LCD SUNSTONE-H_01011.02.44
AFCI AFCI_06002.01.10

Sungrow changed their Support for BYD on June 2024. I am not sure if this effects the inverter's reporting to the Cloud software (isolarcloud.com). I very much doubt it, but it cant be ruled out.

Inverter Lillygo (IL) is seeing Battery Data from Tesla Battery and reading it correctly.
All voltages are good on the IL,
IL definitely sends CAN messages (I can see them on 7.9).
IL is not receieving any CAN from Inverter

When Inverter Lilygo starts, in order, the LED:

  1. flashes green
  2. flashes red
  3. flashes green
  4. flashes red and stays red with FAULT below:

FAULT Displayed in EVENTS:
CAN_TX_FAILURE
ERROR
12/10/2024, 9:41:48 PM
COUNT = 3
DATA = 0
ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!

Then serial output:
22:55:11.102 -> CAN failure! Check wires
22:55:11.102 -> ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!
22:55:11.568 -> CAN failure! Check wires
22:55:11.568 -> ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!
22:55:12.068 -> CAN failure! Check wires
22:55:12.068 -> ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!
22:55:12.590 -> CAN failure! Check wires
22:55:12.590 -> ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!
22:55:13.092 -> CAN failure! Check wires
22:55:13.092 -> ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!
22:55:13.568 -> CAN failure! Check wires
22:55:13.568 -> ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!
22:55:14.092 -> CAN failure! Check wires
22:55:14.092 -> ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!
22:55:14.608 -> CAN failure! Check wires
22:55:14.608 -> ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!
22:55:15.089 -> 60000 SerialDataLink-Receiver - NewData :33 Errors : 0
22:55:15.089 -> Values from battery:
22:55:15.089 -> SOC: 8610 SOH: 9900 Voltage: 3890 Current: -2 Capacity: 82000 Remain cap: 70600 Max discharge W: 60000 Max charge W: 0 BMS status: 4 Power: -70 Temp min: 250 Temp max: 255 Cell max: 4074 Cell min: 4068 LFP : 0 Battery Allows Contactor Closing: 1 Inverter Allows Contactor Closing: 1
22:55:15.089 -> CAN failure! Check wires
22:55:15.089 -> ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!
22:55:15.615 -> CAN failure! Check wires
22:55:15.615 -> ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!
22:55:16.089 -> CAN failure! Check wires
22:55:16.089 -> ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!
22:55:16.589 -> CAN failure! Check wires
22:55:16.589 -> ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!
22:55:17.132 -> CAN failure! Check wires
22:55:17.132 -> ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!
22:55:17.589 -> CAN failure! Check wires

@i have tried MCP2518 board, reverted to Dual lillygo, thinking it may be the board (I had 2 lillygo's on hand). Connection to the 2021 Model 3 (M3) Tesla battery is perfect in everyway, I am having troulbe connecting to the Sungrow SH5.0RS inverter.

Tesla Battery Situation:
On software 7.9 or 7.6 (dev for Sungrow):
I have logged comms over R364 to the other lilygo and I am seeing the battery data come over accurately.
I can use all of the buttons on the webserver and all function correctly.
Battery lilygo LED is GREEN
No issues.

Sungrow SH5.0RS situation:
Inverter on OLDER Software:
Module Name Module Current Version
SDSP SUNSTONE-H_04011.02.03
MDSP SUNSTONE-H_03011.02.33
LCD SUNSTONE-H_01011.02.44
AFCI AFCI_06002.01.10

Sungrow changed their Support for BYD on June 2024. I am not sure if this effects the inverter's reporting to the Cloud software (isolarcloud.com). I very much doubt it, but it cant be ruled out.

Inverter Lillygo (IL) is seeing Battery Data from Tesla Battery and reading it correctly.
All voltages are good on the IL,
IL definitely sends CAN messages (I can see them on 7.9).
IL is not receieving any CAN from Inverter

When Inverter Lilygo starts, in order, the LED:

  1. flashes green
  2. flashes red
  3. flashes green
  4. flashes red and stays red with FAULT below:

FAULT Displayed in EVENTS:
CAN_TX_FAILURE
ERROR
12/10/2024, 9:41:48 PM
COUNT = 3
DATA = 0
ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!

Then serial output:
22:55:11.102 -> CAN failure! Check wires
22:55:11.102 -> ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!
22:55:11.568 -> CAN failure! Check wires
22:55:11.568 -> ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!
22:55:12.068 -> CAN failure! Check wires
22:55:12.068 -> ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!
22:55:12.590 -> CAN failure! Check wires
22:55:12.590 -> ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!
22:55:13.092 -> CAN failure! Check wires
22:55:13.092 -> ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!
22:55:13.568 -> CAN failure! Check wires
22:55:13.568 -> ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!
22:55:14.092 -> CAN failure! Check wires
22:55:14.092 -> ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!
22:55:14.608 -> CAN failure! Check wires
22:55:14.608 -> ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!
22:55:15.089 -> 60000 SerialDataLink-Receiver - NewData :33 Errors : 0
22:55:15.089 -> Values from battery:
22:55:15.089 -> SOC: 8610 SOH: 9900 Voltage: 3890 Current: -2 Capacity: 82000 Remain cap: 70600 Max discharge W: 60000 Max charge W: 0 BMS status: 4 Power: -70 Temp min: 250 Temp max: 255 Cell max: 4074 Cell min: 4068 LFP : 0 Battery Allows Contactor Closing: 1 Inverter Allows Contactor Closing: 1
22:55:15.089 -> CAN failure! Check wires
22:55:15.089 -> ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!
22:55:15.615 -> CAN failure! Check wires
22:55:15.615 -> ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!
22:55:16.089 -> CAN failure! Check wires
22:55:16.089 -> ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!
22:55:16.589 -> CAN failure! Check wires
22:55:16.589 -> ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!
22:55:17.132 -> CAN failure! Check wires
22:55:17.132 -> ERROR: CAN messages failed to transmit, or no one on the bus to ACK the message!
22:55:17.589 -> CAN failure! Check wires

@dalathegreat - Any help would be great! @mathl79

@itsallanetwork
Copy link

Created 'íssues' to follow this here: #670

@@ -51,6 +51,7 @@
//#define SMA_TRIPOWER_CAN //Enable this line to emulate a "SMA Home Storage battery" over CAN bus
//#define SOFAR_CAN //Enable this line to emulate a "Sofar Energy Storage Inverter High Voltage BMS General Protocol (Extended Frame)" over CAN bus
//#define SOLAX_CAN //Enable this line to emulate a "SolaX Triple Power LFP" over CAN bus
//#define SUNGROW_CAN //Enable this line to emulate a "Sungrow SBR064" over CAN bus
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dalathegreat, please remember to also add this to the GitHub workflows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants