Skip to content

Commit

Permalink
add sleep before starting driver
Browse files Browse the repository at this point in the history
prevents lot of timeouts after reinstalling the driver, since the restart is now much faster than before
  • Loading branch information
mr-manuel committed Oct 9, 2023
1 parent 8d8e793 commit fbd6094
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions etc/dbus-serialbattery/dbus-serialbattery.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ def get_port() -> str:

battery = get_battery(port)
else:
# wait some seconds to be sure that the serial connection is ready
# else the error throw a lot of timeouts
sleep(16)
battery = get_battery(port)

# exit if no battery could be found
Expand Down

3 comments on commit fbd6094

@beliffm
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it did not resolve the issue of the connection problems brought up in discussion #818 could you please revert this change because it makes my installation wait an unnessacery long time for the return of the lost serial connection.

@mr-manuel
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the driver is starting much faster then before, many drivers throw errors before starting again, since the BMS is not ready yet. The users then see the errors and think the driver isn't working stable anymore. I can add this to the config file, so you can change the default. Will this work for you?

@beliffm
Copy link

@beliffm beliffm commented on fbd6094 Oct 16, 2023 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.