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

Fixes #838

Merged
merged 2 commits into from
Oct 9, 2023
Merged

Fixes #838

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions etc/dbus-serialbattery/config.default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,23 @@ SOC_RESET_VOLTAGE = 3.650
SOC_RESET_AFTER_DAYS =

; --------- Bluetooth BMS ---------
; Description: List the Bluetooth BMS here that you want to install
; Description: Specify the Bluetooth BMS and it's MAC address that you want to install. Leave emty to disable
; -- Available Bluetooth BMS:
; Jkbms_Ble, LltJbd_Ble
; Example:
; 1 BMS: Jkbms_Ble C8:47:8C:00:00:00
; 3 BMS: Jkbms_Ble C8:47:8C:00:00:00, Jkbms_Ble C8:47:8C:00:00:11, Jkbms_Ble C8:47:8C:00:00:22
; Example for one BMS:
; BLUETOOTH_BMS = Jkbms_Ble C8:47:8C:00:00:00
; Example for multiple BMS:
; BLUETOOTH_BMS = Jkbms_Ble C8:47:8C:00:00:00, Jkbms_Ble C8:47:8C:00:00:11, Jkbms_Ble C8:47:8C:00:00:22
BLUETOOTH_BMS =

; --------- CAN BMS ---------
; Description: Specify the CAN port(s) where the BMS is connected to. Leave empty to disable
; -- Available CAN BMS:
; Daly_Can, Jkbms_Can
; Example:
; can0
; can0, can8, can9
; Example for one CAN port:
; CAN_PORT = can0
; Example for multiple CAN ports:
; CAN_PORT = can0, can8, can9
CAN_PORT =

; --------- BMS disconnect behaviour ---------
Expand Down
10 changes: 4 additions & 6 deletions etc/dbus-serialbattery/reinstall-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,8 @@ echo "SERIAL battery connection: The installation is complete. You don't have to
echo
echo "BLUETOOTH battery connection: There are a few more steps to complete installation."
echo
echo " 1. Please add the Bluetooth BMS to the config file \"/data/etc/dbus-serialbattery/config.ini\" by adding \"BLUETOOTH_BMS\" = "
echo " Example with 1 BMS: BLUETOOTH_BMS = Jkbms_Ble C8:47:8C:00:00:00"
echo " Example with 3 BMS: BLUETOOTH_BMS = Jkbms_Ble C8:47:8C:00:00:00, Jkbms_Ble C8:47:8C:00:00:11, Jkbms_Ble C8:47:8C:00:00:22"
echo " 1. Add your Bluetooth BMS to the config file \"/data/etc/dbus-serialbattery/config.ini\"."
echo " Check the default config file \"/data/etc/dbus-serialbattery/config.default.ini\" for more informations."
echo " If your Bluetooth BMS are nearby you can show the MAC address with \"bluetoothctl devices\"."
echo
echo " 2. Make sure to disable Bluetooth in \"Settings -> Bluetooth\" in the remote console/GUI to prevent reconnects every minute."
Expand All @@ -448,9 +447,8 @@ echo " See https://wiki.debian.org/BluetoothUser#Using_bluetoothctl for more
echo
echo "CAN battery connection: There are a few more steps to complete installation."
echo
echo " 1. Please add the CAN port to the config file \"/data/etc/dbus-serialbattery/config.ini\" by adding \"CAN_PORT\" = "
echo " Example with 1 CAN port: CAN_PORT = can0"
echo " Example with 3 CAN port: CAN_PORT = can0, can8, can9"
echo " 1. Add your CAN port to the config file \"/data/etc/dbus-serialbattery/config.ini\"."
echo " Check the default config file \"/data/etc/dbus-serialbattery/config.default.ini\" for more informations."
echo
echo " 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."
echo
Expand Down
10 changes: 5 additions & 5 deletions etc/dbus-serialbattery/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,19 @@ def _get_list_from_config(


# Constants
DRIVER_VERSION = "1.0.20231009dev"
DRIVER_VERSION = "1.0.20231010dev"
zero_char = chr(48)
degree_sign = "\N{DEGREE SIGN}"

# get logging level from config file
if config["DEFAULT"]["LOGGING"] == "ERROR":
logging.basicConfig(level=logging.ERROR)
logger.setLevel(logging.ERROR)
elif config["DEFAULT"]["LOGGING"] == "WARNING":
logging.basicConfig(level=logging.WARNING)
logger.setLevel(logging.WARNING)
elif config["DEFAULT"]["LOGGING"] == "DEBUG":
logging.basicConfig(level=logging.DEBUG)
logger.setLevel(logging.DEBUG)
else:
logging.basicConfig(level=logging.INFO)
logger.setLevel(logging.INFO)

# save config values to constants

Expand Down