Skip to content

Draft: Python: Rework Heartbeating

Simon Spannagel requested to merge p-py-heartbeat-update into main

This is an attempt ot rework the Python heartbeat checker to work along the lines described in the docs. This means e.g. heartbeat checking should always happen and not just start and stop when launching.

  • the HeartbeatChecker derives now from BaseSatelliteFrame and uses their threading infrastructure
  • consequently, all manual start/stop methods have been removed
  • the common logger is used now, alleviates #150 for this case
  • the HeartbeatState now holds both the host UUID and the host name, because (currently) CHIRP only provides the UUID (for registering/unregistering) but the name is taken from the CHP messages and used e.g. for callbacks

Consequently, the Controller and Satellite class have been adapted.

There are a few things to do / to check:

  • I am a Python noob, especially when it comes to coding conventions - please review someone this and assign proper function names etc
  • I have tried to hook up the FSM interrupt method to the heartbeat checker, but it does simply nothing. I tried to directly call _transition but that's not part of the FSM but of the state handler where I don;t have access to (I believe)
  • Some things are (but have been!) a little wonky when satellites simply vanish (enter DEAD state) and reappear
  • None of the tests has been adapted yet.
Edited by Stephan Lachnit

Merge request reports