receive actual time from bluetooth connection

Dear all,

my project is a biorhythm circadian desktop table which emits a specific LED color temperature according the actual time. This table lamp will be connected to a smart phone, so the user may set the required brightness level. Apart from the brightness the user will not be able to change the color temperature by himself, the table lamp will generate the mix between cold and warm white LEDs by itself and emit the appropriate color temperature according the hours/minutes of the day. I would like to extract the timestamp from the bluetooth connection either via Android or iphone, I am experimenting with HC-05 and HC-10. My question: How can I get the actual (network or any other) time information from a bluetooth connection and store it to a variable, thanks a lot. Dominic

How much of the hardware have You got working? Time, date etc. must come from somewhere. From where do You intend to capture it?

Have the phone send that time information over the Bluetooth connection, then use the setTime() function to set the system time (this is in the Timelib library).

You could do it by building a custom iphone app that creates a two channel connection with (sending/receiving) the packets.

I was able to create something similar for the project I'm working on and the code is relatively simple.

dominic66:
My question: How can I get the actual (network or any other) time information from a bluetooth connection and store it to a variable,

All your problems are at the supplier end, and they are considerable. Since you are talking of network time, and any other time, you might consider using using an ESP8266 to get internet time, which would a hell of a lot simpler. This would mean Bluetooth is redundant, and possibly Arduino as well.

Use a DS3231 RTC module to keep track of time in the lamp controller. Set and forget, accurate to about 2 minutes/year.

For less than the same price of many Bluetooth modules you could get a ESP8266 and use that for everything.
The ESP will give you wifi support and the ESP8266 Arduino core includes true time libraries so you can use NTP and the time libraries include the ability to have access to UTC time or any other timezone you want/need including automatic DST adjustments using a standard TZ string.
If you have access to a stable internet connection through WiFi, this is the way I would go as you wouldn't need any s/w on the other end (like you would with a bluetooth solution) or even need an RTC.

You can use the WiFi manager along with a browser on a PC/Laptop/Phone to configure the system including setting your own internal variables like the TZ string.

You can also create you own web pages for further configuration if you want.

--- bill