Page 2 of 3

Re: ESP32 User Configurable Network Details

Posted: Wed Sep 08, 2021 4:06 pm
by BenR
Hi Stefan,

The idea is the NTP server sets the time so you should in theory never need to manually set the time. This is why I haven't included the set macros instead the QueryTimeServer macro gets the current time from the NTP server. I also haven't included a manual setting because of the known drift in the default ESP32 clock and any user setting would quickly become more and more inaccurate, of course the 32.768KHz clock option will help a lot with this problem.

Should you need to apply an offset to the time server time e.g. UTC +2 hours then you can either set the UTC Offset property for a fixed offset or you can use the SetUTCOffset macro for a variable offset. Each apply an offset in seconds so for +2 hours the offset would be 7200.

Do you still need the manual time and date setting do you think? Probably not too bad to add if you do need it e.g. you don't have a WIFI connection.

Re: ESP32 User Configurable Network Details

Posted: Wed Sep 08, 2021 4:31 pm
by stefan.erni
Hi Ben

This with the Offset it's working fine. I take the printscreen before a was swimming in the lake and post it after.....

it's great the to set the time in a privat network with the NTP server.

But in our LAB we can just use wlan if we register the computer or phone. I suspect many companies have strict security regulations.
Do you still need the manual time and date setting do you think?

Yes it will help. And I like to use the AppDevelopper for it

regards

Stefan

Re: ESP32 User Configurable Network Details

Posted: Thu Sep 09, 2021 12:09 pm
by BenR
Hi Stefan,

I've pushed an update with two new functions to allow you to manually set the time and date. I've tested it compiles but not done any more then that so I'll keep my fingers crossed :D

Re: ESP32 User Configurable Network Details

Posted: Thu Sep 09, 2021 12:37 pm
by stefan.erni
Hi Ben

Setdate is perfect

Settime is a little wrong

- if I set time to 0h 0m 0s it's like 4hours 19 minutes 27 sec

- if I set time to 10h 10m 10s it's like 14hours 29 minutes 37 sec

regards

Stefan

Re: ESP32 User Configurable Network Details

Posted: Fri Sep 10, 2021 10:51 am
by BenR
Hi Stefan,

Many thanks for letting me know.

I wonder if the UTC offset is that's causing the issue, I've now taken this into account when setting the time so hopefully the latest component on the update system will be better for you.

Re: ESP32 User Configurable Network Details

Posted: Fri Sep 10, 2021 2:19 pm
by stefan.erni
Hi Ben

Perfect! Its working.

If the UTC offset is not set or set to 0 the SetTime is working fine
but
If the UTC offset is set to 3600 or 7200 before I set the time

the SetTime set a strange time (not a correct offset)

regards

Stefan

Re: ESP32 User Configurable Network Details

Posted: Mon Nov 15, 2021 10:43 am
by lucibel
Hi,
Could you tell me where webserver IP is set to 192.168.4.1 on the program. I didn't find it.
thx

Re: ESP32 User Configurable Network Details

Posted: Mon Nov 15, 2021 2:41 pm
by BenR
Hello,

That address 192.168.4.1 is the default address of the ESP device when hosting its own network. I'm not sure if it's editable at the moment. Anything connecting to that network will be assigned a dynamic IP such as 192.168.4.2 etc.

Re: ESP32 User Configurable Network Details

Posted: Mon Nov 15, 2021 7:10 pm
by lucibel
Hi Ben it's look like that need to use SOFTAPCONFIG
Please check this link.
https://docs.espressif.com/projects/ard ... ftapconfig

Could you help me to make this in C-Code or with another way .
Thx a lot
seb

Re: ESP32 User Configurable Network Details

Posted: Wed Nov 17, 2021 4:26 pm
by BenR
Hi Seb,

Looks like you should just be able to call that function using a C code icon. What happens if you try this?