Skip to content

pigeond: power cycle on reinit #35684

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

Merged
merged 3 commits into from
Jul 11, 2025
Merged

pigeond: power cycle on reinit #35684

merged 3 commits into from
Jul 11, 2025

Conversation

adeebshihadeh
Copy link
Contributor

@adeebshihadeh adeebshihadeh commented Jul 11, 2025

I shuffled some stuff around, but the actual change here is a power cycle for the re-init that seems to have gotten lost in the pigeond rewrite from a few years ago.


Unclear whether this actually changes anything, but I think it's more correct. I just noticed it after looking into some cases where the ublox raw messages are spaced multiple seconds apart, and in those cases pigeond is stuck re-initting for the whole route.

f4b52a2dabf77c7d/00000016--2af65039a3
image

last_almanac_save = time.monotonic()
while end_condition():
while (duration == 0) or (time.monotonic() - start_time < duration):
dat = pigeon.receive()
if len(dat) > 0:
if dat[0] == 0x00:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@robbederks you remember why this is here? I don't see why this on its own would be indicative of corrupt data (e.g. what enforces that you're getting the start of a ublox packet?)

@adeebshihadeh adeebshihadeh merged commit fb4d9c5 into master Jul 11, 2025
15 of 16 checks passed
@adeebshihadeh adeebshihadeh deleted the pigeon-init branch July 11, 2025 02:36
@adeebshihadeh
Copy link
Contributor Author

Confirmed that once you hit this, you end up in a loop:

diff --git a/system/ubloxd/pigeond.py b/system/ubloxd/pigeond.py
index 2194a4b..58cf410 100755
--- a/system/ubloxd/pigeond.py
+++ b/system/ubloxd/pigeond.py
@@ -281,10 +281,12 @@ def run_receiving(pigeon: TTYPigeon, pm: messaging.PubMaster, duration: int = 0)
   def end_condition():
     return True if duration == 0 else time.monotonic() - start_time < duration

+  import random
+  done = False
   while end_condition():
     dat = pigeon.receive()
     if len(dat) > 0:
-      if dat[0] == 0x00:
+      if not done and random.randint(0, 200) > 180:
         cloudlog.warning("received invalid data from ublox, re-initing!")
         init_baudrate(pigeon)
         initialize_pigeon(pigeon)

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.

1 participant