diy solar

diy solar

JBD BMS Wi-Fi Module

Hallo.
I have jk bd6a20s 10p and i measures Vcc Gnd from 485. Value is 56V. I have 16 cell. Something is wrong?

Sorry for the late reply. The JIKONG BMS is a different beast. For the voltage regulator see post #56 here:


I got the wifi module for my jk bms working, however, there is no information at all on how to change settings over uart. Several attempts to contact the manufacturer got no results so the project was dropped. It's a shame as it's a cool bms.
 
Many thanks @melkier !! I made one adapter board, put esp-link on an ESP (I've only used tasmota before), plugged into one of the tractor battery pack BMSs, got jbdtools compiled on linux, and it works from the command line!! Nice! Next I'll see if can integrate it with my other junk, mqtt/influx/grafana/nodered (iot_stack) RPi, and do more of them. I love following along on this stuff that would take me years (if ever) to do on my own! Thanks!!!
1626754368130.png

1626754308404.png
 
Many thanks @melkier !! I made one adapter board, put esp-link on an ESP (I've only used tasmota before), plugged into one of the tractor battery pack BMSs, got jbdtools compiled on linux, and it works from the command line!! Nice! Next I'll see if can integrate it with my other junk, mqtt/influx/grafana/nodered (iot_stack) RPi, and do more of them. I love following along on this stuff that would take me years (if ever) to do on my own! Thanks!!!
View attachment 56990

View attachment 56989

That is awesome! I'm glad they're working for you - this is exactly why I posted this stuff.

I like the plastic protective covers you put over them too - I should do the same to mine
 
Here's my first evening of data from the BMS, really neato, thanks again melkier. I really like the idea of multiple paralleled strings, each monitored separately. Now the voltage is sensed, I have the charging set to stop at 4.12vpc which should be before the BMSs stop the charging at 4.13vpc, 2 layers of overcharge protection. Thanks!

(Separate topic: It reveals an interesting question already; the cell delta V behavior is interesting and curious. I'll see if this funny pattern continues, it may be just random.) The ElecTrak tractor has a 10s gen 2 Leaf battery, with 2 parallel separate packs, one in front, one in back. The BMSs directly pass all charging current and discharging current for the tractor controls, but discharging does not go through the BMS yet. The main tractor drive and PTO mower deck current would be too much for the BMSs. Starting at 9pm, two old Enphase m210 microinverters are turned on to discharge it, through the PTO mower deck contactor. At low pack voltage, the BMS disables discharging which turns off the tractor controls and opens the PTO contactor and disconnects the micrs. The micros output is AC coupled to the main house battery inverters to approximate cover the house loads overnight, instead of discharging the main house FLA forklift battery. These microinverters are old and flaky. They should just run at 220w continuous but they go at lower power or turn off intermittently. It could be that this time period from 11 to midnight, both micros are working at full load and the faster discharge results in more cell deltaV. In the future, I'll rewire the micros to discharge through the BMSs and that will let me monitor the current and see if that's all it is. There will also be small AC relays on each micros's output to control each one independently, each one is only <1A @240v.1626954087667.png
 
I'm super happy to found you guys and this amazing post.
Thanks Daklein to share me this post that I missed
I'm starting to build my first battery, I'm installing 4 battery bank on board, and I'm super excited to find this way how to control everything.
Thanks for now.
 
So guys,
I spend all day on this, but it does not work.
Here my Setup:
- JBD 4S 150A Uart
- Esp8266 Mini and Wemos D1R2
- Windows 10 or Raspbery pi 4

I've followed all the insruction since thread #1, I have the IP form my router, change the parameters in PIN assignment µConsole and Debug Log. all good.
I disconnect from the BMS the usb module and connect GND, TX and RX to my esp8266 (I also tried without GND, or invert the wires...
I connect the esp to my PC with usb with the command jbdtool -t serial:COM4,9600
I've tried the command jbdtool -t ip:192.168.15.152,23 or also without 23
Nothing work. What I can see is that the esp8266 blink three times when I send the command, the cursor blinking and then come back to the prompt.
I copy the jbdtool_pi on my raspberry, but I'm not able to run on it, linux is not in my confort zone so I need help to understand how to run jbdtool from my pi.

And at the end I saw, here on this post, the jbdtools running with UI. Where is this program?

Thanks in advance to any help.
 
What I can see is that the esp8266 blink three times when I send the command, the cursor blinking and then come back to the prompt.
I copy the jbdtool_pi on my raspberry, but I'm not able to run on it, linux is not in my confort zone so I need help to understand how to run jbdtool from my pi.
Have you got a working jbdtool executable for built for your pi?
 
Have you tried the debug vector?
Code:
jbdtool -d $x -t serial:COM4,9600

where x is an integer between 0-9
Suggest you start at 0 and increment until you get the desired detail.
 
spidgrou, here are the steps I used to install jbdtool on the RPi (assuming it's connected to internet).

clone jbdtool source on RPi (from ssh login to RPi)
pi@hassbian:~ $ git clone https://github.com/sshoecraft/jbdtool.git
download and install pahomqtt c, jbdtool uses the library for mqtt support.
pi@hassbian:~ $ git clone https://github.com/eclipse/paho.mqtt.c.git
pi@hassbian:~ $ cd paho.mqtt.c (go into the folder where the git repository was copied down to.)
pi@hassbian:~/paho.mqtt.c $ make (this should do some things and finish without errors)
pi@hassbian:~/paho.mqtt.c $ sudo make install
make & install jbdtool
pi@hassbian:~ $ cd ~/jbdtool (go into the folder where the git repository was copied down to.)
pi@hassbian:~/jbdtool $ make
pi@hassbian:~/jbdtool $ sudo make install
success?!?! type jbdtool from any location, and it should list all the input arguments available. Then try the ip connection to the ESP/UART BMS

Another thing to check, after setting up the esp8266 mini with esp-link, can you ping it's ip address from the RPI, and from a browser on your network, can you see the esp-link configuration page, and completed the settings so it will function as a serial wifi bridge? I think only the uart should be connected to the esp8266, not the usb to something else except maybe to power it? Are you using a 3.3v supply to power the ESP from the BMS UART, or powered from the usb? I guess an esp8266 mini is like an ESP01 but with an FTDI type usb chip permanently attached, and the usb plug can power it and reprogram it. This is a little different than using the very minimal ESP01 board. I guess it should work, but maybe something in esp-link may need to be set differently.
 
spidgrou, here are the steps I used to install jbdtool on the RPi (assuming it's connected to internet).

clone jbdtool source on RPi (from ssh login to RPi)
pi@hassbian:~ $ git clone https://github.com/sshoecraft/jbdtool.git
download and install pahomqtt c, jbdtool uses the library for mqtt support.
pi@hassbian:~ $ git clone https://github.com/eclipse/paho.mqtt.c.git
pi@hassbian:~ $ cd paho.mqtt.c (go into the folder where the git repository was copied down to.)
pi@hassbian:~/paho.mqtt.c $ make (this should do some things and finish without errors)
pi@hassbian:~/paho.mqtt.c $ sudo make install
make & install jbdtool
pi@hassbian:~ $ cd ~/jbdtool (go into the folder where the git repository was copied down to.)
pi@hassbian:~/jbdtool $ make
pi@hassbian:~/jbdtool $ sudo make install
success?!?! type jbdtool from any location, and it should list all the input arguments available. Then try the ip connection to the ESP/UART BMS

Another thing to check, after setting up the esp8266 mini with esp-link, can you ping it's ip address from the RPI, and from a browser on your network, can you see the esp-link configuration page, and completed the settings so it will function as a serial wifi bridge? I think only the uart should be connected to the esp8266, not the usb to something else except maybe to power it? Are you using a 3.3v supply to power the ESP from the BMS UART, or powered from the usb? I guess an esp8266 mini is like an ESP01 but with an FTDI type usb chip permanently attached, and the usb plug can power it and reprogram it. This is a little different than using the very minimal ESP01 board. I guess it should work, but maybe something in esp-link may need to be set differently.
Hi @daklein ,
first I would like to thanks a lot for your help, I have to tell you: thank you.

Then, I move from my production pi to a test one.
I followed all your instruction.
First problem was with the first make in paho.mqtt.c, need the openssl lib that I installed.
Second problem on make in /jbdtool with gattlib, I move on also on this, but I'm not sure how.
Then during the compile another problem with glib-2.0, found them and installed.
Now I have another problem during compile that I don't know how to move on.

Code:
pi@openplotter:~/jbdtool $ make
gcc -Wall -g -DDEBUG=1 -DMQTT -DBLUETOOTH  -o jbdtool main.o jbd_info.o jbd.o parson.o list.o utils.o cfg.o daemon.o module.o ip.o serial.o bt.o can.o mqtt.o -lpaho-mqtt3c -lgattlib -lgobject-2.0 -lgio-2.0 -lglib-2.0 -lpthread
/usr/bin/ld: module.o: in function `mybmm_load_module':
/home/pi/jbdtool/module.c:83: undefined reference to `bt_module'
collect2: error: ld returned 1 exit status
make: *** [Makefile:73: jbdtool] Error 1

any idea?

I also understand your point on esp8266, I've ordered one exactly as yours to avoid any problem and test better.

thanks
 
Last edited:
Have you tried the debug vector?
Code:
jbdtool -d $x -t serial:COM4,9600

where x is an integer between 0-9
Suggest you start at 0 and increment until you get the desired detail.
@smoothJoey
today I tried with your advice, but same problem.
I'm waiting the esp-01, maybe something related to the hardware.
thanks
 
I’d buy one of these for a chargery bms if someone would start making them. I’m just not smart enough to make one myself.
 
Second problem on make in /jbdtool with gattlib, I move on also on this, but I'm not sure how.
Then during the compile another problem with glib-2.0, found them and installed.
Now I have another problem during compile that I don't know how to move on.

Code:
pi@openplotter:~/jbdtool $ make
gcc -Wall -g -DDEBUG=1 -DMQTT -DBLUETOOTH  -o jbdtool main.o jbd_info.o jbd.o parson.o list.o utils.o cfg.o daemon.o module.o ip.o serial.o bt.o can.o mqtt.o -lpaho-mqtt3c -lgattlib -lgobject-2.0 -lgio-2.0 -lglib-2.0 -lpthread
/usr/bin/ld: module.o: in function `mybmm_load_module':
/home/pi/jbdtool/module.c:83: undefined reference to `bt_module'
collect2: error: ld returned 1 exit status
make: *** [Makefile:73: jbdtool] Error 1

any idea?

I also understand your point on esp8266, I've ordered one exactly as yours to avoid any problem and test better.

thanks
I left out another change I did: I don't have a need for bluetooth, so I removed that option in the Makefile (in /jbdtool directory), then make & install.

DEBUG=no
BLUETOOTH=no
MQTT=yes
 
I left out another change I did: I don't have a need for bluetooth, so I removed that option in the Makefile (in /jbdtool directory), then make & install.

DEBUG=no
BLUETOOTH=no
MQTT=yes
Ok. Perfect.
I was able to compile.
Now I'm waiting the esp01S.
I hope in a week will be here.

Thanks guys. I really appreciate your help.
Ciao
 
Ok. Perfect.
I was able to compile.
Now I'm waiting the esp01S.
I hope in a week will be here.

Thanks guys. I really appreciate your help.
Ciao

Sorry guys I've been busy and haven't seen this. I would start by connecting your JDB to your PC/Laptop and make 100% sure you UART is working correctly. The speed is 9600 8N1.

If you need a UART adapter I have found this to work:


Cross TX/RX and definitely connect ground BUT NOT VCC - it will damage the USB adapter and maybe your PC.

Use the JBDTools desktop application and configure it for the USB port of your adapter.

Once you have the desktop app working, then open a command prompt and use the jbdtool windows binary with the same com port

If all that is working, you can then plug in your Wifi adapter (as you eliminated all other variables) and then use the command line tool against the IP.

Keep in mind the steps during my build instruction is to absolutely test continuity between TX/RX of the cable plugging into the JBD and the socket the ESP01 plugs into. ALSO make absolutely sure to check the voltage on the socket the ESP01 plugs into. It must be 3.3v only.

All of this for me was a evolution if you will. I started with just the BMS and CAN bus (which only allowed reading the values). Then to using the UART connected to the PI which I got working for 1, but I had 14 BMS so it wasn't feasable/too expensive to buy a serial port aggregator, so then I bought a cheap bluetooth adapter off amazon:


Which did work (using the XIAOXANG android app) but not all the time and would sometimes stop working until reset.

So then I made the wifi adapter which I'm still using and I have been collecting data from them every 30 seconds for months now with no interruption (I have a cheap wifi AP in the solar room).

I'm pretty happy with the solution and the next step is definitely going to be a custom firmware for the ESP01 which will not require any external program to send the data, but will instead publish to mqtt directly - using a username+password and maybe even a certificate. I have some other projects going on right now but this is definitely on my to do list.
 
@melkier thank you for your help.
We are building in two different place, two battery bank. One with four BMS and the other with two.
We are on sailing boat so for us it is mandatory to have everything under control with alarms and details if needed.
When we sail in the ocean we can count only on ourselves and the power togheter with fresh water are our big concern.

When I start to see around about BMS I was pretty sure to code something specific for us, but with your project everithing is much easier, expecially when you will release the new version that will work without external program, directly to MQTT.

So thank you again.
 
I would like to print the PCB to have a better quality hardware.
Normally I use PCBWay, they are cheap and fast.
Here the design.
Let me know what do you think
@melkier the project is yours, so can I print them?
 

Attachments

  • JBD-Tool-Esp01_schem.jpg
    JBD-Tool-Esp01_schem.jpg
    87.2 KB · Views: 62
  • JBD-Tool-Esp01_pcb.jpg
    JBD-Tool-Esp01_pcb.jpg
    55.6 KB · Views: 59
Last edited:
Back
Top