diy solar

diy solar

Victron VenusOS driver for serial connected BMS - JBD / Daly / ANT / JKBMS / Heltec / Renogy / Tian / ECS

I've got these cables in from amazon and they are way too big. I need to be able to plug into the GPS port on the JKBMS. The JST 2.0 cables are almost twice the size of the port on the BMS


EDIT: It's JST 1.25, 4 PIN


Of course ... I have mixed it up with the Victron VE.Direct (for MPPT, Smart Shunt, ....)
Sorry, my mistake.

You are right. The BMS needs JST 1,25mm 4 PIN.

Here is one shop:
 
Thanks to Luisdw! Question: is it possible to write driver for non victron AC inverter on USB-serial modbus as VE.Direct or not at all? Thanks and regards. Petr
 
Yes I know and thanks again, but do you you think is it teoretically possible to write serial driver for AC invertor? (there are Phoenix on VE.direct).
I have not seen any non Victron serial AC invertors drivers on Venus OS. Sorry for off topic...
May be you undestand now.
Petr
 
The driver is actually for the GX devices that run VenusOS. You only need a GX device connected to the battery for it to work. If you have a Multiplus or a Phoenix or no inverter does not matter to the driver. If what you want works with the Victron GX devices then it will work fine. Anything else will not.
 
@Louisvdw thanks for all your work on this -- is the dual battery (multiple bms) on the roadmap yet? How much funding would be required to get that pushed across the finish line?

Cheers
 
The output on the RS485 port on the BMS is TTL (RS232) - I know, confusing. You should be able to talk to it using a regular TTL/USB converter. The pin-out is in the description of my Gitrhub repo here: https://github.com/PurpleAlien/jk-bms_grafana

Once you have that hooked up, you can use the driver mentioned in this topic to have VenusOS interact with it.
Is there any easy place to steal 5v or 3.3v on jk bms? I’m considering 48v to 5v buck converter and using the vbatt pinon the jk serial port. Span02C-05 at jameco.
 
Running an esp32 module for wifi streaming of data to a Mqtt server.
I'm just using a small buck converter mounted under the ESP32. It's the solder points between the socket strips. The 4pin cable plugs into the JBD BMS serial port
 

Attachments

  • PXL_20211014_111031628.jpg
    PXL_20211014_111031628.jpg
    254.4 KB · Views: 29
  • PXL_20211014_124332181.jpg
    PXL_20211014_124332181.jpg
    160.3 KB · Views: 29
The BMS that people have the least querries/issues are the JBD or JKBMS (JKBMS is also a good option but it seems that the SOC calc for the JBD is a little bit smarter/better. The JKBMS app is easier and less complex).
The Daly gets by far the most issues logged and it's communication protocol is also a bit limiting.
Hi!
I'm about to join this journey, just undecided on BMS: either Seplos with native can comms or a JK due to active balancing.
Reliability and price are the top factors.

After this time, do you maintain your preference with JDB and JK?

I'll go with the RPi and Venus OS (working in IT / *nix envs); which would be your preferred platform? (RPi and Venus versions?)

It will be a Victron setup, Multiplus II 24/5000 and SmartSolar mppt on the way...

Thanks for all your insights!
Regards!!
 
After this time, do you maintain your preference with JDB and JK?
Yes. For the price JBD and JKBMS are both great options. I've just added the ECS GreenMeter which is of great quality and more accurate measurements but it will cost a lot more.


It might be worth mentioning that if you don't already own a RPi and need to buy one for this, then you might be better to look at the Victron CerboGX. In the end the Pi will not be that much cheaper (except if you can get a Pi Zero2 model perhaps). The reason I say this is that a Ve.Direct cable cost a fraction of a Ve.Direct->USB. You also don't need a USB-MK3 device for the Multiplus and you don't need any other PI HATs (RS485), Hubs or a power supply from your DC battery directly. So make sure you add all that up in your cost. You can also tinker the same as you would on a Pi, except if you need the Pi GPIO for something spesific.

So my choice would be a CerboGX if I start from nothing.
Then I would look at the Pi Zero 2. At the price, you get a Pi3+ with a little less memory, but you need to add a USB Hub.
Then Pi3/Pi4 (what you can get your hands on as stock still seem to be a problem)
If you plan on running NodeRed with a lot of nodes on VenusOS as well, then the faster Pi4 with more RAM will be better, else it will not matter much.

Enjoy the journey
 
Yes. For the price JBD and JKBMS are both great options. I've just added the ECS GreenMeter which is of great quality and more accurate measurements but it will cost a lot more.


It might be worth mentioning that if you don't already own a RPi and need to buy one for this, then you might be better to look at the Victron CerboGX. In the end the Pi will not be that much cheaper (except if you can get a Pi Zero2 model perhaps). The reason I say this is that a Ve.Direct cable cost a fraction of a Ve.Direct->USB. You also don't need a USB-MK3 device for the Multiplus and you don't need any other PI HATs (RS485), Hubs or a power supply from your DC battery directly. So make sure you add all that up in your cost. You can also tinker the same as you would on a Pi, except if you need the Pi GPIO for something spesific.

So my choice would be a CerboGX if I start from nothing.
Then I would look at the Pi Zero 2. At the price, you get a Pi3+ with a little less memory, but you need to add a USB Hub.
Then Pi3/Pi4 (what you can get your hands on as stock still seem to be a problem)
If you plan on running NodeRed with a lot of nodes on VenusOS as well, then the faster Pi4 with more RAM will be better, else it will not matter much.

Enjoy the journey
Thanks for your prompt and lengthy reply!
You provided a lot of added value!!
 
I'm holding tight while the SBMS0 driver development progresses... Thinking about the viability of the solution that connects the SBMS0 to the Raspberry Pi electrically. Unlike other BMS's used with VenusOS, an SBMS0 may have several connections to the whole system, including a main shunt, a solar shunt, voltage sense, and charger/inverter disconnect. How important do you all think isolation is for the custom cable that would be needed here? I use real Victron cables for my existing VE.Direct connections to the Pi. The SBMS0 is connected to Aux1 and Aux2 on my MultiPlus and those are already isolated.

Edit: Maybe I could use a chopped Victron cable to make the custom SBMS0 serial connector?
 
Last edited:
V0.13 has been released.
New support for ECS GreenMeter and Tian power BMS (LifePower/Revov)
Fixes for Renogy and Daly and remount support for VenusOS v2.91
 
How important do you all think isolation is
Isolation is a safety feature so that high voltages could not get to low voltage areas and cause damage.
It could cause you to have to replace damaged components, or perhaps a fire. You need to look at how likely that would happen and if the replacement cost compare to the cost of the isolation cable. Safety is always a good thing.
 
OK all you experts. Care to help out a N00b? lol

I am seriously thinking about building 2x battery packs each will be 4s EVE 280ah from Jenny for 2x 12v 280ah batteries, Thinking about using her empty 4s plastic cases as well.

This is for a new RV install using all Victron with MultiPlus II 12v. And either Victron Cerbos/GX or going VenusOS (I do some smart home stuff on Rpi4s).

Questions.
1 - What are some of the better/easier to use/program and reliable yet cost effective BMS's that this supports and full featured with all of VenusOS and Victron.

I am sure there will be a lot of opinions, but that is fine. How about options that will fit in the case with the 4x cells?
Do any support heater pads to put between the cells?

2 - While I have you attention... lol
Is the VenusOS mature and stable and full featured enough to run instead of dumping all the $ on the Cerbos/GX and screen?

Thank you all so much!
Learning a lot!
Geo
 
I just wanted to report that EG4 Lifepower4 monitoring is working great for me. Thanks for all of the hard work!

Now I'm trying to get another USB/RS485 cable for my other battery. I left a message for signature solar on Friday (they sent me one USB cable for two batteries) but, it's probably justified for that to be a low priority request.

It seems pretty normal to need a second USB cable--nothing said I was using both batteries on the same inverter/install site when we ordered two.
 
Questions.
1 - What are some of the better/easier to use/program and reliable yet cost effective BMS's that this supports and full featured with all of VenusOS and Victron.

I am sure there will be a lot of opinions, but that is fine. How about options that will fit in the case with the 4x cells?
Do any support heater pads to put between the cells?

2 - While I have you attention... lol
Is the VenusOS mature and stable and full featured enough to run instead of dumping all the $ on the Cerbos/GX and screen?

