Comments (6)
The reasoning behind the fetch.begin()
function is to read the time from a server, since this is required to validate HTTPS requests.
This blocking loop is waiting until the time is obtained. As long as the ESP is running a captive portal and server connection can not be made, this will prevent the application from running. And this should indeed not be the case.
Doing some further testing I found to my surprise that even when I am not explicitly requesting the time from the server, the ESP8266 will still fetch the time when connected to WiFi. This is probably part of the ESP SDK which is used at the lowest level. Even though I did not find explicit documentation on this, I found this topic where the same behavior is observed and attributed to the SDK.
Because of this I have completely removed the fetch.begin()
function, and with that the issue you encountered in commit a9b93f9.
from esp8266-iot-framework.
Good to know, thanks. It's pretty surprising that the SDK will make network activity without explicitly opting in, though.
from esp8266-iot-framework.
Agreed, that is also why I am still looking for a better source/confirmation on this.
from esp8266-iot-framework.
I just pulled in that commit, and now https requests don't work. I think that the NTP sync may actually be required (I wonder if this is something that can differ between hardware). If I check gmtime_r
without configTime
first, I get Thu Jan 1 00:00:07 1970
. It seems like the safest option might be to restore configTime
in some form to guarantee the device time is up to date.
from esp8266-iot-framework.
Yes, I figured the same, which is why I re-opened the ticket. I have reverted to a basic non-blocking NTP request in commit e9cafb4.
I was a bit too quick committing (and should start using branches).
I found that if I connect to my home WiFi it pulls the time automatically, but not when I connect to a hotspot on my phone. Currently investigating if it could fetch the time from the access point itself somehow for some access points and not for others...
from esp8266-iot-framework.
Alright sweet. I think that your latest update here should work okay as long as an https request isn't attempted before the clock sync is completed, and as long as it's able to complete after connecting to wifi but before the first https request. I have an idea about how this could be done.
One more question on configTime
itself, should the first parameter be 0
for UTC?
from esp8266-iot-framework.
Related Issues (20)
- Holding connections open for long periods of time HOT 4
- Event on Dashboard Change HOT 12
- Detect if captive portal is running and WiFi is in Ad-hoc mode HOT 3
- Separator and titol in config page HOT 1
- Enhancement: Adding "label" in dashboard HOT 4
- mDNS not working HOT 1
- Error when run "npm ci" HOT 7
- Failing at Step 9. HOT 3
- WiFi passwords including "+" not working HOT 3
- 403 Forbidden response to GET request HOT 1
- Dependency issues in library HOT 4
- Request: click button in dashboard HOT 1
- WIFI reconnect HOT 1
- The cipher AES128-SHA is not supported for TLSv1.2. HOT 5
- Import issue Arduino IDE 2.1.1 HOT 3
- html.h not being rebuild HOT 1
- ssl.wrap_socket() gots removed within python 3.12
- Json name with spaces HOT 1
- Missing dependancy HOT 1
- Upload empty file failes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esp8266-iot-framework.