diy solar

diy solar

Victron VenusOS driver for Bluetooth BMS

This is awesome, thank you so much.

I have just used your driver to add my 2x Fogstar batteries to my system
View attachment 149323View attachment 149325

You're welcome.

Glad to see someone else trying the Virtual (series) battery.

BTW I've had some bluetooth lockups while connecting to two or more batteries. Seems to be the Bluetooth chip on the RasPI. I'm working on some watchdog code to reboot if stops receiving data after a period of time.
 
I've just had that happen twice today.
I fixed it with a reboot, so a watchdog to reboot would be great
View attachment 149413
Cool, I have the watchdog code in place and running. Just testing, and cleaning up. should be in soon.

Also you might try this updated bluetooth firmware if you're using RasPi. I think this has made lockups less frequent for me.
It's in the repo, so you probably already have it, and just need to run the install script
 
This is awesome. Installed and running now. I have two batteries in parallel so looking forward to updated support for that.

I am able to run two seperate processes to get two entries in the display running. Its not elegant or the right way to do it but it works.

I setup a second "service" for the second battery and modify the run command to point to the below dbus-btbattery(1|2).py files.

/opt/victronenergy/service/dbus-btbattery/run
and
/opt/victronenergy/service/dbus-btbattery2/run

I created two copys of both dbus-btbattery.py and jbdbt.py

dbus-btbattery1.py
jbdbt1.py
and
dbus-btbattery2.py
jbdbt2.py

jbdbt.py had line 155 editied with the new name for the display.
dbus-btbattery was edited to import the corisponding jbdbt(1|2).py file.

View attachment 144361
@emerge411 Might you be able to share more regarding this? I have Brad's solution up and running and it works great, especially with the automated reconnect. But I have another battery in parallel and your solution looks to be the only avenue at the moment. I am a novice at all of this SSH stuff, I know I need to jump into the files with a text editor but unsure what next steps would be.
 
Hi Brad, thanks for putting this together - comes as good timing given I've just built my own JK BMS based battery for my van.

I've got everything working while I'm logged in to my Pi via ssh, but if I close the SSH connection with the script running I lose connection to the battery, and setting it to autostart using the settings in your readme doesn't seem to work. Sorry if I'm being a total idiot here...

EDIT: Yes I was being a total idiot - I forgot to change directory before cloning the git repo. All working now - thanks for your hard work, its a great tool
 
Last edited:
all went fine until step 7 can you help?