1. They all work fairly well, but for noob easy I would suggest JBD or JKBMS. JBD has many options, so you can just pick the one with the cell and current count that match your needs and make sure to get one with RS485 comms as well.

2. Cerbo\GX are all running VenusOS same as a rPi. If you have many items you want to connect to it, then you will not save much money going for a Pi and rather take the Cerbo as it already has all the connections and sockets you need.
 
Last edited:
1. They all work fairly well, but for noob easy I would suggest JBD or JKBMS. JBD has many options, so you can just picj the one with the cell and current count that match your needs and make sure to get one with RS485 comms as well.

2. Cerbo\GX are all running VenusOS same as a rPi. If you have many items you want to connect to it, then you will not save much money going for a Pi and rather take the Cerbo as it already has all the connections and sockets you need.

That’s the impression I got.
Leaning towards JDM 4s 200amp 12v (thinking should be ok with 2x 280Ah 12v batts with MP II 3000).
Was going back and forth between JDM and JKBMS. Though seems the JKBMS may not be good for 12v. I already have 2x RPi4s I use for HomeAssistant.
Though I will still have to figure out what I need for each setup and way the difference.

Thank you sir!
geo
 
Hello everyone,
I'm looking for help to get my communication between a JK BMS and the cerboGX running. To better understand my system I try to describe it first a little bit and than I give you my SSH log data.

To the system: I'm using 3 victron MP2 3kW 48V in a 3-phase configuration (Germany grid). They are connected via VE.Bus to the cerboGX (firmware 2.91). In addition I'm using 2x victron MPPT 250/70 chained via VE.CAN (incl the CAN termination on both ends). My battery are 2 in parallel self made 48V 105Ah Narada with a JK BMS (BD6A17S6P) per string (in total 2). The smart meter is a EM24 which is connected to the internet router (same for the cerbro internet-connection). This system is running fine on a configured ESS-assistant MP2 installation. I have no issues with that but to improve the level of integration I want to have the JK communicate to the cerbo. For this I was following the manual steps of genious Louisvdw described on the first page of this thread (for the beginning just with one JK). I'm using Putty 64bit on a windows laptop. I was connected directly to the ethernet port of the cerboGX via the MK2bus-to-USB-dongle of victron, because I have no ethernet port on my laptop. This worked fine, I was able to get SSH connection to the cerboGX (of course SSH on LAN is activated). After I performed the 3 basic steps (wget, sh, reboot) I was not seeing any JK BMS information on the remote console of VRM portal. So I checked with the log commands the status and all I found was this:
IMG-20220924-WA0044.jpeg
I'm not seeing any "activated" USB Port on the cerbo. When I'm watching videos of others who are using the log commands they always have at least something saying something with USB. As you can imagine I've tried already alot of things like power-off / -on; reinstalling; using a different laptop with direct ethernet port; updating to the most recent Cerbo-firmware (tried 2.90 and 2.91); having the JK BMS already connected to one of the 2 USB data ports of the Cerbo; etc. The issue I'm experiencing also appears when I've not connected the JK BMS via a RS485 to USB transceiver to the cerbo.

I'm kinda frustrated because the others on youtube just have a 10 minute video how the integration works immediately without any issues... Even when they have no JK BMS connected to the cerbo their log data was showing more than in my situation.

I'm looking forward to reading any kind of help from y'all.

Thank you.

Bob2000
 

Attachments

  • IMG-20220924-WA0044.jpeg
    IMG-20220924-WA0044.jpeg
    311.4 KB · Views: 15
I'm looking forward to reading any kind of help from y'all.

Thank you.

Bob2000


Please read the start of your terminal session carefully.

It shows that the install file was downloaded to a different filename (installrelease.sh.2). So the installrelease.sh you're executing is an old version of the file possibly? Try removing installrelease.sh and starting over.

rm installrelease.sh
 
I'm not seeing any "activated" USB Port on the cerbo. When I'm watching videos of others who are using the log commands they always have at least something saying something with USB. As you can imagine I've tried already alot of things like power-off / -on; reinstalling; using a different laptop with direct ethernet port; updating to the most recent Cerbo-firmware (tried 2.90 and 2.91); having the JK BMS already connected to one of the 2 USB data ports of the Cerbo; etc. The issue I'm experiencing also appears when I've not connected the JK BMS via a RS485 to USB transceiver to the cerbo.

