1

I am trying to build a carputer and I will have my mobile connected to RPI 4 through a external USB Bluetooth interface. The UI on the application will pick the time and date from Raspbian OS and will not internet it never gets updated until I return home and connects back to WIFI.

Since I am already connected on mobile, is there a way to sync date and time from mobile to Raspbian OS? I see a guy on Git doing a fantastic job of writing a python code for the Bluetooth time sync, but it seems to be outdated and isn't working as expected.

Can anyone help me with this please? Or even share the script if already written? I am not a computer language guy but can only understand a little bit of the scripts and modify some by google.

1
  • If you look at bluetooth.com/specifications/specs, there is the spec for Current Time Service but that isn't how the Gist you linked to is doing it. They are using rfcomm which was deprecated back in 2017 Commented Feb 9, 2021 at 20:36

1 Answer 1

1

As far as I know, there is no way to sync date and time over bluetooth, but you do have two good options:

  1. Add a battery-backed real time clock to your Pi. There are lots of cheap options available, do a search for "DS1307 RTC Raspberry Pi" and you'll see what I mean. This will maintain date and time when system power is removed, just like a "normal" computer does.

  2. If you're going to be using a GPS with your carputer, you can use gpsd in concert with chrony or NTPd to sync the computer time with GPS time - the downside of this is that you will have to wait for the GPS to get a valid lock before it'll pass date and time to the computer.

Bonus option! 3) battery backed real time clock and a GPS! This way the RTC keeps time if the system isn't powered and you get the incredible accuracy of a GPS-disciplined clock!

1
  • thanks for taking time to reply. I do however see few applications in Play Store like the Connected Pro app which enable the time and date sync through mobile Bluetooth connection. i did think about the above 2 option of yours, but got a tight space for no extra addons on GPIO nor on USB Commented Feb 9, 2021 at 18:41

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.