EMC32 Get Time from Android or Apple Using Bluetooth LE

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
xFishbonex
 
Posts: 11
Joined: Fri Jan 27, 2023 12:17 pm

EMC32 Get Time from Android or Apple Using Bluetooth LE

Post by xFishbonex »

Hi Smart People:
There are a ton of examples of using Wi-Fi to get the time for ESP32. However, I would like to be able to use Bluetooth LE to quickly pair an ESP32 just long enough to grab the system time on the mobile device, then disconnect. It is for a digital watch project. Anyone have some quick and easy examples on how to do this?

Thanks!

Mark

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: EMC32 Get Time from Android or Apple Using Bluetooth LE

Post by adafruit_support_mike »

BLE doesn't really work that way.

Bluetooth splits devices into 'central' and 'peripheral' categories. Central devices initiate and control all data connections. Peripherals advertise their presence, but otherwise wait for a central to connect and tell them what to do.

Under that arrangement, there's no way for a peripheral to decide it wants to connect to a central. The central has to decide to talk to the peripheral.

Your phone can automatically try to connect to a BLE peripheral it's already been bonded to, and once the connection is made the phone can read a flag that says the peripheral wants a timestamp.

That involves creating an app for your phone to do the connecting, querying, and updating.

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

Return to “Wireless: WiFi and Bluetooth”