I'm kinda frustrated because the others on youtube just have a 10 minute video how the integration works immediately without any issues... Even when they have no JK BMS connected to the cerbo their log data was showing more than in my situation.

I'm looking forward to reading any kind of help from y'all.

Thank you.

Bob2000

Hi @Bob2000
After you ran the install sh script you need to reboot your Cerbo.
Only after the reboot will the driver be able to be picked up. If you you then look at the serial-starter log you should see the driver being tested. Don't worry too much about the installrelease.sh.2 (it's a good thing to notice), but the install script has not changed in a while, only what it installs.

I don't see any USB devices being tested, which indicates to me that there is something wrong with your USB converter device. Can you tell us what you have used to connect those JKBMS to your Cerbo?
Are you using the official JKBMS RS485 and then a RS485 USB converter?
Are you using a TTL USB device directly?
What USB converter brand/chip?
Perhaps a picture can help.
 
Hi @Louisvdw,

thanks for replying so quick. I see that my screenshot is pointing you in the wrong direction. The reboot was something I tried also the times before and after this specific time stamp without any positive result. But the logs from my screenshot were always the same no matter what I have tried. I also use this video from off grid garage who is following your steps and he did'nt even had to have a USB connection in place and still get the setup running. Afterwards he is plugging in his BMS to Raspi adapter and it runs just fine.

I'm using these 2 cables:
from JK starting: https://www.amazon.de/gp/product/B09F2DVT4W/ref=ppx_yo_dt_b_asin_title_o02_s01?ie=UTF8&psc=1
and ending up to the USB port of the CerboGX with this cable (of course not having the VBat cable connected, only GND, RX to TX; TX to RX; even if I'd have mixed up RX / TX there would be different log file information, wouldn't it?): https://www.amazon.de/gp/product/B07RG77VWD/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&th=1

There were also some posts in different threads and forums where people just using this kind of transformation / adaption.

Something that would help me as well is to know if it's really necessary to have the BMS already connected to the Cerbo when doing the ssh commands?

Thank you.
 
You can install the driver without anything connected. You have run the install script and your image show that the /data/conf/serial-starter.d file is loaded which is one of the items that the driver installs. So I will assume it's installed. (V0.13 was released on 30 Sep and your screenshot does show 24 Sep, so if you have not done the install after that do upgrade to the latest first - it has a read-only filesystem fix for VenusOS 2.91)

Lets check if the USB converter cable is working. First unplug the USB connector.
Then run the command
> tail -f /data/log/serialstarter/current
This will show you any changes to the log file. So while that command is running plug in the USB-TTL converter. If all is fine, then you should see that serial-starter is seeing that there is a new device and it will start running through all the possible drivers on that new ttyUSB port. If nothing is changing while the tail -f command is running it means that your USB converter is not picked up. Try another USB port as well. If still nothing then you need to perhaps look at another USB converter. I am not sure if the CP2102 chip works with VenusOS, or it could be that your one is defective. The FTDI, CH340 and PL2303 have been reported to work. Victrons cables all run using FTDI chips and mine are also FDTI. I also used a CH340 before.
 
Hi Louis,
I have installed your 0.13 version.
venus os is 2.91.
I have a Daly 200A BMS, and It is working almost well.

But if I enable CVCM, then the driver is not loaded correctly.
I think CVCM is a valuable feature and I like to have it working.

I have seen another curious thing. I have monitored each cell voltage and here is the graph of 16 cells.

1664827379179.png

you can see peaks toward down during discharge and toward up during charge.

The peaks are for each cell multiple of 3, for instance, cell 3, cell 6, cell 9, etc...


what do you think about.

thx
 
Last edited:
The peaks are for each cell multiple of 3, for instance, cell 3, cell 6, cell 9, etc
The Daly's communications protocal is not the greatest. So reading the cells sometimes takes too long. If that is the case here with you then you can try to solve it by increasing your polling interval.