root@raspberrypi4:~# pip3 install bluepy
Collecting bluepy
Using cached bluepy-1.3.0.tar.gz (217 kB)
Installing collected packages: bluepy
Running setup.py install for bluepy ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/var/volatile/tmp/pip-install-lvgt0ou9/bluepy/setup.py'"'"'; __file__='"'"'/var/volatile/tmp/pip-install-lvgt0ou9/bluepy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /var/volatile/tmp/pip-record-nyg2sk1o/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.8/bluepy
cwd: /var/volatile/tmp/pip-install-lvgt0ou9/bluepy/
Complete output (11 lines):
running install
running build
running build_py
Working dir is /var/volatile/tmp/pip-install-lvgt0ou9/bluepy
execute make -C ./bluepy clean
execute make -C bluepy -j1
Failed to compile bluepy-helper. Exiting install.
Command was 'make -C bluepy -j1' in /var/volatile/tmp/pip-install-lvgt0ou9/bluepy
Return code was 2
Output was:
b"make: Entering directory '/var/volatile/tmp/pip-install-lvgt0ou9/bluepy/bluepy'\ntar xzf bluez-src.tgz\ntouch ./bluez-5.47/lib/bluetooth.c ./bluez-5.47/lib/hci.c ./bluez-5.47/lib/sdp.c ./bluez-5.47/lib/uuid.c ./bluez-5.47/attrib/att.c ./bluez-5.47/attrib/gatt.c ./bluez-5.47/attrib/gattrib.c ./bluez-5.47/attrib/utils.c ./bluez-5.47/btio/btio.c ./bluez-5.47/src/log.c ./bluez-5.47/src/shared/mgmt.c ./bluez-5.47/src/shared/crypto.c ./bluez-5.47/src/shared/att.c ./bluez-5.47/src/shared/queue.c ./bluez-5.47/src/shared/util.c ./bluez-5.47/src/shared/io-glib.c ./bluez-5.47/src/shared/timeout-glib.c\ncc -L. -g -Wall -Os -DHAVE_CONFIG_H -I./bluez-5.47/attrib -I./bluez-5.47 -I./bluez-5.47/lib -I./bluez-5.47/src -I./bluez-5.47/gdbus -I./bluez-5.47/btio -I./bluez-5.47/sys -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -o bluepy-helper bluepy-helper.c ./bluez-5.47/lib/bluetooth.c ./bluez-5.47/lib/hci.c ./bluez-5.47/lib/sdp.c ./bluez-5.47/lib/uuid.c ./bluez-5.47/attrib/att.c ./bluez-5.47/attrib/gatt.c ./bluez-5.47/attrib/gattrib.c ./bluez-5.47/attrib/utils.c ./bluez-5.47/btio/btio.c ./bluez-5.47/src/log.c ./bluez-5.47/src/shared/mgmt.c ./bluez-5.47/src/shared/crypto.c ./bluez-5.47/src/shared/att.c ./bluez-5.47/src/shared/queue.c ./bluez-5.47/src/shared/util.c ./bluez-5.47/src/shared/io-glib.c ./bluez-5.47/src/shared/timeout-glib.c -lglib-2.0\ncc: fatal error: cannot execute \xe2\x80\x98cc1\xe2\x80\x99: execvp: No such file or directory\ncompilation terminated.\nmake: *** [Makefile:30: bluepy-helper] Error 1\nmake: Leaving directory '/var/volatile/tmp/pip-install-lvgt0ou9/bluepy/bluepy'\n"
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/var/volatile/tmp/pip-install-lvgt0ou9/bluepy/setup.py'"'"'; __file__='"'"'/var/volatile/tmp/pip-install-lvgt0ou9/bluepy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /var/volatile/tmp/pip-record-nyg2sk1o/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python3.8/bluepy Check the logs for full command output.
 
Will this driver work on a Cerbo GX? I have 3 AOLithium 100Ah / 12v batteries with the JDB BMS and bluetooth is the only connection option.

Also, I have only limited experience in this area… is this something I should be attempting?
 
@BradCagle This was working fantastic for me with my Cerbo GX (albeit every once in a while it would disconnect and throw errors, but it would fix itself after rebooting for some time) but now I cannot get it to work any longer.
 
@BradCagle This was working fantastic for me with my Cerbo GX (albeit every once in a while it would disconnect and throw errors, but it would fix itself after rebooting for some time) but now I cannot get it to work any longer.

Have you tried to power cycle your Cerbo GX? I sometimes have to do a full power cycle on mine.
 
Hey all

I wanted to chime in on this discussion to see if there is any possibility of making this work with my set-up.

I have just received my 4 Renogy Bluetooth batteries ($499 CDN ea) and I was hoping i could integrate them into my Cerbo but I'm not too sure how to go about it. I know the smart batteries can be accessed via the rs485 connection using the serial driver, so I would assume that we could do the same with this setup as long as I can get a connection to the batteries.

I'm quite computer saavy, but not a programmer. If someone would like to shepherd me through this, hopefully we could be able to offer this to the community. I'm suspecting these batteries will become quite popular considering the price point.
 
IIRC, @BradCagle isn't developing it anymore, and @Louisvdw 's version now supports bluetooth.


Renogy is on the BMS support list.

Recommend you scour the site and make your best effort:


Multiple batteries require additional drivers:


I will state that I found the bluetooth reliability to be unacceptable from either source; however, in the newer Venus OS, it could be installed as a battery monitor only without actual control of the system. I would likely be willing to use bluetooth that way.

