Skip to content

Conversation

@fifieldt
Copy link
Member

There are certain GPS chips that have a hard-coded time in firmware that they will return before lock. We set our own hard-coded time, BUILD_EPOCH, that should be newer and use the comparison to not set a bad time.

In #7261 we introduced the RTCSetResult and improved it in #7375 .

However, the original try-fix left logic in GPS.cpp that could still result in broadcasting the bad time.

Further, as part of our fix we cleared the GPS buffer if we didn't get a good time. The mesh was hurting at the time, so this was a reasonable approach. However, given time tends to come in when we're trying to get early lock, this had the potential side effect of throwing away valuable information to get position lock.

This change reverses the clearBuffer and changes the logic so if time is not set it will not be broadcast.

Fixes #7771
Fixes #7750

@fifieldt fifieldt marked this pull request as draft August 27, 2025 23:39
@fifieldt
Copy link
Member Author

(testing)

@fifieldt fifieldt added the bugfix Pull request that fixes bugs label Aug 27, 2025
There are certain GPS chips that have a hard-coded time in firmware
that they will return before lock. We set our own hard-coded time,
BUILD_EPOCH, that should be newer and use the comparison to not set
a bad time.

In meshtastic#7261 we introduced
the RTCSetResult and improved it in meshtastic#7375 .

However, the original try-fix left logic in GPS.cpp that could
still result in broadcasting the bad time.

Further, as part of our fix we cleared the GPS buffer if we didn't
get a good time. The mesh was hurting at the time, so this was a reasonable
approach. However, given time tends to come in when we're trying to get
early lock, this had the potential side effect of throwing away valuable
information to get position lock.

This change reverses the clearBuffer and changes the logic so if time
is not set it will not be broadcast.

Fixes meshtastic#7771
Fixes meshtastic#7750
@fifieldt fifieldt force-pushed the time-like-its-2025 branch from 1f328c9 to e791f66 Compare August 27, 2025 23:41
@fifieldt
Copy link
Member Author

fifieldt commented Aug 28, 2025

My GPS testing list:

  • Seeed Tracker WM1110 w/ Air530 (L76K)
  • Seeed 1000e w/ AG3335
  • Heltec T114 with AGTM3332D
  • Heltec T114 with Ublox 10 (BE180)
  • Heltec T114 with Ublox 9
  • Heltec T114 with Ublox 7 (BK-122)
  • Heltec T114 with Ublox 6
  • Heltec Wireless Tracker with UC6580
  • LilyGo TBeam with Ublox 6

@fifieldt
Copy link
Member Author

No regressions on 3 common chips, marking as ready for review

@fifieldt fifieldt marked this pull request as ready for review August 28, 2025 01:40
@b8b8
Copy link

b8b8 commented Aug 28, 2025

Seems OK on T1000E after testing.

@thebentern
Copy link
Contributor

Looks good. Seems like a fix we'd want to target at master?

@fifieldt
Copy link
Member Author

Looks good. Seems like a fix we'd want to target at master?

Probably ... but I don't know when to do develop and when to do master at this stage :) Help!

fifieldt added a commit to fifieldt/meshtastic-firmware that referenced this pull request Aug 28, 2025
Further to meshtastic#7772 ,
we discovered that some RTCs have hard-coded start times well in the
past.

This patch gives RTCs the same treatment as GPS - if the time is
earlier than BUILD_EPOCH, we don't use it.

Fixes meshtastic#7771
Fixes meshtastic#7750
fifieldt added a commit to fifieldt/meshtastic-firmware that referenced this pull request Aug 28, 2025
Further to meshtastic#7772 ,
we discovered that some RTCs have hard-coded start times well in the
past.

This patch gives RTCs the same treatment as GPS - if the time is
earlier than BUILD_EPOCH, we don't use it.

Fixes meshtastic#7771
Fixes meshtastic#7750
@thebentern thebentern merged commit 5f8503c into meshtastic:develop Aug 29, 2025
77 checks passed
thebentern pushed a commit that referenced this pull request Aug 29, 2025
There are certain GPS chips that have a hard-coded time in firmware
that they will return before lock. We set our own hard-coded time,
BUILD_EPOCH, that should be newer and use the comparison to not set
a bad time.

In #7261 we introduced
the RTCSetResult and improved it in #7375 .

However, the original try-fix left logic in GPS.cpp that could
still result in broadcasting the bad time.

