Place to put your Basic demos and examples

Moderator: Mmiscool

User avatar
By Mmiscool
#36164 So long as the esp is connected to your WiFi network that has internet access it should be working. Is there a specific time zone you are setting it for?
User avatar
By ssylca
#36169
Mmiscool wrote:So long as the esp is connected to your WiFi network that has internet access it should be working. Is there a specific time zone you are setting it for?


I am in the same time zone than NY City.
User avatar
By TassyJim
#36178
ssylca wrote:Hi,
The time() doesn't fetch anything. What I am doing wrong?

Many thanks to MMISCOOL

S.


Your module has to have internet access.
For that to happen, your ESP needs to connect to your WIFI network as a client. If you are connecting to the ESP when it's an access point (like the first time your connect to it), it won't have internet access.

Once you have internet access, you need to run timesetup(). When you run timesetup(), it configures you timezone and runs NTP to set the time.

Jim
User avatar
By ssylca
#36181
TassyJim wrote:
ssylca wrote:Hi,
The time() doesn't fetch anything. What I am doing wrong?

Many thanks to MMISCOOL

S.


Your module has to have internet access.
For that to happen, your ESP needs to connect to your WIFI network as a client. If you are connecting to the ESP when it's an access point (like the first time your connect to it), it won't have internet access.

Once you have internet access, you need to run timesetup(). When you run timesetup(), it configures you timezone and runs NTP to set the time.

Jim


Thank you Jim, I ran the script as posted. How would you setup the ESP to run as a client to have internet access?

Cheers,
S.