I'm using a JBD with UART to USB adapter to a RPi running Venus 3.10 with @Louisvdw 's driver. It is not interfaced with any other Victron equipment - simply a test system. Here's a 30 day plot for giggles:

1697146292319.png

I would consider putting this battery in control of a Victron system via direct UART to USB connection.

Also worth exploring:

 
IIRC, @BradCagle isn't developing it anymore, and @Louisvdw 's version now supports bluetooth.


Renogy is on the BMS support list.

Recommend you scour the site and make your best effort:


Multiple batteries require additional drivers:


I will state that I found the bluetooth reliability to be unacceptable from either source; however, in the newer Venus OS, it could be installed as a battery monitor only without actual control of the system. I would likely be willing to use bluetooth that way.

I'm using a JBD with UART to USB adapter to a RPi running Venus 3.10 with @Louisvdw 's driver. It is not interfaced with any other Victron equipment - simply a test system. Here's a 30 day plot for giggles:

View attachment 172011

I would consider putting this battery in control of a Victron system via direct UART to USB connection.

Also worth exploring:

Thank you for all the links. I will do some exploring.
 
IIRC, @BradCagle isn't developing it anymore, and @Louisvdw 's version now supports bluetooth.


Renogy is on the BMS support list.

Recommend you scour the site and make your best effort:


Multiple batteries require additional drivers:


I will state that I found the bluetooth reliability to be unacceptable from either source; however, in the newer Venus OS, it could be installed as a battery monitor only without actual control of the system. I would likely be willing to use bluetooth that way.

I'm using a JBD with UART to USB adapter to a RPi running Venus 3.10 with @Louisvdw 's driver. It is not interfaced with any other Victron equipment - simply a test system. Here's a 30 day plot for giggles:

View attachment 172011

I would consider putting this battery in control of a Victron system via direct UART to USB connection.

Also worth exploring:

I see with the initial overview of the github that although @Louisvdw's project supports the Renogy BMS as well as Bluetooth, it does not support Renogy over bluetooth, only JKBMS/Heltec and Smart BMS. This looks like it may require some development.
1697150481120.png
 
I see with the initial overview of the github that although @Louisvdw's project supports the Renogy BMS as well as Bluetooth, it does not support Renogy over bluetooth, only JKBMS/Heltec and Smart BMS. This looks like it may require some development.

You are correct. In addition to the documentation, it is clear in the configuration file that the BT is only available for JK and JBD.

Again, I would discourage use of BT. If you can connect via RS485 or UART, that's the preferred method by far. You don't want to have to reboot your GX device regularly to maintain contact with the BMS(s).
 
You are correct. In addition to the documentation, it is clear in the configuration file that the BT is only available for JK and JBD.

Again, I would discourage use of BT. If you can connect via RS485 or UART, that's the preferred method by far. You don't want to have to reboot your GX device regularly to maintain contact with the BMS(s).
I agree, bluetooth isn't the best option, but the bluetooth smart batteries don't have a hard wired option or I would go that route. I (incorrectly) made the assumption when I purchased the batteries that they would have the 485 connection, but they do not. I was a bit surprised when I unboxed to find a portless battery.
 
I agree, bluetooth isn't the best option, but the bluetooth smart batteries don't have a hard wired option or I would go that route. I (incorrectly) made the assumption when I purchased the batteries that they would have the 485 connection, but they do not. I was a bit surprised when I unboxed to find a portless battery.

then I would encourage you to disable BMS control in Venus OS 3.10 and only use the GX/VRM for battery monitoring. I absolutely, positively would not put a BT connected BMS in control of my system.
 
then I would encourage you to disable BMS control in Venus OS 3.10 and only use the GX/VRM for battery monitoring. I absolutely, positively would not put a BT connected BMS in control of my system.
Yeah it seems a bit risky. I've got a smart shunt I can rely on. Appreciate your input
 
Back
Top