• Have you tried out dark mode?! Scroll to the bottom of any page to find a sun or moon icon to turn dark mode on or off!

diy solar

diy solar

JBD BMS Wi-Fi Module

I am finally integrating the jbdtool into a NodeRed flow to send the battery data to an MQTT broker and then SignalK.
To accomplish this I use this command: jbdtool -t serial:/dev/ttyOP_electron -m localhost:electron:vessels/self/battery/bat1 -J
The MQTT receives the data but the content is Null.
It seems that the word 'vessels' inside the topic is maybe considered a reserved word?
If I use the topic written slightly different, like 'vesselt' it works fine.
I have attached an MQTT capture to show that with the word 'vessels' the content is Null, instead with the word 'vesselt' the content is the actual battery data. Even with other words works fine, this is why I thought to a reserved word.

Anyone has a clue, please?
Thanks in advance
I figured it out, it is my poor knowledge of all of this stuff; blame on me.
Digging down I understood that the SignalK mqtt plugin, writes directly into SignalK keys and for that specific mqtt topic it accepts only numeric values, so any string is passed as null.
 
Hi Melkier,
find attached some debug files taken when I receive no asnwers from jbdtool.
I am not able to understand if it could be the USB TTL converter or is the same issue encountered by smoothJoey.
Hope this helps

What system/os are you running it on? Raspberry PI? If so, which one? if not, Windows? Linux?
 
ok here's a statically compiled version for the PI4B 64-bit. please test it.

this wont work if you're running a 32-bit OS on it (uname -m will tell you)
 

Attachments

Hi Melkier, thank you so much.
The output of uname is armv7l so I guess it is a 32 bit processor.
Anyway, I have tried to run the executable you sent me and it doesn't work because it's 64 bit.
 
Try this one for a PI3B 32-bit

jbdtool: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, for GNU/Linux 3.2.0, BuildID[sha1]=e633c55ab3293efb0c64ec1ebafd6fbd54cce8a1, with debug_info, not stripped
 

Attachments

Hi Melkier,
I tried this one and it seems to be working better, even if the first time I executed it returnd the empty brackets as well.
Would you mind suggesting how to cope with the authentication failur sending to MQTT, please?
I use the MQTT gateway embedded into SignalK without authentication and it returns the error below.
 

Attachments

  • Capture.PNG
    Capture.PNG
    11.1 KB · Views: 18
on the FIRST time executing it, can you give me the output when using -d 6?

I'll load up SignalK on a VM and test against it. I'm using the PAHO client - there may be a compatibility issue.
 
Here you go.
Thank you so much for helping on this, much appreciated.

OK that's very strange. Are you sure nothing else is talking to the BMS while you are pulling data from it?

Because I'm asking the BMS for the "basic information and status" (DD A5 03) and it's returning the hardware version info (DD 05). It's supposed to return DD 03 (basic info).

I've modified the source to check the register being returned and reject the packet (if it's not what was requested).

Attached is the updated program. Please re-run it again with -d 6 and send me the output.
 

Attachments

Hi Melkier,
you are right; I completely forgot that there is a NodeRed flow running in the background that polls jbdtool.
Please find attached 2 debug files: one made with the version you sent me two days ago and one with the version you sent me yesterday.

Thank you in advance
 

Attachments

Hi Melkier,
you are right; I completely forgot that there is a NodeRed flow running in the background that polls jbdtool.
Please find attached 2 debug files: one made with the version you sent me two days ago and one with the version you sent me yesterday.

Thank you in advance

You're using a serial connection and so only one should be using it at a given time. I've updated the program so that it will lock the target - so 2 instances of jbdtool will not be able to use it at the same time. The default behavior is to wait until the resource is free. I've added the -N option to make the program exit immediately with "resource unavailable" if another jbdtool has it in use on the same system.

Please test this new version with -d 6 and send me the output if you would. Make sure nodered is using the same version (so it locks the target).

This new version is "jbtool version 1.8 build 202204110815" - make sure all scripts are using this
 

Attachments

Last edited:
It will lock any jbdtool instance or any using the same serial port?
I am asking because I control 2 batteries with different bms and different connection serial port.

I am going to test it now.

Thanks
 
Tested, find attached the debug file.
I also tested it running from terminal in the same moment NodeRed was using it and it waits giving the reply as soon the resource has been freed.
Nice feature indeed.

Cheers
 

Attachments

Tested, find attached the debug file.
I also tested it running from terminal in the same moment NodeRed was using it and it waits giving the reply as soon the resource has been freed.
Nice feature indeed.

Cheers

OK can you confirm it is no longer giving no output on 1st connection?

I have yet to test against the signalK MQTT server ... was too busy last w/e
 
It will lock any jbdtool instance or any using the same serial port?
I am asking because I control 2 batteries with different bms and different connection serial port.

I am going to test it now.

Thanks

It will lock the target (-t <transports:target>), so if you use ttyS0 on one and ttyS1 on another it will lock them individually. Please test to confirm.
 
OK can you confirm it is no longer giving no output on 1st connection?

I have yet to test against the signalK MQTT server ... was too busy last w/e
Yes confirmed, never had the empty output on the tests I made so far
 
It will lock the target (-t <transports:target>), so if you use ttyS0 on one and ttyS1 on another it will lock them individually. Please test to confirm.
Yes confirmed, the already running instances run normally for what I have been able to test so far. Thank you so much
 
Yes confirmed, the already running instances run normally for what I have been able to test so far. Thank you so much

I was thinking about the issue you have with MQTT; it might be due to the MQTT version - I specify MQTT_5 in the connection options and SignalK might not support 5.

I compiled a version that uses MQTT 3. The version (attached) is "jbdtool version 1.8 build 202204111732." Please test against your MQTT server.
 

Attachments

Yes dear Melkier, you got it right.
The SignalK MQTT gateway still doesn't support ver. 5.
I am going to test it now.
 
@melkier well done mate!!
Very good, I love it.
I use SignalK as well, and I didn't see any comunication errors in the last 48 hours.

I have a question.
I would like to understand better about the Balance Function.

I see that in the Xiaoxiang app you can activate or deactivate the possibility to balance cells only during charge or always.
If this parameter is ON the bms balance cells only during charge, if this parameter is OFF the bms balance always.
I see the parameters available from your software for balancing are (using the '-l' parameter):
- BalanceStartVoltage
- BalanceWindow

Do you know the name of this parameters to set on/off the balancing?
Thanks
 
for balance, it's an eeprom parameter: BatteryConfig

use -r BatteryConfig to read it
-w BatteryConfig <value> to write it

use -n for numeric outout only (no translation)
 
I know its not wifi but for anyone curious I created a containerized docker version of BMS Tools / NodeJBD for ease of use:

 

diy solar

diy solar
Back
Top