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

TBEACON gone wild #519

Open
craigerl opened this issue Feb 19, 2024 · 0 comments
Open

TBEACON gone wild #519

craigerl opened this issue Feb 19, 2024 · 0 comments

Comments

@craigerl
Copy link

craigerl commented Feb 19, 2024

If the system clock jumps forward, direwolf will continuously transmit TBEACONS over and over that were scheduled during the missing time, jamming the channel. We saw this with PBEACON (see PBEACONS gone wild). Adding the same fix, below, should do the trick. This situation is common in a raspberry pi environment, when direwolf starts before the GPS gets the time, or before network connections are established.

beacon.c

                  else {
                    /* Stay with the schedule. */
                    /* Important for slotted.  Might reconsider otherwise. */
                    bp->next += bp->every;
+                   if ( bp->next < now ) {
+                        bp->next = now + bp->every;
+                        text_color_set(DW_COLOR_INFO);
+                        dw_printf("\nSystem clock appears to have jumped forward.  Beacon schedule updated.\n\n")
+                   }
                  }
                }
                else if (g_misc_config_p->sb_configured) {

and

                  bp->next = sb_calculate_next_time (now,
                        DW_KNOTS_TO_MPH(gpsinfo.speed_knots), gpsinfo.track,
                        sb_prev_time, sb_prev_course);
                }
                else {
                  /* Tracker beacon, fixed spacing. */
                  bp->next += bp->every;
+                 if ( bp->next < now ) {
+                      bp->next = now + bp->every;
+                      text_color_set(DW_COLOR_INFO);
+                      dw_printf("\nSystem clock appears to have jumped forward.  Beacon schedule updated.\n\n");
+                 }
                }
              }

-craig
KM6LYW

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

No branches or pull requests

1 participant