Further, as part of our fix we cleared the GPS buffer if we didn't
get a good time. The mesh was hurting at the time, so this was a reasonable
approach. However, given time tends to come in when we're trying to get
early lock, this had the potential side effect of throwing away valuable
information to get position lock.

This change reverses the clearBuffer and changes the logic so if time
is not set it will not be broadcast.

Fixes #7771
Fixes #7750
thebentern added a commit that referenced this pull request Aug 29, 2025
* Merge pull request #7777 from meshtastic/create-pull-request/bump-version

Bump release version

* Only send Neighbours if we have some to send. (#7493)

* Only send Neighbours if we have some to send.

The original intent of NeighborInfo was that when a NeighbourInfo
was sent all of the nodes that saw it would reply with NeighbourInfo.
So, NeighbourInfo was sent even if there were no hop-zero nodes in
the NodeDB.

Since 2023, when this was implemented, our understanding of running city-wide
meshes has improved substantially. We have taken steps to reduce the impact
of NeighborInfo over LoRa.

This change aligns with those ideas: we will now only send NeighborInfo
if we have some neighbors to contribute.

The impact of this change is that a node must first see another directly
connected node in another packet type before NeighborInfo is sent. This means
that a node with no neighbors is no longer able to trigger other nodes
to broadcast NeighborInfo. It will, however, receive the regular periodic
broadcast of NeighborInfo, and will be able to send NeighborInfo if it
has at least 1 neighbor.

* Include all the things

* AvOid memleak

* We don't gotTime if time is 2019. (#7772)

There are certain GPS chips that have a hard-coded time in firmware
that they will return before lock. We set our own hard-coded time,
BUILD_EPOCH, that should be newer and use the comparison to not set
a bad time.

In #7261 we introduced
the RTCSetResult and improved it in #7375 .

However, the original try-fix left logic in GPS.cpp that could
still result in broadcasting the bad time.

Further, as part of our fix we cleared the GPS buffer if we didn't
get a good time. The mesh was hurting at the time, so this was a reasonable
approach. However, given time tends to come in when we're trying to get
early lock, this had the potential side effect of throwing away valuable
information to get position lock.

This change reverses the clearBuffer and changes the logic so if time
is not set it will not be broadcast.

Fixes #7771
Fixes #7750

---------

Co-authored-by: Tom Fifield <[email protected]>
thebentern pushed a commit that referenced this pull request Aug 29, 2025
Further to #7772 ,
we discovered that some RTCs have hard-coded start times well in the
past.

This patch gives RTCs the same treatment as GPS - if the time is
earlier than BUILD_EPOCH, we don't use it.

Fixes #7771
Fixes #7750
thebentern pushed a commit that referenced this pull request Aug 29, 2025
Further to #7772 ,
we discovered that some RTCs have hard-coded start times well in the
past.

This patch gives RTCs the same treatment as GPS - if the time is
earlier than BUILD_EPOCH, we don't use it.

Fixes #7771
Fixes #7750
alexl83 pushed a commit to alexl83/firmware that referenced this pull request Sep 2, 2025
There are certain GPS chips that have a hard-coded time in firmware
that they will return before lock. We set our own hard-coded time,
BUILD_EPOCH, that should be newer and use the comparison to not set
a bad time.

In meshtastic#7261 we introduced
the RTCSetResult and improved it in meshtastic#7375 .

However, the original try-fix left logic in GPS.cpp that could
still result in broadcasting the bad time.

Further, as part of our fix we cleared the GPS buffer if we didn't
get a good time. The mesh was hurting at the time, so this was a reasonable
approach. However, given time tends to come in when we're trying to get
early lock, this had the potential side effect of throwing away valuable
information to get position lock.

This change reverses the clearBuffer and changes the logic so if time
is not set it will not be broadcast.

Fixes meshtastic#7771
Fixes meshtastic#7750
alexl83 pushed a commit to alexl83/firmware that referenced this pull request Sep 2, 2025
Further to meshtastic#7772 ,
we discovered that some RTCs have hard-coded start times well in the
past.

This patch gives RTCs the same treatment as GPS - if the time is
earlier than BUILD_EPOCH, we don't use it.

Fixes meshtastic#7771
Fixes meshtastic#7750
mehow pushed a commit to mehow/meshtastic-firmware that referenced this pull request Sep 5, 2025
There are certain GPS chips that have a hard-coded time in firmware
that they will return before lock. We set our own hard-coded time,
BUILD_EPOCH, that should be newer and use the comparison to not set
a bad time.

In meshtastic#7261 we introduced
the RTCSetResult and improved it in meshtastic#7375 .

However, the original try-fix left logic in GPS.cpp that could
still result in broadcasting the bad time.

Further, as part of our fix we cleared the GPS buffer if we didn't
get a good time. The mesh was hurting at the time, so this was a reasonable
approach. However, given time tends to come in when we're trying to get
early lock, this had the potential side effect of throwing away valuable
information to get position lock.

This change reverses the clearBuffer and changes the logic so if time
is not set it will not be broadcast.

Fixes meshtastic#7771
Fixes meshtastic#7750
mehow pushed a commit to mehow/meshtastic-firmware that referenced this pull request Sep 5, 2025
Further to meshtastic#7772 ,
we discovered that some RTCs have hard-coded start times well in the
past.

This patch gives RTCs the same treatment as GPS - if the time is
earlier than BUILD_EPOCH, we don't use it.

Fixes meshtastic#7771
Fixes meshtastic#7750
pkoryzna pushed a commit to pkoryzna/meshtastic-firmware-why2025-carrier that referenced this pull request Sep 13, 2025
There are certain GPS chips that have a hard-coded time in firmware
that they will return before lock. We set our own hard-coded time,
BUILD_EPOCH, that should be newer and use the comparison to not set
a bad time.

In meshtastic#7261 we introduced
the RTCSetResult and improved it in meshtastic#7375 .

However, the original try-fix left logic in GPS.cpp that could
still result in broadcasting the bad time.

Further, as part of our fix we cleared the GPS buffer if we didn't
get a good time. The mesh was hurting at the time, so this was a reasonable
approach. However, given time tends to come in when we're trying to get
early lock, this had the potential side effect of throwing away valuable
information to get position lock.

This change reverses the clearBuffer and changes the logic so if time
is not set it will not be broadcast.

Fixes meshtastic#7771
Fixes meshtastic#7750
pkoryzna pushed a commit to pkoryzna/meshtastic-firmware-why2025-carrier that referenced this pull request Sep 13, 2025
* Merge pull request meshtastic#7777 from meshtastic/create-pull-request/bump-version

Bump release version

* Only send Neighbours if we have some to send. (meshtastic#7493)

* Only send Neighbours if we have some to send.

The original intent of NeighborInfo was that when a NeighbourInfo
was sent all of the nodes that saw it would reply with NeighbourInfo.
So, NeighbourInfo was sent even if there were no hop-zero nodes in
the NodeDB.

Since 2023, when this was implemented, our understanding of running city-wide
meshes has improved substantially. We have taken steps to reduce the impact
of NeighborInfo over LoRa.

This change aligns with those ideas: we will now only send NeighborInfo
if we have some neighbors to contribute.

The impact of this change is that a node must first see another directly
connected node in another packet type before NeighborInfo is sent. This means
that a node with no neighbors is no longer able to trigger other nodes
to broadcast NeighborInfo. It will, however, receive the regular periodic
broadcast of NeighborInfo, and will be able to send NeighborInfo if it
has at least 1 neighbor.

* Include all the things

* AvOid memleak

* We don't gotTime if time is 2019. (meshtastic#7772)

There are certain GPS chips that have a hard-coded time in firmware
that they will return before lock. We set our own hard-coded time,
BUILD_EPOCH, that should be newer and use the comparison to not set
a bad time.

In meshtastic#7261 we introduced
the RTCSetResult and improved it in meshtastic#7375 .

However, the original try-fix left logic in GPS.cpp that could
still result in broadcasting the bad time.

Further, as part of our fix we cleared the GPS buffer if we didn't
get a good time. The mesh was hurting at the time, so this was a reasonable
approach. However, given time tends to come in when we're trying to get
early lock, this had the potential side effect of throwing away valuable
information to get position lock.

This change reverses the clearBuffer and changes the logic so if time
is not set it will not be broadcast.

Fixes meshtastic#7771
Fixes meshtastic#7750

---------

Co-authored-by: Tom Fifield <[email protected]>
pkoryzna pushed a commit to pkoryzna/meshtastic-firmware-why2025-carrier that referenced this pull request Sep 13, 2025
Further to meshtastic#7772 ,
we discovered that some RTCs have hard-coded start times well in the
past.

This patch gives RTCs the same treatment as GPS - if the time is
earlier than BUILD_EPOCH, we don't use it.

Fixes meshtastic#7771
Fixes meshtastic#7750
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: T-Lora Pager thinks that it's 2005 [Bug]: Rak WisMesh Tag time set to 21 May 2019

3 participants