Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-manuel committed Jun 10, 2023
1 parent 68bd0a5 commit fed6ca7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion etc/dbus-serialbattery/dbus-serialbattery.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def get_port() -> str:
else:
# just for MNB-SPI
logger.info("No Port needed")
return "/dev/tty/USB9"
return "/dev/ttyUSB9"

logger.info("dbus-serialbattery v" + str(utils.DRIVER_VERSION))

Expand Down
21 changes: 12 additions & 9 deletions etc/dbus-serialbattery/reinstall-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ if [ ! -f "$filename" ]; then
fi

# kill driver, if running. It gets restarted by the service daemon
pkill -f "python .*/dbus-serialbattery.py$"
pkill -f "python .*/dbus-serialbattery.py /dev/tty.*"



Expand All @@ -145,16 +145,18 @@ IFS="," read -r -a bms_array <<< "$bluetooth_bms_clean"
length=${#bms_array[@]}
# echo $length

# stop all dbus-blebattery services
svc -u /service/dbus-blebattery.*
# stop all dbus-blebattery services, if at least one exists
if [ -d "/service/dbus-blebattery.0" ]; then
svc -u /service/dbus-blebattery.*

# always remove existing blebattery services to cleanup
rm -rf /service/dbus-blebattery.*
# always remove existing blebattery services to cleanup
rm -rf /service/dbus-blebattery.*

# kill all blebattery processes that remain
pkill -f "supervise dbus-blebattery.*"
pkill -f "multilog .* /var/log/dbus-blebattery.*"
pkill -f "python .*/dbus-serialbattery.py .*_Ble"
# kill all blebattery processes that remain
pkill -f "supervise dbus-blebattery.*"
pkill -f "multilog .* /var/log/dbus-blebattery.*"
pkill -f "python .*/dbus-serialbattery.py .*_Ble"
fi


if [ "$length" -gt 0 ]; then
Expand Down Expand Up @@ -247,6 +249,7 @@ else
# remove cronjob
sed -i "/5 0,12 \* \* \* \/etc\/init.d\/bluetooth restart/d" /var/spool/cron/root

echo
echo "No Bluetooth battery configuration found in \"/data/etc/dbus-serialbattery/config.ini\"."
echo "You can ignore this, if you are using only a serial connection."
echo
Expand Down
2 changes: 1 addition & 1 deletion etc/dbus-serialbattery/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def _get_list_from_config(
# if not specified: baud = 9600

# Constants - Need to dynamically get them in future
DRIVER_VERSION = "1.0.20230608dev"
DRIVER_VERSION = "1.0.20230610dev"
zero_char = chr(48)
degree_sign = "\N{DEGREE SIGN}"

Expand Down

0 comments on commit fed6ca7

Please sign in to comment.