Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes 2023.07.23 #757

Merged
merged 4 commits into from
Jul 23, 2023
Merged

Changes 2023.07.23 #757

merged 4 commits into from
Jul 23, 2023

Conversation

mr-manuel
Copy link
Collaborator

  • Added: Current average of the last 5 minutes by @mr-manuel
  • Added: Temperature names to dbus and mqtt by @mr-manuel
  • Added: Use current average of the last 300 cycles for time to go and time to SoC calculation by @mr-manuel
  • Changed: Time-to-Go and Time-to-SoC use the current average of the last 5 minutes for calculation by @mr-manuel
  • Changed: Time-to-SoC calculate only positive points by @mr-manuel

@apharcha
Copy link

Hello! I had been struggling to get it working but I just pulled the Nightlies from Dev / Mr-Manualel and everything worked beautifully right after I did the install. However, when I reboot the RPI - everything disappears.

So this is from all installed on 3.15 of VenusOS and I installed the nightly for dbus-serialbattery and now having issues on reboot

  • the driver is not getting re-installed. Come to find out there's an error in /data/rc.local as the command to start the driver is placed after "exit 0" so it never runs on startup. Please take a look at the rc.local how it's being created:

The following is my file for rc.local to get it running
(I moved the exit 0 to bottom - however when the reinstall-local.sh runs, it's put it again before)

root@raspberrypi2:~# tail /data/rc.local

/data/tft35_scripts/fbcp /dev/fb2 &
/data/tft35_scripts/backlightCtrl /dev/input/touchscreen0 45 &

sleep 5
#bash /data/etc/dbus-serialbattery/reinstall-local.sh
#/data/etc/dbus-serialbattery/reinstall-local.sh
bash /data/etc/dbus-serialbattery/reinstall-local.sh

exit 0

example:
root@raspberrypi2:~# bash /data/etc/dbus-serialbattery/reinstall-local.sh

Found 2 Bluetooth BMS in the config file!

Stopping bluetooth: bluetoothd.

Installing required packages to use Bluetooth connection...
Downloading https://updates.victronenergy.com/feeds/venus/release/packages/dunfell/all/Packages.gz.
Updated source 'all'.
Downloading https://updates.victronenergy.com/feeds/venus/release/packages/dunfell/cortexa7hf-neon-vfpv4/Packages.gz.
Updated source 'cortexa7hf-neon-vfpv4'.
Downloading https://updates.victronenergy.com/feeds/venus/release/packages/dunfell/raspberrypi2/Packages.gz.
Updated source 'raspberrypi2'.
No packages installed or removed.

Requirement already satisfied: bleak in /usr/lib/python3.8/site-packages (0.21.1)
Requirement already satisfied: async-timeout<5,>=3.0.0; python_version < "3.11" in /usr/lib/python3.8/site-packages (from bleak) (4.0.3)
Requirement already satisfied: dbus-fast<3,>=1.83.0; platform_system == "Linux" in /usr/lib/python3.8/site-packages (from bleak) (2.21.1)
Requirement already satisfied: typing-extensions>=4.7.0; python_version < "3.12" in /usr/lib/python3.8/site-packages (from bleak) (4.9.0)
done.

Starting bluetooth: bluetoothd.

Installing "Jkbms_Ble" with MAC address "C8:47:80:05:EC:DC" as dbus-blebattery.0
Installing "Jkbms_Ble" with MAC address "C8:47:80:07:3D:E8" as dbus-blebattery.1

No CAN port configuration found in "/data/etc/dbus-serialbattery/config.ini".
You can ignore this, if you are using only a serial connection.

#################

Install notes

#################

SERIAL battery connection: The installation is complete. You don't have to do anything more.

BLUETOOTH battery connection: There are a few more steps to complete installation.

1. Add your Bluetooth BMS to the config file "/data/etc/dbus-serialbattery/config.ini".
   Check the default config file "/data/etc/dbus-serialbattery/config.default.ini" for more informations.
   If your Bluetooth BMS are nearby you can show the MAC address with "bluetoothctl devices".

2. Make sure to disable Bluetooth in "Settings -> Bluetooth" in the remote console/GUI to prevent reconnects every minute.

3. Re-run "/data/etc/dbus-serialbattery/reinstall-local.sh", if the Bluetooth BMS were not added to the "config.ini" before.

ATTENTION!
If you changed the default connection PIN of your BMS, then you have to pair the BMS first using OS tools like the "bluetoothctl".
See https://wiki.debian.org/BluetoothUser#Using_bluetoothctl for more details.

CAN battery connection: There are a few more steps to complete installation.

1. Add your CAN port to the config file "/data/etc/dbus-serialbattery/config.ini".
   Check the default config file "/data/etc/dbus-serialbattery/config.default.ini" for more informations.

2. Make sure to select a profile with 250 kbit/s in "Settings -> Services -> VE.Can port -> CAN-bus profile" in the remote console/GUI.

3. Re-run "/data/etc/dbus-serialbattery/reinstall-local.sh", if the CAN port was not added to the "config.ini" before.

CUSTOM SETTINGS: If you want to add custom settings, then check the settings you want to change in "/data/etc/dbus-serialbattery/config.default.ini"
and add them to "/data/etc/dbus-serialbattery/config.ini" to persist future driver updates.

@apharcha
Copy link

After I reboot, I guess it takes ~5 minutes for the services to come up for blebattery and inbetween it might be generating errors about BMS not being available...
who: invalid option -- 'b'
BusyBox v1.31.1 (2023-12-05 22:25:37 UTC) multi-call binary.

Usage: who [-a]
root@raspberrypi2:# who
root pts/1 00:00 Jan 20 19:40:21 192.168.7.17
root@raspberrypi2:
# who -b
who: invalid option -- 'b'
BusyBox v1.31.1 (2023-12-05 22:25:37 UTC) multi-call binary.

Usage: who [-a]
root@raspberrypi2:# uptime
19:40:37 up 2 min, load average: 7.84, 4.59, 1.82
root@raspberrypi2:
# svstat /service/dbus-blebattery.*
/service/dbus-blebattery.0: up (pid 2653) 3 seconds
/service/dbus-blebattery.1: unable to open supervise/ok: file does not exist
root@raspberrypi2:# svstat /service/dbus-blebattery.*
/service/dbus-blebattery.0: up (pid 2653) 8 seconds
/service/dbus-blebattery.1: up (pid 2679) 4 seconds
root@raspberrypi2:
# svstat /service/dbus-blebattery.*
/service/dbus-blebattery.0: up (pid 2653) 10 seconds
/service/dbus-blebattery.1: up (pid 2679) 6 seconds
root@raspberrypi2:# svstat /service/dbus-blebattery.*
/service/dbus-blebattery.0: up (pid 2653) 132 seconds
/service/dbus-blebattery.1: up (pid 2679) 128 seconds
root@raspberrypi2:
# uptime
19:42:58 up 5 min, load average: 3.72, 4.40, 2.16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants