Comments (14)
Hi. My first guess would be that it is networking problem - ESP32 has limited networking capabilities (if there are too many simultaneous connections). My experience so far is that ESP32 works better in STA mode then in AP mode. I'll do some testing myself and let you know. Meanwhile you can check if httpRequest (for LED switch) arrives to ESP32 by adding the following line to httpRequestHandler:
String httpRequestHandler (String& httpRequest, httpServer::wwwSessionParameters *wsp) { // - has to be reentrant!
// debug:
Serial.print (httpRequest);
from multitasking-esp32-http-ftp-telnet-servers-for-arduino.
I've been running this page for more than 3 hours from 3 browsers simultaneously, the same way as you do - through AP, and was unable to replicate the problem. Any suggestions would be useful ...
from multitasking-esp32-http-ftp-telnet-servers-for-arduino.
User reply that STA setup with static IP used, and playing those example demo a few, such thing was happening, let us check with users and reproduce such stuff, it is possible one of example html caused such, AP / STA / INTERNET mode all the same. will let you know when I see. thanks.
from multitasking-esp32-http-ftp-telnet-servers-for-arduino.
hi, this is able to reproduce such user experience with a video recording showed to me.
open index.html, play LED few times, it is good,
go to oscilloscope.html, play Do Digital read, it is ok,
go back to index.html, play LED few times, it is good,
go to oscilloscope.html, play Do Analog read, it is good,
go back to index.html, or any LED control page, play LED again, it is being malfunction,
I could repeat such a few times and confirmed such user feedback, only ESP32 broad itself & 5V power supply, fallback to STA DHCP mode, no any peripheral connected. Perhaps a bug really or coincidently the user just played too hard or too far, but at least it is clear to see that possible causes. In case you will have idea for the clue or how to fix, welcome to share with us. thanks.
And off this topic, NTP was not working when STA with static IP used, no easy for practical server and LAN / WAN. mDNS could be a workaround but it is not port forwarding capability.
from multitasking-esp32-http-ftp-telnet-servers-for-arduino.
I believe the cause of the problem is that analogRead has was performed (by oscilloscope) ob pin 2 (built-in LED) which corrupted pinMode setting hence consequently called digitalWrite (on pin 2) failed. This sequence of operations is not supported by ESP32. Normally one would have pins for digital input, pins digital output (which you can also read as digital input), pins for analog input and pins for analog output. It all depends on what you intend to connect to those pins. You are not supposed to do analog reading on pin that is supposed to perform digital output.
Try analogRead (from oscilloscope) on pin 32 for example. This should be OK.
from multitasking-esp32-http-ftp-telnet-servers-for-arduino.
For example, suppose this is your project:
-
you want to control built-in LED brightness with PWM
-
you want to read analog signal (battery voltage or whatever) connected to pin 32
Than you would configure (probably in setup ()) your pins similar to this:// example: PWM on built-in led (GPIO 2) ledcSetup (0, 83, 10); // channel 0, 83 Hz, 10 bit resolution (1024 values) ledcAttachPin (2, 0); // attach pin 2 (built-in led) to channel 0 ledcWrite (0, 307); // PWM of built-in LED (channel 0 -> pin 2) with 1/3 of period (307 out of 1023) // example: ADC on GPIO 32 analogReadResolution (12); // set 12 bit analog read resolution (defaule) analogSetPinAttenuation (32, ADC_11db); // set attenuation for pin 32 to 2600 mV range (default)
If you want to see what is going on in your ESP32 you can configure oscilloscope to perform digitalReads on pin 2 or analogReads on pin 32.
from multitasking-esp32-http-ftp-telnet-servers-for-arduino.
I'll check NTP with static IP and let you know. Personally I don't use static IPs since it is more convenient and behaviour is more predictable if you configure your router's DHCP to always assign the same IP to your ESP32. But nevertheless NTP should work if ESP32 uses static IP that is not in any contradiction with other IPs that router assigns to its STAtions.
I'd appreciate if you could check if network connectivity is otherwise OK, for example by telneting to your ESP32 (through AP or your WiFi router) and then try to ping your router from there? Or ping your NTP server (for example ping 1.si.pool.ntp.org)?
I'll perform some tests myself and let you know.
from multitasking-esp32-http-ftp-telnet-servers-for-arduino.
You are right, the cause for NTP not working lies in static IP set by ESP32.
If you configure your WiFi router's DHCP to always assign the same IP to your ESP32 and then configure ESP32 to dynamically acquire its IP from DHCP then NTP works as it should.
If you reconfigure ESP32 to use the same IP in a static manner then NTP stops working.
Honestly, I do not know why is it so. It could be that ESP32_web_ftp_telnet_server_template initialises WiFi in the wrong way when static IP is used or it could be the matter of underlying software. I'll leave this issue open while looking for a solution.
Meanwhile I suggest the use of DHCP reservations on the WiFi router.
from multitasking-esp32-http-ftp-telnet-servers-for-arduino.
It turned out that it is that ESP32_web_ftp_telnet_server_template initialises WiFi in the wrong way when static IP is used. It seems that it should also configure DNS servers but this would require some additional work and additional entry into /network/interfaces. It will take me a day or two. Beside workaround mentioned above there is now an obvious second workaround. Use IP instead of NTP server names in /etc/ntp.conf file or in ntpdate -u telnet command.
from multitasking-esp32-http-ftp-telnet-servers-for-arduino.
Solved. Please download the latest network.h and replace with it the one you have. Then add additional two fields to /network/interfaces which should look something like this:
'''
WiFi STA(tion) configuration - reboot for changes to take effect
get IP address from DHCP
iface STA inet dhcp
use static IP address (example below)
iface STA inet static
address 10.0.0.44
netmask 255.255.255.0
gateway 10.0.0.1
dns1 193.189.160.13
dns2 193.189.160.23
'''
from multitasking-esp32-http-ftp-telnet-servers-for-arduino.
Solved. Please download the latest network.h and replace with it the one you have. Then add additional two fields to /network/interfaces which should look something like this:
iface STA inet static
address 10.0.0.44
netmask 255.255.255.0
gateway 10.0.0.1
dns1 193.189.160.13
dns2 193.189.160.23
'''
hi, would you please upload the network.h for that patch ,thanks.
from multitasking-esp32-http-ftp-telnet-servers-for-arduino.
I'm sorry, I thought I did. It is available now.
from multitasking-esp32-http-ftp-telnet-servers-for-arduino.
BTW you may also want to download latest telnetServer.hpp, there are some putty bug fixes there.
from multitasking-esp32-http-ftp-telnet-servers-for-arduino.
I'm sorry, I thought I did. It is available now.
BTW you may also want to download latest telnetServer.hpp, there are some putty bug fixes there.
excellent, it works very well. thanks
from multitasking-esp32-http-ftp-telnet-servers-for-arduino.
Related Issues (16)
- Web server sometimes fails when reading SPIFFS HOT 1
- use SD card instead of flash HOT 7
- Memory problems: memory leak, memory fragmentation, instability at heavy load HOT 1
- Some ESP32 boards do not support FAT partition schemes (FAT file system) HOT 1
- Compile with ESP-IDF HOT 5
- Error in European DST calculation HOT 1
- W5500 Ethernet Support HOT 6
- warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] HOT 1
- Can't connect to access point (AP) from every client HOT 2
- WebSocket binary endianness HOT 1
- Compile issues HOT 14
- Calling cronTabDel function crashes ESP. HOT 1
- Are there any plans to implement mime types for web servers? HOT 3
- pool.ntp.org is not available when FAT used, but SPIFFS was good to see WIFI connected HOT 1
- ESP32 stream function is working conditionally with different browser HOT 2
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 multitasking-esp32-http-ftp-telnet-servers-for-arduino.