diy solar

diy solar

Victron VenusOS driver for Bluetooth BMS

Yeah it seems a bit risky. I've got a smart shunt I can rely on. Appreciate your input

FWIW, the the shunt doesn't do any control. With DVCC enabled, you can activate SVS, SCS and STS (if a temperature sensor is installed), and the shunt data can be passed to all devices making battery voltage, current and temperature constant for all GX connected devices.

The BMS connected via RS485 or UART could actually control the system based on cell level triggers.
 
I ended up returning the batteries and getting the ones with RS485 connections on them. That gives me what I need for proper control
 
Hi All,
I have been using this in my Truck and it's been working well thanks @BradCagle for the project.
I built a new PI for a friend for his truck and tested it against one of my batteries and it worked fine.
His JBD 4s works ok with the APP on his iPhone but when it connects from the PI it pauses for a few seconds and then reports the following error:

root@raspberrypi2:/opt/victronenergy/dbus-btbattery# ./dbus-btbattery.py A4:C1:37:23:45:21
INFO:BluetoothBattery:Starting dbus-btbattery
INFO:BluetoothBattery:dbus-btbattery v0.1.3
INFO:BluetoothBattery:Connecting A4:C1:37:23:45:21
INFO:BluetoothBattery:0.0017201560000046356
INFO:BluetoothBattery:0.002624010000005228
INFO:BluetoothBattery:Connected A4:C1:37:23:45:21
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/opt/victronenergy/dbus-btbattery/jbdbt.py", line 105, in run
while self.bt.waitForNotifications(0.5):
File "/usr/lib/python3.8/site-packages/bluepy/btle.py", line 560, in waitForNotifications
resp = self._getResp(['ntfy','ind'], timeout)
File "/usr/lib/python3.8/site-packages/bluepy/btle.py", line 416, in _getResp
self.delegate.handleNotification(hnd, data)
File "/opt/victronenergy/dbus-btbattery/jbdbt.py", line 159, in handleNotification
self.cellData = self.cellData + data
TypeError: unsupported operand type(s) for +: 'NoneType' and 'bytes'
^[[B^[[INFO:BluetoothBattery:60.07307914399999

Any suggestions are gratefully received.
Thanks, Rich
 
Hello, I have seen that I need to modify commands in Nano to keep the JBD Bluetooth BMS connected or at least restart. I go to nano, but that is where I lose my way. I did see the part in the readme about making the change, but I don't see where to make that change. Any assistance would be greatly appreciated.
 
I created a Bluetooth version of @Louisvdw serial driver


It's still very early work-in-progress. It only supports JBD BMS at the moment.

Code is here: https://github.com/bradcagle/dbus-btbattery
Instructions on how to get it going is in the README.md



If you need to setup a Raspberry Pi you can watch my how-to video

Hi Brad, Thank you so much for the very helpful instructions! I am able to start the BT BMS in Venus OS but it shuts off as soon as I close Putty. I see the instructions for Nano, but I have no idea where to make the change. I would be very grateful for some directions for this.
Thank you!

To make dbus-btbattery startup automatically​

nano service/run
and replace 70:3e:97:08:00:62 with the Bluetooth address of your BMS/Battery
Save with "Ctrl O"
run ./installservice.sh
reboot
 
Last edited:
The most recent version has native BT support, but it must be configured to use it.

IMHO, I found that version more stable than Brad's version, but neither were stable enough for me to trust them.
 
Hi Brad, Thank you so much for the very helpful instructions! I am able to start the BT BMS in Venus OS but it shuts off as soon as I close Putty. I see the instructions for Nano, but I have no idea where to make the change. I would be very grateful for some directions for this.
Thank you!

To make dbus-btbattery startup automatically​

nano service/run
and replace 70:3e:97:08:00:62 with the Bluetooth address of your BMS/Battery
Save with "Ctrl O"
run ./installservice.sh
reboot

if you're in "/opt/victronenergy/dbus-btbattery" directory

you type "nano service/run"

replace 70:3e:97:08:00:62 with your bt address

hold ctrl + o, then hit enter to save

type ./installservice.sh

then type reboot
 
Hi All,
I have been using this in my Truck and it's been working well thanks @BradCagle for the project.
I built a new PI for a friend for his truck and tested it against one of my batteries and it worked fine.
His JBD 4s works ok with the APP on his iPhone but when it connects from the PI it pauses for a few seconds and then reports the following error:

root@raspberrypi2:/opt/victronenergy/dbus-btbattery# ./dbus-btbattery.py A4:C1:37:23:45:21
INFO:BluetoothBattery:Starting dbus-btbattery
INFO:BluetoothBattery:dbus-btbattery v0.1.3
INFO:BluetoothBattery:Connecting A4:C1:37:23:45:21
INFO:BluetoothBattery:0.0017201560000046356
INFO:BluetoothBattery:0.002624010000005228
INFO:BluetoothBattery:Connected A4:C1:37:23:45:21
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/opt/victronenergy/dbus-btbattery/jbdbt.py", line 105, in run
while self.bt.waitForNotifications(0.5):
File "/usr/lib/python3.8/site-packages/bluepy/btle.py", line 560, in waitForNotifications
resp = self._getResp(['ntfy','ind'], timeout)
File "/usr/lib/python3.8/site-packages/bluepy/btle.py", line 416, in _getResp
self.delegate.handleNotification(hnd, data)
File "/opt/victronenergy/dbus-btbattery/jbdbt.py", line 159, in handleNotification
self.cellData = self.cellData + data
TypeError: unsupported operand type(s) for +: 'NoneType' and 'bytes'
^[[B^[[INFO:BluetoothBattery:60.07307914399999

Any suggestions are gratefully received.
Thanks, Rich
Hi,

I had the same Problem and forked dbus-btbattery.
Here are my changes:
https://github.com/agilastic/dbus-btbattery/commit/1258e35d09016c18fe5d91922afc0c56fcdc931d
It works for me so far :)
Feel free to test it ;-)
 
Back
Top