Log in to your GX device with SSH.
Edit the Daly driver with:
> nano /data/etc/dbus-serialbattery/daly.py
and change the polling interval on line 18 to 1500 or 2000.
self.poll_interval = 1500
Save and exit with Ctrl-O, Ctrl-X
and then reboot your GX to apply that and see if your cell voltages show less errors.
 
self.poll_interval = 1500
Hi,
unfortunately it doesn't help.
But,
as I reported before if you enable CVCM the driver doesn't start.
This is because if "self.read_cells_voltage()" fails before "manage_charge_voltage()" is called then the "for" at line 107 fails.
so if you change line 106 of the file battery.py with
if (CVCM_ENABLE and len(self.cells)>0):
then the driver starts ok.

I also report that the driver shows cell voltages in the console only if you use the uart.
If you use rs485, the cell's voltage is not shown.

I am still investigating the spike in cell voltages.

Thx for your good work.
 
You can install the driver without anything connected. You have run the install script and your image show that the /data/conf/serial-starter.d file is loaded which is one of the items that the driver installs. So I will assume it's installed. (V0.13 was released on 30 Sep and your screenshot does show 24 Sep, so if you have not done the install after that do upgrade to the latest first - it has a read-only filesystem fix for VenusOS 2.91)

Lets check if the USB converter cable is working. First unplug the USB connector.
Then run the command
> tail -f /data/log/serialstarter/current
This will show you any changes to the log file. So while that command is running plug in the USB-TTL converter. If all is fine, then you should see that serial-starter is seeing that there is a new device and it will start running through all the possible drivers on that new ttyUSB port. If nothing is changing while the tail -f command is running it means that your USB converter is not picked up. Try another USB port as well. If still nothing then you need to perhaps look at another USB converter. I am not sure if the CP2102 chip works with VenusOS, or it could be that your one is defective. The FTDI, CH340 and PL2303 have been reported to work. Victrons cables all run using FTDI chips and mine are also FDTI. I also used a CH340 before.
@Louisvdw: this weekend I tried your suggestions and it turns out that, 1. it was flashed correctly but my JK BMS "GPS"-port was broken. I was finalizing my second batterey with a fresh JK BMS and than I tried the 2nd one with a new adapter the JK information appeared in the remote console. Thank you! For the sake of clarity, I have not tried my first adapter again. I tried some new one with different type of chip. these 2 were working fine with me (both from Amazon):

AZDelivery UART-TTL USB Adapter mit CH340G​

Hailege 5pcs USB to Serial CH340 USB to TTL Download Module with STC Microcontroller​

as soon as I plugged this into my first JK BMS it was not showing updating data anymore. The log screenshots from above were still showing the same. so to me it is still kind of confusing but I take it as it is.

When I can make a call, I would highly appreciate having a software for cerbo GX which can run and consder 2 JK BMS.

Thank you again and have a great start into the upcoming week ;-)
 
Hi guys!

Also having some issues with JK bms.

Followed the instructions to install the driver in CCGX (v2.91).
Purchased a USB to TTL/485 converter which has an FT232R chip. The pins should be connected properly, and I also tried switching A and B (Tx/Rx). The USB goes to the GX and I tried both USB ports. For one time only, the logs switched between USB0 and 1. After, I could not replicate this, always states USB0.

What I am doing wrong here? :( Could it just be the adapter?

I also ordered a CH340 based adapter and I think I have an RS232 (PL2303) adapted from my networking days somewhere -> should I find the pinout and give it a try?
 

Attachments

  • IMG_3991.PNG
    IMG_3991.PNG
    520.4 KB · Views: 33
  • IMG_3990.jpg
    IMG_3990.jpg
    54 KB · Views: 36
  • IMG_3989.jpg
    IMG_3989.jpg
    74 KB · Views: 34
USB to TTL/485
That is a good adapter that you have in your image, but it is a RS485 converter. You cannot connect it directly to your JKBMS. It will only work if you first connect the JKBMS 485 converter.

If you want to connect it directly, then you need to get a USB TTL converter.

There are different serial standards. Each work a little differently and on differentl voltages and you need a converter to match.
TTL is 3.3V
RS485 is 5V
RS232 is 12V(normally)
 
If you want to connect it directly, then you need to get a USB TTL converter.
Getting a jk converter is not really an option, as deliveries from china take like 2 months.
But I have ordered 2 additional adapters, maybe one of them will work.

Also, I have managed to get them to partially work last night (2am ?) and got the GX to display them (I also found the rs232 adapter and hacked a cable).
What is the logic behind the driver/venusOS? Will it display the adapter if recognised even if not connected to battery? As this is what I think happened, but it’s very shady and hard to reproduce.

It first shows the wrong BMS types (see pic), though they are both connected to the same pins on the battery.
And, the weird part is, they sometimes get displayed inVRM, sometimes no. Sometimes both, sometimes only one do them, most times neither :)
Also while looking at the live logs, most times it will try to load drivers, but sometimes it won’t.
 

