My projects need the current time from a phone

For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
bobr530
 
Posts: 6
Joined: Mon Jul 06, 2015 4:23 pm

My projects need the current time from a phone

Post by bobr530 »

I have a lot of simple devices that have no battery backed clock but do BLE (Pi Pico W and ItsyBitsyNRF52840). When they are switched on, I want them to get the current time and date using BLE from my phone so they can timestamp their data. They should not have to connect, rather just read a BLE advertisement that contains the current time.

Is there a Android app that broadcast the current time (Beacon Simulator)?

Is there a Beacon that broadcasts the current time?

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: My projects need the current time from a phone

Post by mikeysklar »

Did you take a look at BLEClientCts? It mentions iPhone/iPad not Android which might be a deal breaker for you if it is limited to iOS.
BLEClientCts is a helper class that implements adopted Current Time Service , which enables you to receive time from devices such as an iPhone or iPad.
https://learn.adafruit.com/bluefruit-nr ... eclientcts

User avatar
bobr530
 
Posts: 6
Joined: Mon Jul 06, 2015 4:23 pm

Re: My projects need the current time from a phone

Post by bobr530 »

Thanks, I am looking into it. I suspect it requires pairing with each individual device and would involve fidgeting with the phone. I would be activating dozens of sensors in a short period of time and would not have time to deal with pairing. In a Beacon scenario, I would turn on the Beacon app which would continuously broadcast the current time and each device would scan for it as needed.

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: My projects need the current time from a phone

Post by mikeysklar »

Yes, the BLEClientCts example does require pairing. However, it is the only example I can find to get time so it might be worth experimenting with enough to get working and then try to find away around the pairing process.

Locked
Please be positive and constructive with your questions and comments.

Return to “Wireless: WiFi and Bluetooth”