Dr-Gigavolt / dbus-aggregate-batteries

Virtual service to merge multiple serial batteries
MIT License
66 stars 11 forks source link

Trouble installing #64

Closed coca7 closed 6 months ago

coca7 commented 7 months ago

Hello,

I have had trouble installing bus-aggregate-batteries. I think I am making an error. I wasn't sure how to copy the files to /data/dbus-aggregate-batteries so I just did a wget together the files and then I untried and and renamed the directory and adjusted the settings. However, it doesn't seem to be running.

My setup is 3 JBD Bms each with 4x 230ah cells I have a smart shunt, but I have not yet moved it to the DC side of my setup.

coca7 commented 7 months ago

There is no log file in /data/dbus-aggregate-batteries or in /var/log after I installed, edited the settings.py and rc.local and rebooted.

Dr-Gigavolt commented 7 months ago

Hello, have you perhaps forgot to create the symbolic link? ln -s /data/dbus-aggregate-batteries/service /service/dbus-aggregate-batteries into /data/rc.local

I've just released the last commit, here you can download the stuff and "install" it according the Readme file. https://github.com/Dr-Gigavolt/dbus-aggregate-batteries/releases/tag/3.1.1-beta

Dr-Gigavolt commented 7 months ago

wget from /data should work too: sudo wget https://github.com/Dr-Gigavolt/dbus-aggregate-batteries/archive/refs/tags/3.1.1-beta.tar.gz sudo tar -xvf 3.1.1-beta.tar.gz sudo mv dbus-aggregate-batteries-3.1.1-beta dbus-aggregate-batteries cd dbus-aggregate-batteries sudo chmod 777 restart ./service/run

and then open /data/rc.local with a text editor and add ln -s /data/dbus-aggregate-batteries/service /service/dbus-aggregate-batteries line.

Dr-Gigavolt commented 7 months ago

The log file aggregatebatteries.log should be created in /data/dbus-aggregate-batteries

coca7 commented 7 months ago

I redid it as you suggested, and it seems to work now. I left out the "ln" from rc.local

Dr-Gigavolt commented 7 months ago

The line begins with ln (command), -s is a parameter. The permission 744 is ok (777 works as well, but unnecessarily too much rights).

coca7 commented 7 months ago

The driver runs, but it doesn't find any of the batteries. I think I have the DBUS settings wrong:

Here is what the log says:

INFO:dbusmonitor:===== Search on dbus for services that we will monitor starting... ===== INFO:dbusmonitor:Found: com.victronenergy.battery.ttyUSB2, scanning and storing items INFO:dbusmonitor: com.victronenergy.battery.ttyUSB2 has device instance 4 INFO:dbusmonitor:Found: com.victronenergy.settings, scanning and storing items INFO:dbusmonitor: com.victronenergy.settings has device instance 0 INFO:root:Mon Apr 8 13:26:01 2024: Searching Settings: Trial Nr. 1 INFO:dbusmonitor:Found: com.victronenergy.solarcharger.ttyS5, scanning and storing items INFO:root:Mon Apr 8 13:26:01 2024: com.victronenergy.settings found. INFO:dbusmonitor: com.victronenergy.solarcharger.ttyS5 has device instance 278 INFO:dbusmonitor:Found: com.victronenergy.solarcharger.ttyS6, scanning and storing items INFO:dbusmonitor: com.victronenergy.solarcharger.ttyS6 has device instance 279 INFO:dbusmonitor:Found: com.victronenergy.system, scanning and storing items INFO:dbusmonitor: com.victronenergy.system has device instance 0 INFO:dbusmonitor:Found: com.victronenergy.vebus.ttyS4, scanning and storing items INFO:dbusmonitor: com.victronenergy.vebus.ttyS4 has device instance 276 INFO:dbusmonitor:Found: com.victronenergy.battery.ttyS7, scanning and storing items INFO:dbusmonitor: com.victronenergy.battery.ttyS7 has device instance 277 INFO:dbusmonitor:Found: com.victronenergy.battery.aggregate, scanning and storing items INFO:dbusmonitor: com.victronenergy.battery.aggregate has device instance 0 INFO:dbusmonitor:Found: com.victronenergy.battery.ttyUSB0, scanning and storing items INFO:dbusmonitor: com.victronenergy.battery.ttyUSB0 has device instance 3 INFO:dbusmonitor:Found: com.victronenergy.battery.ttyUSB1, scanning and storing items INFO:dbusmonitor: com.victronenergy.battery.ttyUSB1 has device instance 2 INFO:dbusmonitor:===== Search on dbus for services that we will monitor finished ===== INFO:root:Mon Apr 8 13:26:06 2024: Searching batteries: Trial Nr. 1 INFO:root:Mon Apr 8 13:26:06 2024: 0 batteries found. INFO:root:Mon Apr 8 13:26:11 2024: Searching batteries: Trial Nr. 2 INFO:root:Mon Apr 8 13:26:11 2024: 0 batteries found.

Here is what I put in the settings.py

 BATTERY_SERVICE_NAME = 'com.victronenergy.battery' # Key world to identify services of physical Serial Batteries (and SmartShunt if available)
 BATTERY_PRODUCT_NAME_PATH = '/dev/ttyUSB'                  # Path of Battery Product Name
 BATTERY_PRODUCT_NAME = 'Battery'                  # Key world to identify the batteries (to exclude SmartShunt)
 BATTERY_INSTANCE_NAME_PATH = '/SerialBattery(LLT/JBD)'              # if CustomName doesn't exist, set '/ProductName'
 MULTI_KEY_WORD = 'com.victronenergy.vebus'              # Key world to identify service of Multis/Quattros (or cluster of them)
 MPPT_KEY_WORD = 'com.victronenergy.solarcharger'        # Key world to identify services of solar chargers
 SMARTSHUNT_NAME_KEY_WORD = 'SmartShunt'                 # Key world to identify services of SmartShunt

Here is what I have for one of my batteries in dbus-spy

Screenshot 2024-04-08 at 8 36 56 AM Screenshot 2024-04-08 at 8 36 32 AM
Dr-Gigavolt commented 7 months ago

The product name path is wrong. It is a dBus path, not driver path in Linux. The default is correct: BATTERY_PRODUCT_NAME_PATH = '/ProductName'