Attachments

  • E7F941F4-1FEC-4F0E-A65B-F71CB719851E.png
    E7F941F4-1FEC-4F0E-A65B-F71CB719851E.png
    928.9 KB · Views: 11
  • 5881AD27-7431-4343-8D04-E28466CA7B77.jpeg
    5881AD27-7431-4343-8D04-E28466CA7B77.jpeg
    77.7 KB · Views: 9
  • 48EDF654-7B76-46AE-8F0E-0B9C9227DD45.png
    48EDF654-7B76-46AE-8F0E-0B9C9227DD45.png
    838.1 KB · Views: 11
Getting a jk converter is not really an option, as deliveries from china take like 2 months.
Same here for me :) It's very slow.

What is the logic behind the driver
It will keep on trying to connect different batteries until one works. So it might get a response that it thinks is a battery, but then that would fail. The JKBMS communications protocol use a very fast rate and the daly a very slow rate. So it might be that on that slow reading when it tries the Daly it think that it gets a reply from a JKBMS.
 
.The JKBMS communications protocol use a very fast rate and the daly a very slow rate. So it might be that on that slow reading when it tries the Daly it think that it gets a reply from a JKBMS.
I tried to change the baud rate in the config file for all bms’s to match the JK, but it didn’t work.
Could be either i’m noob (which I am :) ) at python, or the wrong rs adapter as you pointed above.

Waiting on the new adapters, which should be TTL and might work with the JK.

When i’ll sort it out, i’ll do a more indepth tutorial for (at least jk) bms connectivity as it’s not very clear on how to connect. Your driver is amazingly simple to use for someone who know basically nothing and the install instructions are no-brainer ?
 
@Louisvdw, finally discovered a way to check the logs, and I saw this...


@4000000063487d752b67fa04 INFO:SerialBattery:Starting dbus-serialbattery
@4000000063487d752be53c6c INFO:SerialBattery:dbus-serialbattery v0.13
@4000000063487d752c52ac0c INFO:SerialBattery:Testing LltJbd
@4000000063487d7604a5a8bc ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000063487d76055d9a94 INFO:SerialBattery:Testing Ant
@4000000063487d7618bbf66c ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000063487d76197e9a8c ERROR:SerialBattery:>>> ERROR: Incorrect Data
@4000000063487d76199b792c INFO:SerialBattery:Testing Daly
@4000000063487d762c486b0c ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000063487d762cbc5ea4 INFO:SerialBattery:Testing Daly
@4000000063487d77039a5ef4 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000063487d77042c988c INFO:SerialBattery:Testing Jkbms
@4000000063487d7716b0190c ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000063487d7717494bcc INFO:SerialBattery:Testing Sinowealth
@4000000063487d792237ed04 INFO:SerialBattery:>>> INFO: Discharge fet: False, charge fet: True
@4000000063487d7a0cff0c9c INFO:SerialBattery:>>> INFO: Number of cells: 4
@4000000063487d7a0d210bbc INFO:SerialBattery:>>> INFO: Number of temperatur sensors: 1
@4000000063487d8a117c4ba4 ERROR:SerialBattery:>>> ERROR: No reply - returning [len:1/4]
@4000000063487d8a120fec9c INFO:SerialBattery:Testing Lifepower
@4000000063487d8a246982a4 ERROR:SerialBattery:>>> ERROR: No reply - returning
@4000000063487d8a24c87f0c ERROR:SerialBattery:>>> ERROR: Incorrect Data

