Open PaulSturbo opened 1 year ago
I can confirm that the issue arises when the high byte of the first word is 0x04.
I charged the battery to over 12.8 volts, 1280/0x500 in the CAN string and the numbers were correct.
Not sure if anyone listening but update:
Data on the bus is corrupted if the value of the first byte in the string is 8 bits long. All other bytes in the string are shifted by 1 bit.
Tried everything in my power to sort this out, hardware and software, changing physical components and umpteen software changes.
Going to ditch ESPHome if I can't get some help.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
The problem
Using ESP32dev and MCP2515 with logic level shifting. All working OK. Also ESP8266 & MCP2515 used to monitor CAN messages.
Getting serial feed from Victron Smart Shunt for battery monitoring. All values reported correctly in HA and ESP_LOGD messages.
Test rig running a 12v battery.
CAN data values for battery volts and amps monitored on the CAN bus are incorrect at 12.5volts, they are doubled to give 25v. If I multiply the values by 4, 50v, then the values are exactly 4 times what they should be.
If I reverse the high and low bytes the values are correct at 12.5v, but that would give the wrong values at the recieving end,
As this is due to be used on a 48v system, they should be correct for the intended use,
Which version of ESPHome has the issue?
2023.2.4
What type of installation are you using?
Home Assistant Add-on
Which version of Home Assistant has the issue?
2023.2.5
What platform are you using?
ESP32
Board
Nodemcu
Component causing the issue
Can
Example YAML snippet
Anything in the logs that might be useful for us?
Relevant part of the ouput log: [17:06:59][D][canbus:033]: send extended id=0x355 rtr=FALSE size=4 [17:06:59][D][custom:088]: bv = 1242 [17:06:59][D][custom:088]: bv_low = 218 [17:06:59][D][custom:088]: bv_high = 4 [17:06:59][D][canbus:033]: send extended id=0x356 rtr=FALSE size=6
Output from the ESP8266 monitor: [17:09:24][D][canbus:069]: received can message (#1) std can_id=0x355 size=4 [17:09:24][D][custom:051]: can id 0x355 recieved 5D.00.64.00 [17:09:24][D][canbus:069]: received can message (#1) std can_id=0x356 size=6 [17:09:24][D][custom:056]: can id 0x356 recieved B4.09.FF.FE.28.00 (6) [17:09:25][D][canbus:069]: received can message (#1) std can_id=0x355 size=4
Message 0x355 is correct. Message 0x356: High and low bytes are reversed, Values are doubled.
Additional information
Values are correct if battery voltage (bv) value halved or quadrupled. Tests at various settings showed it could be when the bv_high value is 0x04.