Mandate date/time update on devices without GPS or RTC

Devices without GPS or RTC onboard rely on an external means of setting date/time. If I’m not mistaken, this could be done manually with the meshtastic command or automatically when paired to a phone.

However, when such devices don’t have their time set, they register on the mesh with their internal clock set to UNIX epoch. They join the mesh, but devices with correctly set time will show nodes heard 447226 hours ago or so!

Would it be possibile to mandate setting the time on those devices prior to joining the mesh? I see it as a chicken and egg dilemma :wink:

I understand the idea behind this, but forcing a time setting is probably not the best way to go. Imagine you have a solar powered node without GPS on a hill. It might run out of battery and come back the next day and can’t reset it’s time.

A simpler solution would probably be to show “Unknown” as time in the app for timestamps that are too far of.

Yes, that makes sense and could perhaps be easier to implement.

1 Like

I think I saw a change where if another device in the mesh has a GPS time, devices that don’t have time will set their own time from that GPS time. I didn’t follow if it was done or of it works.

I don’t know, but I can see that 50+ year ago dates tend to persist in the mesh for a long time, even between reboots.

Maybe it hasn’t been done… hmm …

I havent followed up to see if this was added as a bug or todo but this is the last bit I recall seeing about it.

Yes, but that only applies to boards with a RTC.

That one actually works without the 32k crystal by sacrificing a few uA of power to bypass the rc clock source.

It doesnt help with ble power usage but it does help with clock accuracy.

I linked that because he said

So I dont know how much that part has progressed.

2 Likes

He fixed it.

1 Like

Yes. All nodes are supposed to learn the current time automatically if any node has gps time. Possibly that broke recently in the 1.1 builds? I’m kinda busy with other things for the next few days but if someone wants to try and reproduce the problem and make a bug on GitHub someone will fix it eventually :laughing:

3 Likes

Oh, that would eventually be useful as a time component to seed a frequency hopping algorithm. Very nice.

Yes, to my relief it kinda works :smiley:

How can I read a device internal clock? meshtastic --info doesn’t give an up-to-date time, perhaps it’s the time of when the device joined the mesh and/or had its clock synced from the mesh?

Also, meshtastic --settime is supposed to get the time from the computer or from GPS-enabled devices in the mesh?

good point. If you add a bug for “device should update local node time on any node-db download” that is easy to fix.

meshtastic --settime, sets the time using the local computer clock. It is intended for nodes that don’t have a local GPS. (and identical to what the android app does when it sees it is talking to a !gps device)

1 Like

Thank, I will.

OK, but I’ve tried with a dreaded LoRa32 connected to a Win 10 laptop while a T-Beam with GPS fix was already on and meshtastic reported both devices time to be yesterday. I then tried --settime and both devices were set to UNIX epoch 1!

After rebooting the T-Beam the correct time was then successfully propagated to the mesh.

Perhaps it’s time for LoRa32s to burn in hell :smiley:

:innocent: Haha, I accidently burnt a TBeam last night :grin: Not my finest moment

:open_mouth: how did you do that?

Well, I might have wrecked 2 of them. I realised last night that earlier in the day I powered up a TTGo Lora32 without the antenna attached. The whip was, but for some reason I had removed the antenna and hadnt noticed.

So I powered it quickly with a USB cable and went out to grab a TBeam to see if they could still talk. Not sure where my head was, I could have just plugged it into the USB as well. But grabbed the wrong wall wart and sent 12v where you normally insert the 18650 battery. I have something a little different there right now for testing.

Anyway, there was a neat red glow, some smoke and a POP! As the power management chip blew a little hole in the middle.

I decided to turn in after that, so Im still no smarter about the first device being powered without the antenna.

3 Likes

Ahahahha shit happens!

One of my LoRa32 refused to join the mesh after being powered on without the antenna earlier on. I was pretty sure I’ve blown the RF final, so I put it aside. But a few hours later I’ve switched it on again and it started working without problems… and still is!