Considering the GX picked up the BMS as Sinowealth, could it mean that it might be the BAUD rate issue, and it might have seen the battery, but just couldn't read it fast enough?
 
Considering the GX picked up the BMS as Sinowealth, could it mean that it might be the BAUD rate issue, and it might have seen the battery, but just couldn't read it fast enough?
It's not a baud rate issue. The JKBMS only works with how it's driver is set up for it.
Your issue is 100% that you have the wrong USB converter for the JKBMS. You need a USB-TTL converter while you are using a USB-RS485 which will never work.
 
After MUCH hassle, i finally made it working ?
It turned out to be a series of alignments in order to make it work on the JK BMS.

First things first, many thanks @Louisvdw for all your effort. The code works perfectly! ?

So, turns out the JK standard is a bit of strange one and it CAN be done with a SUB-TTL adapter, but not all are made equal and it must be on that supports 3.3v.
I've also figured out a way to test where the issues might be:

1. install software as descried in the how to in git (I would go via ssh, even on mobile client it works pretty good).
2. have laptop or mobile at the ready to run some commands
3. connect wiring between bms and GX (or Pi, but I have GX, use one of the 2 free USB ports, I have not tested the 3rd which is kind of separate from the other 2)
- on JK BMS, use the GPS port (2nd port from the left) and only the first 3pins (again from left) GND RX, TX (order is important for next step)
- on adapter side match GND and REVERSE cables RX and TX (RX from BMS goes to TX from adapter and TX from BMS to RX on adapter, this is how all serial works - as a check you've done this correctly, your adapter might have some leds that BOTH will flash, if only TX flashed, they could be TX-TX and RX-RX, so check cabling).
4. if you're lucky, it might just work, if not, here's how to troubleshoot where the fault might be
5. using said laptop/mobile at point 2, open a terminal emulator (on iOS i used Terminus, windows I used Putty, but ANY will work)
- login as root as per procedure
- fist run command tail -f /data/log/serial-starter/current - this will check that USB is recognized by GX/Pi. It should say something like INFO: Start Service bla bla bla (or doing something in general, it works), if nothing appears ending with ttyUSB0 (might be 1,2... instead of 0) than your adapter is not recognized - try different USB port/cable/replace adapter, if it works move to next step
- second run command tail -f /data/log/dbus-serialbattery.ttyUSB0/current - this will check if your adapter sees the battery and/or some other errors (@Louisvdw the second command is not presented with tail -f command and initially i used sfpt to check logs, later decided to try the ssh command and it also worked, perhaps you can update the page on GIT?)

I tried 5 adapters until it worked (well, 4 technically, but you'll why I said 5...).
In some posts above you can see that i ordered. Including a USB-TTL adapter, which initially didn't work. As I troubleshooted and started to doubt my (mhhmmm awesome) cabling work, I started tested with a multi-meter. And I noticed that while connecting the bms to the adapter, the voltage was ~1.2v, while the adapter was putting 5v. When I checked the BMS without any cabling it was ~2.3/2.4v so I figured it might work on 1.5v as standard. After some googling, i found there is no standard for 1.5 and most are 3.3, 5 and 12v. After looking at this USB-TTL adapter, I noticed it has a jumper between 3.3v lead and 5v (and it was bridging the 5v) so I moved it to 3.3 and it freaking stared to work!!

The other ones are strictly 5v, but i will try to find another adapter with 3.3 and test. My theory is that it will accept any RS485, but as long as it's 3.3v.

This is pretty much it! As advertised, Louis's code works pretty good and you will no longer have to rely on the shunt (which ready differently than the BMS and shuts off your battery when least expect it :) )
I do have some issues with CRC (see putty export), but it seems to work on GX without issue.
 

Attachments

  • IMG_4022.jpg
    IMG_4022.jpg
    247.9 KB · Views: 30
  • IMG_4021.jpg
    IMG_4021.jpg
    131.5 KB · Views: 29
  • IMG_4020.jpg
    IMG_4020.jpg
    124.3 KB · Views: 31
  • IMG_4019.jpg
    IMG_4019.jpg
    358.4 KB · Views: 31
  • Screenshot 2022-10-17 231925.png
    Screenshot 2022-10-17 231925.png
    54.3 KB · Views: 29
Back
Top