ESP32 User Configurable Network Details

Use this section to discuss your embedded Flowcode projects.
BenR
Matrix Staff
Posts: 1707
http://meble-kuchenne.info.pl
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: ESP32 User Configurable Network Details

Post 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.

stefan.erni
Valued Contributor
Posts: 738
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 170 times

Re: ESP32 User Configurable Network Details

Post 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

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: ESP32 User Configurable Network Details

Post 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

stefan.erni
Valued Contributor
Posts: 738
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 170 times

Re: ESP32 User Configurable Network Details

Post 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

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: ESP32 User Configurable Network Details

Post 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.

stefan.erni
Valued Contributor
Posts: 738
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 149 times
Been thanked: 170 times

Re: ESP32 User Configurable Network Details

Post 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

lucibel
Posts: 172
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 29 times
Been thanked: 22 times

Re: ESP32 User Configurable Network Details

Post 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
Seb

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: ESP32 User Configurable Network Details

Post 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.

lucibel
Posts: 172
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 29 times
Been thanked: 22 times

Re: ESP32 User Configurable Network Details

Post 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
Seb

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: ESP32 User Configurable Network Details

Post 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?

Post Reply