Open brii999 opened 8 months ago
Hello @brii999, thanks for trying out DIYBMS.
The CAN controller chip I use on the controller is SN65HVD1050D https://www.ti.com/lit/ds/symlink/sn65hvd1050.pdf
This chip operates at 5 volt and doesn't use pin 5 - its not connected on the PCB.
If you are using the TJA1057GT/3 then pin 5 is expected to be "VIO" - you might be able to make your chip work by connecting pin 5 to +5V (a wire soldered between pin 3 and pin 5 should do it).
Alternatively, swap out that CAN chip for the recommended SN65HVD1050D
Thanks for reply. I tried with providing 5V supply for PIN5 of CAN controller with no luck. I ordered mentioned chip (SN65HVD1050D). When it arrives I'll solder it and provide update in this topic. Once again thanks for interesting in this problem.
I soldered the recommended chip but it didn't change anything... I understand that there is nothing smart that can be done except checking whether the PCB has all trace continuity?
Its a fairly simple circuit - first check that your ESP32 is the correct pin layout (devkitc footprint).
After that, check the connection to these two chips at U1 and U7. U1 is tiny, so easy to cause solder bridging.
Also check that your CANBUS A/B wires are correct. You can also try without a ground wire between controller and charger/inverter.
I have no TSX0102DCU chip - TXD and RXD of SN65HCD1050D goes stright to ESP32 board to pins: TXD (1) on SN65 to G16 on ESP32 (U2_RXD) RXD (4) on SN65 to G17 on ESP32 (U2_TXD) Revision of diyBMS V4.4 board is: c8f1403
If your PCB is this one, you should be able to use the TJA1057/3 chip by making sure JP5 is bridged to 5v. I've not used mine diyBMS boards for CAN but I do have extensive use of TJA1057/3 (and a few others) in the split voltage configuration without issues.
Also the error code 0x103 indicates that the TWAI/CAN driver is in an incorrect state for sending, this is usually due one of the following:
A very quick test for the third item, turn off all devices but leave the CAN bus connected on both ends. Set your multimeter to resistance testing and check for a 60Ohm resistance (roughly) between CAN-H and CAN-L. If you see 120Ohm then only one side is terminated and you might be able to fix this by soldering JP1. If you see a dead short between CAN-H and CAN-L check the soldering of the TJA1057/3 IC to make sure there isn't a stray bridge, you can see the traces are pretty much direct from U1 (TJA1057/3) through the center two pins on the right side (6 and 7) connecting to D8 (CAN TVS) and then to J7 CAN-H/CAN-L. CAN-H is on pin 7 of TJA1057/3 and is connected to R6 and D8 (top left) -> J7. CAN-L is routed to JP1 -> D8 (right side) -> J7.
Thanks for reply in this topic.
On JP5 default 5V is selected. I mesaure voltage between GND and center pad of JP5 and it is 5V. On powered off board I checked with multimeter continuity test that there is connection between left and center pad. Right pad (3,3V) is not connected with center pad. There is connection betweend center pad of JP5 and third pin of TJA1057 chip.
I used osciloscope to check if something is transfered from ESP32 to TJA1057 chip and to my suprise I see only flat line on 3,3V level. I tried triggering on different options and nothing changed, osciloscope dont detect any signal changes on ESP32 TX pin (GPIO17) connected to TJA 4 pin (RX)...
I have no idea whats can be wrong...
UPDATE:
I test it now on my desk - controller only without modules connected. Fresh after firmware upload I 'am going to "More" and select "Charge/Discharge configuration" then I chang "CANBUS protocol emulation" to "Victron Cerbo GX" and use "generic" for "Inverter brand/model" and 500k for "CANBUS baud rate". Field "Enable dynamic charge control" is enabled and after I click "Save" I have still situation like on begining of this topic. Is it enough to provoke diyBMS controller to send any data to CAN interface?
I have no TSX0102DCU chip - TXD and RXD of SN65HCD1050D goes stright to ESP32 board to pins:
Sorry, my mistake, if you have the older PCB board, then the TJA chip is the correct one to use.
A little udate: I took two controller boards and two ESP32, wrote small programs - one to send data over CAN, the other to receive. After connecting the controller boards, there is no communication.... After connecting the ESP32 directly without using the controller board, communication works.... Evidently the problem is in the controller board but I have no idea where to look further for the cause of the problem. All paths lead to the correct pins and have continuity. When choosing PylonTech instead of Victron, the errors are the same but at least I don't get a bootloop....
Just checking that the ESP32 you have is using the DEVKIT-C footprint? There are several different ESP32 footprint layouts and the pins would be incorrect if its not the DEVKIT-C one.
I used ESP32-WROOM-32D (ESP32_DevkitC_V4) and now I ordered ESP-32S (both with 38 pins).
Could You recommend some ESP from this page?: https://allegro.pl/kategoria/plytki-drukowane-moduly-moduly-67363?string=esp32%20devkitc
Check your existing ESP32 pin out matches this one... https://components101.com/microcontrollers/esp32-devkitc
I ordered another two different ESP32 Devkit C which has confirmed that UART2 is output on GPIO16 and GPIO17. Still the same result... I checked if PINs connected to controller board are connected to ESP32 module and they are connected proper PINs of module.
Is this the esp32S variant? That isn't the correct one, the wroom one is.
I'm not sure where to point you to now to fix this problem. I've built/used/sold a lot of the controller boards and I would have had a lot of complaints if they didn't work over canbus.
Is there any damage to the tracks on the PCB? Perhaps the can chip if damaged/faulty?
Hi.
First of all, thanks a lot for creating such a great project like diyBMS.
I am assembling my own energy storage and I have reached the stage where I want to connect diyBMS with Cerbo GX from Victron.
I created the appropriate cable, checked whether it had continuity and connected it to Cerbo and BMS. Unfortunately, the data from the BMS did not appear in Cerbo and the BMS itself started to restart. I connected via the serial port and watched the logs:
I changed the firmware to an older one, suspecting that there might be some regression in the latest one. I loaded the version from 2023-03-29, after turning on CAN communication, the "CAN send error" counter started to increase, but the BMS did not restart, logs from the serial port below:
I tried using the second and third controller boards and different ESP32 - it didn't change anything, still the same messages. I tried to look for some trace on the network, but I only found one to check the voltage level on PIN 8 of TJA1057GT/3J - in my case it was 0V regardless of whether CAN was turned on or off. I also decided to check the supply voltage for this system and it was 5.1V and for Vio 3.2V.
The 120 Ohm resistor is active (JP1 bridge soldered), the resistance between the terminal ends has been checked. Cerbo has a 120Ohm terminator. To make sure that the problem was not Cerbo, I checked using Sparkfun CANBUS Shield whether any packets were passing through. After connecting to Cerbo, you can see that Cerbo is sending packets and I am receiving them without any problems. I later connected to DIYBMS to the CAN terminals, but unfortunately there were no packets visible here and the CAN send error counter kept growing. I replaced the pins just in case, but it didn't change anything.
The CAN chip I have soldered (the entire assembly was done by JLCPCB) is NXP A1057G3 (CQSL4 Zn206).
I have no idea what could be wrong - I would be grateful for any tips on how to pursue the issue further.