hieromon / autoconnect Goto Github PK
View Code? Open in Web Editor NEWAn Arduino library for ESP8266/ESP32 WLAN configuration at runtime with the Web interface
Home Page: https://hieromon.github.io/AutoConnect/
License: MIT License
An Arduino library for ESP8266/ESP32 WLAN configuration at runtime with the Web interface
Home Page: https://hieromon.github.io/AutoConnect/
License: MIT License
I'm using AutoConnect with static ip address. First starting with captive portal to obtain a dynamic ip-address. Then setting static ip address. It's working great, except for remote access to the index.html page on my esp8266.
While within my lan index.html can be reached direcly, from wan/internet/outside my lan it seems portmapping forces startup with captive portal, i.e. /_ac. Can this be fixed?
Hi sorry may I as you how to change this sentence
[AC] SoftAP esp32ap/12345678 Ch(1) IP:192.168.244.1
the wifi name as "esp32ap and password 12345678" can I change the name and the password ?
Hi,
I'm trying to change the name of the SSID and password for SoftAP but each time I try to specify a config I have a big instability on my esp.
Here my code, may be I've done something wrong.... When I don't specify a SoftAP config the ESP and the connection is stable but each time I activate the line "Portal.config("Test", "testtest"); " the ESP connect to my AP and crash every 5 seconds. with this message :
HTTPUpdateServer ready! Open http://test.local/update in your browser
WiFi connected:MyAP
IP:192.168.1.223ets Jan 8 2013,rst cause:4, boot mode:(3,7)
wdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v614f7c32
~ld
If you have a complete example with a custom SoftAP config I'm interested ! :)
Thanks
`#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <AutoConnect.h>
#include <ESP8266WebServer.h>
#include <PubSubClient.h>
#include <ESP8266mDNS.h>
#include <ESP8266HTTPUpdateServer.h>
#include <Adafruit_NeoPixel.h>
#include <ArduinoJson.h>
#include <EasyNeoPixels.h>
ESP8266WebServer Server;
AutoConnect Portal(Server);
AutoConnectConfig Config("TestTest", "testtest");
//AutoConnectConfig Config;
WiFiClient wifiClient;
PubSubClient mqttClient(wifiClient);
ESP8266HTTPUpdateServer httpUpdater;
void setup() {
delay(1000);
Serial.begin(115200);
Serial.println();
Server.on("/", rootPage);
// update on web page
httpUpdater.setup(&Server);
Serial.printf("HTTPUpdateServer ready! Open http://pluie.local/update in your browser\n");
// Portal.config("Test", "testtest"); // ->> iF I activate this the ESP crash
// Portal.config(Config);
Serial.print("WiFi ");
if (Portal.begin()) {
Serial.println("connected:" + WiFi.SSID());
Serial.println("IP:" + WiFi.localIP().toString());
} else {
Serial.println("connection failed:" + String(WiFi.status()));
while (1) {
delay(100);
yield();
}
}
// We add a DNS name Test.local
if (MDNS.begin("Test")) {
MDNS.addService("http", "tcp", 80);
}
}
void loop() {
Portal.handleClient();
}
hi,
im new to your library and i tried uploading simple and hello world example and neither would compile. ive been working with generic esp8266 for a bit and i believe i have the arduino 1.8.8 IDE setup correctly. is ther a change that i must make in the sketch or in src folders? i just downloaded the library today so im hoping its the latest issue. thanks for your hard work
Hello,
This is a great Tutorial and a great library. Thank you!
Is it possible to transmit "Custom Parameters" via the Autoconnect menu (/ _ac)? I would like to be able to enter the address and topic of the MQTT Broker in the Autoconnect menu to use it later in my Sketch.
Thank you Flo
Tried googling as much as I could and indeed an error like this is over my head... I have the Arduino IDE error log below if it's any use, also newly flashed my ESP32 with nodemcu and it's been working with other sketches just fine:
In file included from C:\Users\kevin\AppData\Local\Temp\arduino_modified_sketch_461112\Simple.ino:15:0:
C:\Users\kevin\Documents\Arduino\libraries\AutoConnect\src/AutoConnect.h:27:24: error: 'WebServer' does not name a type
using WebServerClass = WebServer;
^
In file included from C:\Users\kevin\Documents\Arduino\libraries\AutoConnect\src/AutoConnect.h:30:0,
from C:\Users\kevin\AppData\Local\Temp\arduino_modified_sketch_461112\Simple.ino:15:
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:29:24: error: 'WebServer' does not name a type
using WebServerClass = WebServer;
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:114:28: error: 'HTTPMethod' was not declared in this scope
typedef std::function<bool(HTTPMethod, String)> PrepareFuncT;
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:114:46: error: expression list treated as compound expression in functional cast [-fpermissive]
typedef std::function<bool(HTTPMethod, String)> PrepareFuncT;
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:114:47: error: template argument 1 is invalid
typedef std::function<bool(HTTPMethod, String)> PrepareFuncT;
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:123:43: error: expected class-name before '{' token
class PageBuilder : public RequestHandler {
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:126:37: error: 'HTTPMethod' has not been declared
PageBuilder(PageElementVT element, HTTPMethod method = HTTP_ANY, bool noCache = true, bool cancel = false) :
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:134:54: error: 'HTTPMethod' has not been declared
PageBuilder(const char* uri, PageElementVT element, HTTPMethod method = HTTP_ANY, bool noCache = true, bool cancel = false) :
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:145:17: error: 'HTTPMethod' has not been declared
bool canHandle(HTTPMethod requestMethod, String requestUri) override;
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:147:14: error: 'WebServerClass' has not been declared
bool handle(WebServerClass& server, HTTPMethod requestMethod, String requestUri) override;
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:147:38: error: 'HTTPMethod' has not been declared
bool handle(WebServerClass& server, HTTPMethod requestMethod, String requestUri) override;
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:151:14: error: 'WebServerClass' has not been declared
void insert(WebServerClass& server) { server.addHandler(this); }
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:154:32: error: 'WebServerClass' has not been declared
static void sendNocacheHeader(WebServerClass& server);
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:157:18: error: 'WebServerClass' has not been declared
void atNotFound(WebServerClass& server);
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:165:2: error: 'HTTPMethod' does not name a type
HTTPMethod _method; /**< Method of http request to which this page applies. */
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:168:23: error: 'WebServerClass' has not been declared
bool _sink(int code, WebServerClass& server); //, HTTPMethod requestMethod, String requestUri);
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:171:2: error: 'WebServerClass' does not name a type
WebServerClass* _server;
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:145:7: error: 'bool PageBuilder::canHandle(int, String)' marked 'override', but does not override
bool canHandle(HTTPMethod requestMethod, String requestUri) override;
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:146:7: error: 'bool PageBuilder::canUpload(String)' marked 'override', but does not override
bool canUpload(String requestUri) override;
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:147:7: error: 'bool PageBuilder::handle(int&, int, String)' marked 'override', but does not override
bool handle(WebServerClass& server, HTTPMethod requestMethod, String requestUri) override;
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:126:57: error: 'HTTP_ANY' was not declared in this scope
PageBuilder(PageElementVT element, HTTPMethod method = HTTP_ANY, bool noCache = true, bool cancel = false) :
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:134:74: error: 'HTTP_ANY' was not declared in this scope
PageBuilder(const char* uri, PageElementVT element, HTTPMethod method = HTTP_ANY, bool noCache = true, bool cancel = false) :
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h: In constructor 'PageBuilder::PageBuilder()':
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:125:33: error: class 'PageBuilder' does not have any field named '_method'
PageBuilder() : _uri(nullptr), _method(HTTP_ANY), _server(nullptr) {}
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:125:41: error: 'HTTP_ANY' was not declared in this scope
PageBuilder() : _uri(nullptr), _method(HTTP_ANY), _server(nullptr) {}
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:125:52: error: class 'PageBuilder' does not have any field named '_server'
PageBuilder() : _uri(nullptr), _method(HTTP_ANY), _server(nullptr) {}
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h: In constructor 'PageBuilder::PageBuilder(PageElementVT, int, bool, bool)':
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:129:3: error: class 'PageBuilder' does not have any field named '_method'
_method(method),
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:132:3: error: class 'PageBuilder' does not have any field named '_server'
_server(nullptr),
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:133:21: error: cannot convert 'std::nullptr_t' to 'PrepareFuncT {aka int}' in initialization
_canHandle(nullptr) {}
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h: In constructor 'PageBuilder::PageBuilder(const char*, PageElementVT, int, bool, bool)':
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:137:3: error: class 'PageBuilder' does not have any field named '_method'
_method(method),
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:140:3: error: class 'PageBuilder' does not have any field named '_server'
_server(nullptr),
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:141:21: error: cannot convert 'std::nullptr_t' to 'PrepareFuncT {aka int}' in initialization
_canHandle(nullptr) {}
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h: In destructor 'PageBuilder::~PageBuilder()':
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:143:35: error: '_server' was not declared in this scope
~PageBuilder() { _uri = nullptr; _server = nullptr; clearElement(); }
^
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h: In member function 'void PageBuilder::insert(int&)':
C:\Users\kevin\Documents\Arduino\libraries\PageBuilder\src/PageBuilder.h:151:47: error: request for member 'addHandler' in 'server', which is of non-class type 'int'
void insert(WebServerClass& server) { server.addHandler(this); }
^
In file included from C:\Users\kevin\AppData\Local\Temp\arduino_modified_sketch_461112\Simple.ino:15:0:
C:\Users\kevin\Documents\Arduino\libraries\AutoConnect\src/AutoConnect.h: At global scope:
C:\Users\kevin\Documents\Arduino\libraries\AutoConnect\src/AutoConnect.h:213:29: error: expected ')' before '&' token
AutoConnect(WebServerClass& webServer);
^
C:\Users\kevin\Documents\Arduino\libraries\AutoConnect\src/AutoConnect.h:223:3: error: 'WebServerClass' does not name a type
WebServerClass& host();
^
C:\Users\kevin\Documents\Arduino\libraries\AutoConnect\src/AutoConnect.h:227:20: error: 'WebServerClass' has not been declared
void onNotFound(WebServerClass::THandlerFunction fn);
^
C:\Users\kevin\Documents\Arduino\libraries\AutoConnect\src/AutoConnect.h:227:53: error: expected ',' or '...' before 'fn'
void onNotFound(WebServerClass::THandlerFunction fn);
^
C:\Users\kevin\Documents\Arduino\libraries\AutoConnect\src/AutoConnect.h:242:25: error: 'HTTPMethod' has not been declared
bool _classifyHandle(HTTPMethod mothod, String uri);
^
C:\Users\kevin\Documents\Arduino\libraries\AutoConnect\src/AutoConnect.h:263:3: error: 'WebServerClass' does not name a type
WebServerClass::THandlerFunction _notFoundHandler;
^
C:\Users\kevin\Documents\Arduino\libraries\AutoConnect\src/AutoConnect.h:265:19: error: 'WebServerClass' was not declared in this scope
std::unique_ptr<WebServerClass> _webServer;
^
C:\Users\kevin\Documents\Arduino\libraries\AutoConnect\src/AutoConnect.h:265:33: error: template argument 1 is invalid
std::unique_ptr<WebServerClass> _webServer;
^
C:\Users\kevin\Documents\Arduino\libraries\AutoConnect\src/AutoConnect.h:265:33: error: template argument 2 is invalid
Simple:20: error: 'WebServer' does not name a type
WebServer Server;
^
Simple:22: error: cannot declare parameter to be of abstract type 'Server'
AutoConnect Portal(Server);
^
In file included from C:\Users\kevin\Documents\Arduino\hardware\espressif\esp32\cores\esp32/Arduino.h:156:0,
from sketch\Simple.ino.cpp:1:
C:\Users\kevin\Documents\Arduino\hardware\espressif\esp32\cores\esp32/Server.h:25:7: note: because the following virtual functions are pure within 'Server':
class Server: public Print
^
In file included from C:\Users\kevin\Documents\Arduino\hardware\espressif\esp32\cores\esp32/Stream.h:26:0,
from C:\Users\kevin\Documents\Arduino\hardware\espressif\esp32\cores\esp32/Arduino.h:151,
from sketch\Simple.ino.cpp:1:
C:\Users\kevin\Documents\Arduino\hardware\espressif\esp32\cores\esp32/Print.h:60:20: note: virtual size_t Print::write(uint8_t)
virtual size_t write(uint8_t) = 0;
^
In file included from C:\Users\kevin\Documents\Arduino\hardware\espressif\esp32\cores\esp32/Arduino.h:156:0,
from sketch\Simple.ino.cpp:1:
C:\Users\kevin\Documents\Arduino\hardware\espressif\esp32\cores\esp32/Server.h:28:18: note: virtual void Server::begin()
virtual void begin() =0;
^
C:\Users\kevin\AppData\Local\Temp\arduino_modified_sketch_461112\Simple.ino: In function 'void rootPage()':
Simple:53: error: expected unqualified-id before '.' token
Server.send(200, "text/html", content);
^
C:\Users\kevin\AppData\Local\Temp\arduino_modified_sketch_461112\Simple.ino: In function 'void setup()':
Simple:62: error: expected unqualified-id before '.' token
Server.on("/", rootPage);
^
Simple:67: error: request for member 'config' in 'Portal', which is of non-class type 'AutoConnect(Server)'
Portal.config(Config);
^
Simple:70: error: request for member 'begin' in 'Portal', which is of non-class type 'AutoConnect(Server)'
if (Portal.begin()) {
^
C:\Users\kevin\AppData\Local\Temp\arduino_modified_sketch_461112\Simple.ino: In function 'void loop()':
Simple:77: error: request for member 'handleClient' in 'Portal', which is of non-class type 'AutoConnect(Server)'
Portal.handleClient();
^
exit status 1
'WebServer' does not name a type
Please consider crafting an example that includes a simple data entry page, possibly using pagebuilder.
Lacking practical experience with HTML, my attempts to extend the existing autoconnect, or pagebuilder examples to include a simple data entry page (i..e integers, ip address, string values) has been difficult for all the moving parts in learning autoconnect and pagebuilder, and HTML.
Hello Hieromon,
i'm running in some problem's which is from the start of using your piece of code.
after editing the code, i have to erease the hole esp8266 device otherwise the device keeps rebooting.
Could it be that, some variables for wifi network are stored in program memory ?
with editing i mean add some code, not change a hard code parameter setting.
This topic from #3 .
Another thing your module when I start the AP I notice that it is good and it works but I think you should have the way to start with a dynamic SSID (for example the Mac or chip name) as well as start it with a key or without a password, that way the bookstore WiFi anafe, eh opted for you Liberia because in my opinion it is better developed.
Hi, I just found this great library, and I think it's very useful and fits my needs. When I try to configure my ESP8266 WiFi through my phone, it works great and normal. But, I have problem when I want to change my ESP8266 WiFi connection while it's already connected to another WiFi connection that i already set before. I can't find my ESP8266 AP WiFi Connection and the only way to change the WiFi connection is by connect to the same router and find out the ESP8266 IP Address. Is there any other way to connect to the captive portal through ESP8266 AP?
Anyone have this same problem?
Hardware:
Board: ESP32 DEVKIT1
Core Installation version: 1.0.1-git this one
IDE name: Arduino IDE
Flash Frequency: 80Mhz
PSRAM enabled: no
Upload Speed: 115200
Computer OS: Linux Mint 19.1 Mate
I'm trying to integrate a simple GET Request inside a simple sketch containing AutoConnect but combining the two nothing works. The /_ac doesn't work, the simple "Hello, world !" page doesn't work, the GET Request doesn't work.
#include <WiFi.h>
#include <WebServer.h>
#include <AutoConnect.h>
#include <HTTPClient.h>
WebServer Server;
AutoConnect Portal(Server);
void rootPage() {
char content[] = "Hello, world !";
Server.send(200, "text/plain", content);
}
void setup () {
delay(1000);
Serial.begin(115200);
Serial.println();
Server.on("/", rootPage);
if (Portal.begin()) {
Serial.println("WiFi Connected: " + WiFi.localIP().toString());
}
}
void loop() {
HTTPClient http;
http.begin("http://jsonplaceholder.typicode.com/comments?id=10"); //Specify the URL
int httpCode = http.GET();
if(httpCode > 0) {
String payload = http.getString();
Serial.println(httpCode);
Serial.println(payload);
} else {
Serial.println("Error on HTTP request");
}
http.end();
Portal.handleClient();
delay(10000);
}
14:00:02.188 -> ets Jun 8 2016 00:22:57
14:00:02.188 ->
14:00:02.188 -> rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
14:00:02.188 -> configsip: 0, SPIWP:0xee
14:00:02.188 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
14:00:02.188 -> mode:DIO, clock div:1
14:00:02.188 -> load:0x3fff0018,len:4
14:00:02.188 -> load:0x3fff001c,len:1100
14:00:02.188 -> load:0x40078000,len:10088
14:00:02.188 -> load:0x40080400,len:6380
14:00:02.188 -> entry 0x400806a4
14:00:03.505 ->
14:00:03.505 -> [W][WiFiGeneric.cpp:570] setSleep(): STA has not been started
14:00:03.704 -> [D][WiFiGeneric.cpp:342] _eventCallback(): Event: 0 - WIFI_READY
14:00:03.704 -> [D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
14:00:03.803 -> [AC] WiFi.config(IP=0.0.0.0, Gateway=0.0.0.0, Subnetmask=0.0.0.0, DNS1=0.0.0.0, DNS2=0.0.0.0) [AC] WiFi.begin()
14:00:03.803 -> [AC] Connecting...[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 4 - STA_CONNECTED
14:00:04.699 -> .[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 7 - STA_GOT_IP
14:00:04.732 -> [D][WiFiGeneric.cpp:385] _eventCallback(): STA IP: 192.168.1.101, MASK: 255.255.255.0, GW: 192.168.1.1
14:00:04.997 -> [AC] established IP:192.168.1.101
14:00:04.997 -> [AC] http server started
14:00:05.031 -> WiFi Connected: 192.168.1.101
14:00:05.031 -> [D][HTTPClient.cpp:265] beginInternal(): host: jsonplaceholder.typicode.com port: 80 url: /comments?id=10
14:00:05.064 -> [D][HTTPClient.cpp:977] connect(): connected to jsonplaceholder.typicode.com:80
14:00:05.130 -> [D][HTTPClient.cpp:1102] handleHeaderResponse(): code: 200
14:00:05.130 -> [D][HTTPClient.cpp:1105] handleHeaderResponse(): size: 322
14:00:05.130 -> [D][WiFiClient.cpp:463] connected(): Disconnected: RES: 0, ERR: 128
14:00:05.163 -> [D][HTTPClient.cpp:1239] writeToStreamDataBlock(): connection closed or file end (written: 322).
14:00:05.163 -> [D][HTTPClient.cpp:369] disconnect(): tcp is closed
14:00:05.163 ->
14:00:05.163 -> [D][HTTPClient.cpp:369] disconnect(): tcp is closed
14:00:05.163 ->
14:00:15.146 -> [D][HTTPClient.cpp:265] beginInternal(): host: jsonplaceholder.typicode.com port: 80 url: /comments?id=10
14:00:15.179 -> [D][HTTPClient.cpp:977] connect(): connected to jsonplaceholder.typicode.com:80
14:00:15.312 -> [D][HTTPClient.cpp:1102] handleHeaderResponse(): code: 200
14:00:15.312 -> [D][HTTPClient.cpp:1105] handleHeaderResponse(): size: 322
14:00:15.312 -> [D][WiFiClient.cpp:463] connected(): Disconnected: RES: 0, ERR: 128
14:00:15.312 -> [D][HTTPClient.cpp:1239] writeToStreamDataBlock(): connection closed or file end (written: 322).
14:00:15.345 -> [D][HTTPClient.cpp:369] disconnect(): tcp is closed
14:00:15.345 ->
14:00:15.345 -> is nobis reprehenderit ipsum amet nulla\nquia quas dolores velit et non\naut quia necessitatibus\nnostrum quaerat nulla et accusamus nisi facilis"
14:00:15.345 -> }
14:00:15.345 -> ]
14:00:15.345 -> [D][HTTPClient.cpp:369] disconnect(): tcp is closed
14:00:15.345 ->
And so on.
Is it possible to select a filename on a custom webpage, or is there a way to implement this.
I realy would like to have this feather.
Thanks for the useful library. Is there any example for an On Demand AP? Say I use a button press to put this into WiFi configuration mode ( even if it is connected to an existing WiFi station ). If I press the button for 5 seconds then I want the WiFi credentials to be wiped off and the ESP32 should restart in AP mode. The button press / delay and all I have written but need a robust way of getting the ESP32 into the AP mode. I think I did try setting the autoConnection to false but it would not get back into the AP mode unless I erase the eeprom.
The best would be that the button press gets the ESP32 into AP mode ( even if there is any saved wifi credentials ) ... then times out after a while if no new AP is set. This way one can also switch from one AP to another AP.
Hello ! First of all, I have to say thank you for your great work !
Hardware:
Board: ESP32 DEVKIT1
Core Installation version: 1.0.1-git this one
IDE name: Arduino IDE
Flash Frequency: 80Mhz
PSRAM enabled: no
Upload Speed: 115200
Computer OS: Linux Mint 19.1 Mate
Secondly, I've been trying to remake the FSBrowser example but with no luck. I've uploaded 4 files into the ESP32 and the only thing that works is this piece of code:
SPIFFS.begin();
{
File root = SPIFFS.open("/");
File file = root.openNextFile();
while(file){
String fileName = file.name();
size_t fileSize = file.size();
DBG_OUTPUT_PORT.printf("FS File: %s, size: %s\n", fileName.c_str(), formatBytes(fileSize).c_str());
file = root.openNextFile();
}
DBG_OUTPUT_PORT.printf("\n");
}
Here is one output:
16:44:51.800 -> ets Jun 8 2016 00:22:57
16:44:51.800 ->
16:44:51.800 -> rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
16:44:51.800 -> configsip: 0, SPIWP:0xee
16:44:51.800 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
16:44:51.833 -> mode:DIO, clock div:1
16:44:51.833 -> load:0x3fff0018,len:4
16:44:51.833 -> load:0x3fff001c,len:1100
16:44:51.833 -> load:0x40078000,len:10088
16:44:51.833 -> load:0x40080400,len:6380
16:44:51.833 -> entry 0x400806a4
16:44:53.127 ->
16:44:53.293 -> FS File: /logo.png, size: 3.80KB
16:44:53.293 -> FS File: /login.css, size: 1.62KB
16:44:53.293 -> FS File: /index.html, size: 880B
16:44:53.326 -> FS File: /back-image.jpg, size: 146.42KB
16:44:53.359 ->
16:44:53.359 -> Connecting to wifi-ssid
16:44:53.525 -> [D][WiFiGeneric.cpp:342] _eventCallback(): Event: 0 - WIFI_READY
16:44:53.558 -> [D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
16:44:53.624 -> [AC] WiFi.config(IP=0.0.0.0, Gateway=0.0.0.0, Subnetmask=0.0.0.0, DNS1=0.0.0.0, DNS2=0.0.0.0) [AC] WiFi.begin()
16:44:53.658 -> [AC] Connecting...[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 4 - STA_CONNECTED
16:44:54.553 -> .[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 7 - STA_GOT_IP
16:44:54.553 -> [D][WiFiGeneric.cpp:385] _eventCallback(): STA IP: 192.168.1.102, MASK: 255.255.255.0, GW: 192.168.1.1
16:44:54.852 -> [AC] established IP:192.168.1.102
16:44:54.852 -> [AC] http server started
16:44:54.852 -> HTTP server started
16:44:54.852 ->
16:44:54.852 -> Connected! IP address: 192.168.1.102
16:44:54.852 -> Open http://esp32fs.local/edit to see the file browser
16:45:19.404 -> [AC] /_ac
16:45:19.404 -> [AC] Page[/_ac] allocated
16:45:19.404 -> [AC] 192.168.1.102/_ac
16:45:19.404 -> [E][WString.cpp:185] changeBuffer(): realloc failed! Buffer unchanged
16:45:19.438 -> [D][WiFiClient.cpp:463] connected(): Disconnected: RES: 0, ERR: 128
16:45:19.603 -> [AC] 192.168.1.102/_ac
/edit, /list don't work.
/edit returns FileNotFound
/list returns BAD ARGS
Do you have any idea on why isn't it working ?
Also, where should I start if I want to serve another webpage/webinterface when pressing HOME ?
Or, what if I want to customize the AutoConnect page ? Should I be able to do that ?
In the case that an HTML content length exceeds around 6000 bytes (depending on remaining RAM) when HTML generated by AutoConnect is merged with HTML output of the user sketch side, TCP stack will not be able to allocate the temporary storage and transmission will become incomplete. I found the cause of this problem in the process of v0.9.7 support. Also, it is related to #16 and the solution hint is in esp8266/Arduino#3205.
The solution is to implement Chunked-encoding with the PageBuilder library which is the HTML generation part included in AutoConnect. I'm revising it now and will be released ahead of AutoConnect v0.9.7.
Please, I'm doing the example of mqttRSSI, but I need to do some action in the esp8266, for that I have to subscribe but your example is only to publish.
Best Regards
Hi I'm using your library on a LoLin D32 Pro (ESP32 WROVER).
The start of the Access Point is OK and I can get the root page on my smartphone. However as soon as I try to access (automatically or manually) the _ac page, I get the following error.
[AC] 192.168.244.1/_ac
***ERROR*** A stack overflow in task loopTask has been detected.
abort() was called at PC 0x4008f554 on core 1
0x4008f554: vApplicationStackOverflowHook at /home/mfreeze/esp/esp-idf/components/esp32/panic.c:680
Backtrace: 0x4008f310:0x3ffbd710 0x4008f53d:0x3ffbd730 0x4008f554:0x3ffbd750 0x4008ca17:0x3ffbd770 0x4008e3b0:0x3ffbd790 0x4008e366:0x3ffbd918
0x4008f310: invoke_abort at /home/mfreeze/esp/esp-idf/components/esp32/panic.c:680
0x4008f53d: abort at /home/mfreeze/esp/esp-idf/components/esp32/panic.c:680
0x4008f554: vApplicationStackOverflowHook at /home/mfreeze/esp/esp-idf/components/esp32/panic.c:680
0x4008ca17: vTaskSwitchContext at /home/mfreeze/esp/esp-idf/components/freertos/tasks.c:3564
0x4008e3b0: _frxt_dispatch at /home/mfreeze/esp/esp-idf/components/freertos/portasm.S:406
0x4008e366: _frxt_int_exit at /home/mfreeze/esp/esp-idf/components/freertos/portasm.S:206
Rebooting...
I'm not using the Arduino IDE (I use the toolchain instead) and I don't have anything else running on the board.
I'm using the code provided in the Readme:
/* WeatherStation for ValueBugs Project
* Written to be run on ESP32 board
* Connect to WiFi
* Get measures from sensors : 2 BME260 sensor (temperature/humidity/pressure) + 1 DS18B20 (temperature) + 1 HL-69 (moisture)
* Write values on influxdb
* Print values on screen
*
*
*/
/*-----------------------------------------------------------------------------
* Libraries
*-----------------------------------------------------------------------------*/
/* {{{ -------- Libraries -------- */
#include <WiFi.h>
#include <WebServer.h>
#include <AutoConnect.h>
/* }}} */
/*-----------------------------------------------------------------------------
* Constants
*-----------------------------------------------------------------------------*/
/* {{{ -------- Constants -------- */
WebServer Server;
AutoConnect Portal(Server);
/* }}} */
/*-----------------------------------------------------------------------------
* Functions
*-----------------------------------------------------------------------------*/
/* {{{ -------- Functions -------- */
void rootPage() {
char content[] = "Hello, world";
Server.send(200, "text/plain", content);
}
/* }}} */
void setup()
{
/* Initialisation du port sรฉrie */
Serial.begin(115200);
Server.on("/", rootPage);
if (Portal.begin()) {
Serial.println("WiFi connected: " + WiFi.localIP().toString());
}
}
void loop()
{
Portal.handleClient();
//delay(5000); //Delay 5 sec.
}
Hi,
Autoconnect is an excellent library with a great user manual. On behalf of the community : Thank you!
Here is my problem (probably simple, but I can not ...) : I would like to recover the STA MAC parameter for use in my sketch on ESP32. How to recover this value?
If I use STA_MAC in my Sketch, I get the following error message STA_MAC was not declared in this scope. I looked in the different files of the directory src, but I don't understand how to pass this parameter in my Sketch.
I have the option to retrieve this setting by using ESP.getEfuseMac ()
, but STA_MAC is already used by the Autoconnect library (visible on the main menu), and that would simplify my code.
Can you help me please ?
Thank you in advance.
Joel
In file included from
...\AppData\Local\Temp\arduino_modified_sketch_331069\Simple.ino:18:0:
...\My Documents\Arduino\libraries\AutoConnect-master\src/AutoConnect.h:30:25: fatal error: PageBuilder.h: No such file or directory
#include <PageBuilder.h>
^
compilation terminated.
exit status 1
Error compiling for board WeMos D1 R2 & mini.
Now you have 2 labels, Reset... and Disconnect.
one is for ereasing the device and one for rebooting. Why not name what they do.
Erasing device...
Rebooting device...
Hey! I am trying to use your library to connect to blynk! I can't get to fetch the custom value after device restarts in the code. How to fetch it ?
I'm testing AutoConnect with the SimpleExample and always have the problem that immediately after the connection to pc, iPad or mobile is established the ESP2866 is rebooting:
[AC] WiFi.config(IP=(IP unset), Gateway=(IP unset), Subnetmask=(IP unset), DNS1=(IP unset), DNS2=(IP unset)) [AC] DHCP client(STARTED)
[AC] WiFi.begin()
[AC] Connecting....................................................................................................[AC] time out IP:(IP unset)
[AC] http server started
[AC] SoftAP esp8266ap/12345678 CH(1) H(0) IP:192.168.244.1
[AC] DNS server started
[AC] /connecttest.txt
[AC] Page[] allocated
[AC] www.msftconnecttest.com/bag
[AC] Page[] allocated
[AC] init-p01st.push.apple.com/connecttest.txt
[AC] Page[] allocated
[AC] www.msftconnecttest.com/redirect
[AC] Page[] allocated
[AC] www.msftconnecttest.com/_ac
[AC] Page[/_ac] allocated
[AC] 192.168.244.1/_ac
ets Jan 8 2013,rst cause:4, boot mode:(1,6)
wdt reset
I tested it with NodeMcu v1 and Lolin V3. Same behaviour.
I have two sensors and an oled connected. Which is running fine.
Even if I disconnect everything it's not working.
Thanks for your help.
Is there a possibility of sending json response (a REST API or something) instead of html? This would give developers different ways of integrating AutoConnect into their projects. Thanks
Hey the page "Configure new AP" renders blank at times, after multiple refresh it loads, its usually happening when more than 7+ ssid are found. Is it a bug or is there any workaround for that or is it some issue with my code?
UPDATE :
Tried the library with the most basic sketch and still the same issue, so its an issue with the library i guess when there's more than 6-7 SSID are found.
Out of topic, is there any way to reset wifi credentials?
My Code - Gdrive Link
Arduino: 1.8.5 (Windows 10), Board: "Adafruit HUZZAH ESP8266, 80 MHz, 115200, 4M (3M SPIFFS)"
In file included from C:\Users\xxx\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/WiFiClient.h:25:0,
from C:\Users\xxx\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/ESP8266WiFi.h:39,
from C:\Users\xxx\Arduino\libraries\AutoConnect\src\AutoConnectPage.cpp:10:
c:\users\xxx\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\bits\stl_vector.h: In member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::_M_check_len(std::vector<_Tp, _Alloc>::size_type, const char*) const':
C:\Users\xxx\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Arduino.h:253:18: error: expected unqualified-id before '(' token
#define max(a,b) ((a)>(b)?(a):(b))
^
c:\users\xxx\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\bits\stl_bvector.h: In member function 'std::vector<bool, _Alloc>::size_type std::vector<bool, _Alloc>::_M_check_len(std::vector<bool, _Alloc>::size_type, const char*) const':
C:\Users\xxx\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\cores\esp8266/Arduino.h:253:18: error: expected unqualified-id before '(' token
#define max(a,b) ((a)>(b)?(a):(b))
^
exit status 1
Error compiling for board Adafruit HUZZAH ESP8266.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Hi trying for days to compile the basic code on arduino for auto connect and keep getting the same error in the log. I've checked against the source code for AutoConnectPage.cpp and the code looks identical?, Im probably doing something wrong but for the life in me I can't figure it out. i'm trying to run on to a esp32 dev board with the following..
#include <WiFi.h>
#include <WebServer.h>
#include <AutoConnect.h>
WebServer Server;
AutoConnect Portal(Server);
void rootPage() {
char content[] = "Hello, world";
Server.send(200, "text/plain", content);
}
void setup() {
delay(1000);
Serial.begin(115200);
Serial.println();
Server.on("/", rootPage);
if (Portal.begin()) {
Serial.println("HTTP server:" + WiFi.localIP().toString());
}
}
void loop() {
Portal.handleClient();
}
And keep getting the same on the console log.....
/Documents/Arduino/libraries/AutoConnect/src/AutoConnectPage.cpp: In member function 'String AutoConnect::_token_STATION_STATUS(PageArgument&)':
/Users/Documents/Arduino/libraries/AutoConnect/src/AutoConnectPage.cpp:892:57: error: 'wlStatusSymbol' may be used uninitialized in this function [-Werror=maybe-uninitialized]
return "(" + String(st) + ") " + String(wlStatusSymbol);
^
i would like to see a webupdate feather in the menu, now in the main file i add ArduinoOta.h and ESP8266HTTPUpdateServer.h.
But it would realy be nice that this is implemented within autoconnect.
Hi, I have Android App , I will want connect AP point from my mobile app, but when i connect to AP I embebed web in my app however AutoConnect Open brower with you interface.
how i can disable open browser automatily? because i will open browen in my internal mobile app.
Thanks.
I have Arduino 1.8.9, ESP8266 v2.5, ESP32 v1.1 and ArduinoJson v6.10 all loaded on a frsh Arduino install. I get the following error message;
Error while detecting libraries included by C:\Arduino189\portable\sketchbook\libraries\AutoConnect\src\AutoConnectAux.cpp
and then I get a huge list of errors mentioning JSON. The lis is so long I can't paste it here
Do you have any idea what is wrong? please. I have tried loading the library from Library manager and manually from the zip download.
I really having difficulty to have a automatic loading index.html saved on the SPIFFS. I need to automatically open index.html without user require open browser and type the IP.
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
Serial.println("/");
Serial.println("redirecting to /index.html");
request->redirect("/index.html");
});
#if ESP8266
if(!SPIFFS.begin()){
Serial.println("SPIFFS Mount Failed");
}
#endif
#if ESP32
if(!SPIFFS.begin(true)){
Serial.println("SPIFFS Mount Failed on ..");
}
#endif
listDir(SPIFFS, "/", 0);
server.serveStatic("/", SPIFFS, "/").setCacheControl("max-age=600").setDefaultFile("index.html");
server.begin();
Thank you
Hi trying for days to compile the basic code on arduino for auto connect and keep getting the same error in the log. I've checked against the source code for AutoConnectUploadImpl.h and the code looks identical?, Im probably doing something wrong but for the life in me I can't figure it out. i'm trying to run on to a esp8266 dev board with the following..
#include <AutoConnect.h>
#include <ESP8266WiFi.h> // Replace with WiFi.h for ESP32
#include <ESP8266WebServer.h> // Replace with WebServer.h for ESP32
ESP8266WebServer Server; // Replace with WebServer for ESP32
AutoConnect Portal(Server);
void rootPage() {
char content[] = "Hello, world";
Server.send(200, "text/plain", content);
}
void setup() {
delay(1000);
Serial.begin(115200);
Serial.println();
Server.on("/", rootPage);
if (Portal.begin()) {
Serial.println("WiFi connected: " + WiFi.localIP().toString());
}
}
My error: Arduino: 1.8.8 (Windows 10), Board: "NodeMCU 0.9 (ESP-12 Module), 80 MHz, Flash, 4M (1M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"
In file included from C:\Users\vladp\Documents\Arduino\libraries\AutoConnect-master\src\AutoConnectAux.cpp:13:0:
C:\Users\vladp\Documents\Arduino\libraries\AutoConnect-master\src\AutoConnectUploadImpl.h: In member function 'virtual void AutoConnectUploadSD::_close()':
C:\Users\vladp\Documents\Arduino\libraries\AutoConnect-master\src\AutoConnectUploadImpl.h:135:13: error: 'SDClassT' has no member named 'end'
_media->end();
^
exit status 1
Error compiling for board NodeMCU 0.9 (ESP-12 Module).
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Thanks,
Vlad
Hello,
I prever to have a uniq SSID when in softAP mode.
So i alter in file AutoConnect.h at line 117
apid(String(AUTOCONNECT_APID),
into
apid(String(AUTOCONNECT_APID)+"_"+String(ESP.getChipId(),HEX)),
maybee this could be implemented in the next release.
With this small modification, you dont get any trouble when there are more then one devices in softAP mode.
Next thing i changed is a setting for hostname, maybe later it could be implemented in a setup page so it is stored in eeprom.
in AutoConnect.h after line 214: ESP8266WebServer& host();
i added String AP_hostname;
in AutoConnect.cpp before line 110: // Try to connect by STA immediately.
i added WiFi.hostname(AP_hostname);
now you could set the hostname in the main ino file just before portal.begin() enter
Portal.AP_hostname = "name_of_host";
I am following the mqttRSSI example for custom parameters.
I have it working - I can set 2 values, and they are saved to flash.
How do I load them when the ESP32 is rebooted? Currently, while they are saved to flash, the values of my variables in my code are not set unless they are set via the web console.
I don't see where they are loaded in mqttRSSI on power-on.
how to take the timing from the computer or RTC? the home page timing keep remind as 1970/01/01(Thr) 00:04:25. seems it didn't get timing from the website .
hi Hieromon,
i can't make a sence on hot to set the initial values on a custom config page.
this is what i have so var:
// Loading from PROGMEM
const char settings[] PROGMEM = R"raw(
{
"title" : "Dimmer Settings",
"uri" : "/Settings",
"menu" : true,
"element" : [
{
"name" : "caption",
"type" : "ACText",
"value" : "Dimmer settings"
},
{ "name" : "Dimvalue1",
"type" : "ACInput",
"value" : "10",
"pattern": "^[0-6]?[0-9]$", //review
"label" : "Minimum dimvalue"
},
{
"name": "save",
"type": "ACSubmit",
"value": "Save",
"uri": "/saveDim"
}
]
}
`)raw";
and this is my variable to send to the page
byte minDimValue;
this is in my setup
portal.load(settings);
portol.on("/Settings",settingsOn, AC_EXIT_AHEAD); //is this right, and how should settingsOn look like
portal.config(config);
Good day All who might be monitoring this git. I would like to know how to make the username and password persistent, such that if the device can't connect to its current WiFi, the existing username and passwords are not over-written/erased until a new one is written. From what I gather whenever the http server is started" SoftAP" the existing values are erased. How can I change this? Thanks in advance
Hi Hieromon,
when commenting out AC_DEBUG in AutoConnectDefs.h i get an error.
The error is in file AutoConnectEllementBasisImpl.h on line 86 you have AC_DEBUG this should be AC_DBG
after changing the file is compiling, please update this little bug.
If used in an area where many wifi networks are visible it may take a number of seconds (10? 20?) to populate the list of wifi access points. It would be great if there was some sort of feedback given to the user that this is happening - to avoid the user thinking the device has hung.
If no one is working on this I'll try to send in a PR someday - but I wanted to record it.
Downstream issue here: geeksville/ezdevice-esp32#1
To all contributors and Users,
Thank you for your interest in AutoConnect. I prepared for the prototype of the update server and application sketch which for sketch binary updating via OTA. I will implementation for v0.99 based on this prototype and will also add automatic updates by version level according to each device.
The OTA update feature will be incorporated by only one parameter with AutoConnectConfig.
Related issue #26 #50
Please evaluate this prototype if you can and post any comments if you have any requirements that I need to consider for implementation.
The following menu is in interactive mode. In automatic update mode, it will behave in the background.
When using Autoconnect-enhance-autoConnectAux, i get an wdt error when using:
config.apid = "arnoldg"; config.hostName = "arnoldg"; Portal.config(config); Portal.begin();
when programming
config.apid = String(AUTOCONNECT_APID)+"_"+String(ESP.getChipId(),HEX); config.hostName = "arnoldg"; Portal.config(config); Portal.begin();
the app runs fine, looks like config.apid can't handel a " " string
I'm new in ESP8266 and manage to work the Modbus TCP serve and connect to wifi using the stardard connection. Now I would like to use AutoConnect but wondering how to run the webserver serving port 502 which is the standard port for this communication protocol.
Please note that it doesn't work with the latest version of arduinojson library i.e. 6.9.1 ,mention that in the readme to not use the latest library !
Hi,
just discover your lib and I try a sample to test the ac menu.
First, I thing a error appear in line 41
/head
head
seem more appropriate.
After, could you explain me this line :
static const char PROGMEM mold_page[] = R"*lit(
and particulary R"lit
expression ?
I compile the file and wen I try to connect to the ESP32 (core v1.0.1), I have the following trace :
[AC] WiFi.config(IP=0.0.0.0, Gateway=0.0.0.0, Subnetmask=0.0.0.0, DNS1=0.0.0.0, DNS2=0.0.0.0)
[AC] WiFi.begin()
[AC] Connecting.....................................................................................................
[AC] time out IP:0.0.0.0
[AC] http server started
[AC] SoftAP esp32ap/12345678 CH(1) H(0) IP:192.168.11.1
Captive portal started, SoftAP IP:192.168.11.1
[AC] DNS server started
E (389186) event: mismatch or invalid event, id=63
E (389187) event: default event handler failed!
dhcps: send_offer>>udp_sendto result 0
[AC] /generate_204
[AC] Page[] allocated
but I have nothing on my smartphone web browser ? And I can't know what?
Could you help me ?
Best regards
Nomi
PS : I use the library v0.9.6 with PageBuilder v1.3.1 and ArduinoJSon v5.13.4
Even if one installs the latest version 0.9.6, it shows as 0.9.5. I guess the library.json still has the older ver no.
Using unmodified example "Simple" om am ESP32 Devkit1 results in a dump:
Decoding stack results
0x400ee4dd: _unsetenv_r at ../../../.././newlib/libc/stdlib/setenv_r.c line 159
0x400f5a0e: nvs::Page::findItem(unsigned char, nvs::ItemType, char const*, unsigned int&, nvs::Item&, unsigned char, nvs::VerOffset) at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/nvs_flash/src/nvs_page.cpp line 761
0x400f5a46: nvs::Page::findItem(unsigned char, nvs::ItemType, char const*, unsigned int&, nvs::Item&, unsigned char, nvs::VerOffset) at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/nvs_flash/src/nvs_types.hpp line 65
0x400de96e: WebServer::_handleRequest() at C:\Users\xxx\Documents\Arduino\hardware\espressif\esp32\libraries\WebServer\src\WebServer.cpp line 635
0x400d3092: receivedCallback(char*, unsigned char*, unsigned int) at C:\Users\xxx\Documents\Arduino\ActionNode_V1.5V_light/ActionNode_V1.5V_light.ino line 1792
0x400d33ed: receivedCallback(char*, unsigned char*, unsigned int) at C:\Users\xxx\Documents\Arduino\ActionNode_V1.5V_light/ActionNode_V1.5V_light.ino line 1884
0x4008e85d: rtc_init at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/soc/esp32/rtc_init.c line 34
`018,len:4
load:0x3fff001c,len:1100
load:0x40078000,len:10088
load:0x40080400,len:6380
entry 0x400806a4
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 13 - AP_START
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 3 - STA_STOP
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 3 - STA_STOP
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 13 - AP_START
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 3 - STA_STOP
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 14 - AP_STOP
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 14 - AP_STOP
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 14 - AP_STOP
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[AC] WiFi.config(IP=0.0.0.0, Gateway=0.0.0.0, Subnetmask=0.0.0.0, DNS1=0.0.0.0, DNS2=0.0.0.0) [E][WiFiSTA.cpp:211] begin(): connect failed!
[AC] WiFi.begin()
[AC] Connecting.....................................................................................................[AC] time out IP:0.0.0.0
[AC] http server started
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 13 - AP_START
[AC] SoftAP esp32ap/12345678 CH(1) H(0) IP:192.168.244.1
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 13 - AP_START
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 13 - AP_START
[AC] DNS server started
E (49379) event: mismatch or invalid event, id=63
E (49379) event: default event handler failed!
Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x400014dc PS : 0x00060c30 A0 : 0x800ee4e0 A1 : 0x3ffb8f40
A2 : 0x070518ff A3 : 0x070518fb A4 : 0x000000ff A5 : 0x0000ff00
A6 : 0x00ff0000 A7 : 0xff000000 A8 : 0x00000000 A9 : 0x00000000
A10 : 0x00000000 A11 : 0x3ffb9142 A12 : 0x00000000 A13 : 0x00000000
A14 : 0x60000000 A15 : 0x00000000 SAR : 0x00000004 EXCCAUSE: 0x0000001c
EXCVADDR: 0x070518ff LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xfffffffc
Backtrace: 0x400014dc:0x3ffb8f40 0x400ee4dd:0x3ffb8f50 0x400f5a0e:0x3ffb9260 0x400f5a46:0x3ffb92f0 0x400de96e:0x3ffb9330 0x400d3092:0x3ffb9390 0x400d33ed:0x3ffb94b0 0x4008e85d:0x3ffb94e0
Rebooting...
ets Jun 8 2016 00:22:57
rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1100
load:0x40078000,len:10088
load:0x40080400,len:6380
entry 0x400806a4
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 13 - AP_START
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 3 - STA_STOP
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 3 - STA_STOP
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 13 - AP_START
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 3 - STA_STOP
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 14 - AP_STOP
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 14 - AP_STOP
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 14 - AP_STOP
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[AC] WiFi.config(IP=0.0.0.0, Gateway=0.0.0.0, Subnetmask=0.0.0.0, DNS1=0.0.0.0, DNS2=0.0.0.0) [E][WiFiSTA.cpp:211] begin(): connect failed!
[AC] WiFi.begin()
[AC] Connecting.....................................................................................................[AC] time out IP:0.0.0.0
[AC] http server started
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 0 - WIFI_READY
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 2 - STA_START
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 13 - AP_START
[AC] SoftAP esp32ap/12345678 CH(1) H(0) IP:192.168.244.1
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 13 - AP_START
[D][WiFiGeneric.cpp:342] _eventCallback(): Event: 13 - AP_START
[AC] DNS server started
`
I was trying the library and it crashes for me using the any of the examples (Simple example used bellow) on every wifi connect. Any ideas? Can you help me use interpret the stack?
Thank you.
MY CONFIGURATION:
Hardware: nodemcu v3 12e (Lolin)
Core Version: 2.4.1 stableSettings in IDE
ide 1.8.5Module: nodemcu 1.0 12e
Flash Size: 4MB/1MB
IwIP Variant: v2 low memory (tried high bandwith as well)
CPU Frequency: 80Mhz
Flash Frequency: 80Mhz
Upload Using: SERIALAutoConnect version: 1.9.2
PageBuilder: 1.0.1
Example: Simple.ino
SKETCH
/*
Simple.ino, Example for the AutoConnect library.
Copyright (c) 2018, Hieromon Ikasamo
https://github.com/Hieromon/AutoConnect
This software is released under the MIT License.
https://opensource.org/licenses/MIT
*/
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <time.h>
#include <AutoConnect.h>
ESP8266WebServer Server;
AutoConnect Portal(Server);
#define TIMEZONE (3600 * 9) // Tokyo
#define NTPServer1 "ntp.nict.jp" // NICT japan.
#define NTPServer2 "time1.google.com"
void rootPage() {
String content =
"<html>"
"<head>"
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">"
"</head>"
"<body>"
"<h2 align=\"center\" style=\"color:blue;margin:20px;\">Hello, world</h2>"
"<h3 align=\"center\" style=\"color:gray;margin:10px;\">{{DateTime}}</h3>"
"<p style=\"padding-top:10px;text-align:center\">" AUTOCONNECT_LINK(COG_32) "</p>"
"</body>"
"</html>";
static const char *wd[7] = { "Sun","Mon","Tue","Wed","Thr","Fri","Sat" };
struct tm *tm;
time_t t;
char dateTime[26];
t = time(NULL);
tm = localtime(&t);
sprintf(dateTime, "%04d/%02d/%02d(%s) %02d:%02d:%02d.",
tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
wd[tm->tm_wday],
tm->tm_hour, tm->tm_min, tm->tm_sec);
content.replace("{{DateTime}}", String(dateTime));
Server.send(200, "text/html", content);
}
void setup() {
delay(1000);
Serial.begin(115200);
Serial.println();
Server.on("/", rootPage);
if (Portal.begin()) {
Serial.println("WiFi connected: " + WiFi.localIP().toString());
configTime(TIMEZONE, 0, NTPServer1, NTPServer2);
}
}
void loop() {
Portal.handleClient();
}
LOGS
wifi evt: 7
wifi evt: 7
wifi evt: 7
:urn 58
:urd 58, 58, 0
:urn 60
:urch 60, 35
:urd 60, 60, 0
:urd 35, 35, 0
:urn 35
:urd 35, 35, 0
WS:ac
:rn 131
:ref 1
WS:av
:ref 2
:ur 2
New client
:ref 2
:ur 2
method: GET url: /hotspot-detect.html search:
headerName: Host
headerValue: captive.apple.com
headerName: Connection
headerValue: close
headerName: User-Agent
headerValue: CaptiveNetworkSupport-355.30.1 wispr
:c0 1, 131
args:
Request: /hotspot-detect.html
Arguments:
request handler not found
:ref 2
:ur 2
:wr 122 122 0
:wrc 122 122 0
:ref 2
wifi evt: 7
:ur 2
:ref 2
:close
:ur 2
:ur 1
WS:dis
:del
WS:ac
:ref 1
WS:av
:ref 2
:ur 2
New client
:ref 2
:ur 2
:rn 111
method: GET url: /_ac search:
Fatal exception 3(LoadStoreErrorCause):
epc1=0x40214024, epc2=0x00000000, epc3=0x00000000, excvaddr=0x4024657e, depc=0x00000000Exception (3):
epc1=0x40214024 epc2=0x00000000 epc3=0x00000000 excvaddr=0x4024657e depc=0x00000000ctx: cont
sp: 3fff16c0 end: 3fff1b40 offset: 01a0stack>>>
3fff1860: 3fff0a2c 0000041a 3fff18b0 402103e1
3fff1870: 00000000 3fff0570 3fff18b0 4021042e
3fff1880: 4024657e 3fff0570 3fff18a0 40210300
3fff1890: 0000001c 0000001c 3fff4114 4020df2d
3fff18a0: 00000000 00000000 00000000 40210364
3fff18b0: 3fff4134 0000000f 00000004 402103af
3fff18c0: 3fff0a2c 000000da 3fff1900 402103e1
3fff18d0: 3fff1930 3fff1900 3fff1900 402104e8
3fff18e0: 3ffea4a7 3fff0670 3fff0570 00000000
3fff18f0: 3fff1930 3fff0670 3fff0570 4020c405
3fff1900: 3fff2734 0000000f 00000004 402103af
3fff1910: 00000011 00000001 3fff195c 00000001
3fff1920: 3fff0570 00000001 4020c3b0 4020bf7f
3fff1930: 3fff2714 0000000f 00000004 40210510
3fff1940: 00000001 4020bf48 3fff2a6c 4020f040
3fff1950: 00000000 00000000 00000000 00000000
3fff1960: 00000000 00000000 3fff069c 40210510
3fff1970: 3ffea4a7 3fff0a50 3fff069c 4020b8e1
3fff1980: 3fff26f4 0000000f 00000004 00000001
3fff1990: 3fff077c 3fff0670 00000000 00000030
3fff19a0: ffffffff 3fffc6fc 00000001 3fff0570
3fff19b0: 3fff077c 3fff0670 00000000 00000030
3fff19c0: 00000000 00000001 3fff3fec 0000000f
3fff19d0: 00000000 3fff3fcc 0000000f 00000001
3fff19e0: 3fff2d94 0000000f 00000004 3fff3ef4
3fff19f0: 0000000f 00000003 3fff3cf4 0000001f
3fff1a00: 00000011 00000000 40210dd0 3fff0b20
3fff1a10: 3fff06c4 00000000 3fff06e0 3fff06c4
3fff1a20: 00000001 4020f008 00000001 3fff2a6c
3fff1a30: 00000000 3fff2d54 3fff069c 00000000
3fff1a40: 00000001 3fff06c4 3fff069c 4020a5ff
3fff1a50: 3fff0670 3fff077c 3fff376c 4020ee54
3fff1a60: 4023b873 00000000 40210dd0 3fff0b20
3fff1a70: 3fff0670 3fff077c 3fff0570 4020c80c
3fff1a80: 3fff0670 3fff077c 3fff0570 4020c986
3fff1a90: 40107530 01f4a8c0 40107530 01f4a8c0
3fff1aa0: 40107530 00000000 40212124 40212110
3fff1ab0: 00000000 0000012c 0000012c 4010020c
3fff1ac0: 3fffdad0 00000000 3fff29bc 3fff0b10
3fff1ad0: 3fffdad0 00000000 3fff0a50 4020c9bc
3fff1ae0: feefeffe 00000000 3fff0a50 4020717b
3fff1af0: 40207054 feefeffe 40212124 40212110
3fff1b00: 00000000 00000000 00000000 feefeffe
3fff1b10: feefeffe feefeffe feefeffe feefeffe
3fff1b20: feefeffe feefeffe 3fff0b08 40210e14
3fff1b30: feefeffe feefeffe 3fff0b20 40100a2c
<<<stack<<<
DECODED STACK
Decoding stack results
0x402103e1: String::copy(char const*, unsigned int) at /Users/user123/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/WString.cpp line 170
0x4021042e: String::String(char const*) at /Users/user123/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/WString.cpp line 36
0x40210300: String::~String() at /Users/user123/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/WString.cpp line 120
0x4020df2d: AutoConnect::_setupPage(String) at /Users/user123/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/xtensa-lx106-elf/include/c++/4.8.2/functional line 1336
0x40210364: String::changeBuffer(unsigned int) at /Users/user123/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/WString.cpp line 151
0x402103af: String::reserve(unsigned int) at /Users/user123/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/WString.cpp line 141
0x402103e1: String::copy(char const*, unsigned int) at /Users/user123/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/WString.cpp line 170
0x402104e8: String::operator=(String const&) at /Users/user123/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/WString.cpp line 215
0x4020c405: AutoConnect::_classifyHandle(HTTPMethod, String) at /Users/user123/Documents/Arduino/libraries/AutoConnect/src/AutoConnect.cpp line 509
0x402103af: String::reserve(unsigned int) at /Users/user123/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/WString.cpp line 141
0x4020c3b0: AutoConnect::_classifyHandle(HTTPMethod, String) at /Users/user123/Documents/Arduino/libraries/AutoConnect/src/AutoConnect.cpp line 496
0x4020bf7f: std::_Function_handler (AutoConnect*, std::_Placeholder1>, std::_Placeholder2>)> >::_M_invoke(std::_Any_data const&, HTTPMethod, String) at /Users/user123/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/xtensa-lx106-elf/include/c++/4.8.2/functional line 601
0x40210510: String::String(String const&) at /Users/user123/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/WString.cpp line 41
0x4020bf48: std::_Function_handler (AutoConnect*, std::_Placeholder1>, std::_Placeholder2>)> >::_M_invoke(std::_Any_data const&, HTTPMethod, String) at /Users/user123/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/xtensa-lx106-elf/include/c++/4.8.2/functional line 2054
0x4020f040: PageBuilder::canHandle(HTTPMethod, String) at /Users/user123/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/xtensa-lx106-elf/include/c++/4.8.2/functional line 2464
0x40210510: String::String(String const&) at /Users/user123/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/WString.cpp line 41
0x4020b8e1: ESP8266WebServer::_parseRequest(WiFiClient&) at /Users/user123/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/libraries/ESP8266WebServer/src/Parsing.cpp line 130
0x40210dd0: esp_yield() at /Users/user123/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/core_esp8266_main.cpp line 87
0x4020f008: PageBuilder::canHandle(HTTPMethod, String) at /Users/user123/Documents/Arduino/libraries/PageBuilder/src/PageBuilder.cpp line 45
0x4020a5ff: ESP8266WebServer::handleClient() at /Users/user123/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/libraries/ESP8266WebServer/src/ESP8266WebServer.cpp line 298
0x4020ee54: DNSServer::processNextRequest() at /Users/user123/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/libraries/DNSServer/src/DNSServer.cpp line 51
0x40210dd0: esp_yield() at /Users/user123/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/core_esp8266_main.cpp line 87
0x4020c80c: AutoConnect::handleClient() at /Users/user123/Documents/Arduino/libraries/AutoConnect/src/AutoConnect.cpp line 276
0x4020c986: AutoConnect::begin(char const*, char const*) at /Users/user123/Documents/Arduino/libraries/AutoConnect/src/AutoConnect.cpp line 139
0x40212124: std::_Function_base::_Base_manager ::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation) at /Users/user123/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/xtensa-lx106-elf/include/c++/4.8.2/functional line 1934
0x40212110: std::_Function_handler ::_M_invoke(std::_Any_data const&) at /Users/user123/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/xtensa-lx106-elf/include/c++/4.8.2/functional line 2069
0x4010020c: _umm_free at /Users/user123/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/umm_malloc/umm_malloc.c line 1291
0x4020c9bc: AutoConnect::begin() at /Users/user123/Documents/Arduino/libraries/AutoConnect/src/AutoConnect.cpp line 57
0x4020717b: setup() at /Users/user123/Documents/Arduino/libraries/AutoConnect/examples/Simple/Simple.ino line 55
0x40207054: rootPage() at /Users/user123/Documents/Arduino/libraries/AutoConnect/examples/Simple/Simple.ino line 22
0x40212124: std::_Function_base::_Base_manager ::_M_manager(std::_Any_data&, std::_Any_data const&, std::_Manager_operation) at /Users/user123/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/xtensa-lx106-elf/include/c++/4.8.2/functional line 1934
0x40212110: std::_Function_handler ::_M_invoke(std::_Any_data const&) at /Users/user123/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/xtensa-lx106-elf/include/c++/4.8.2/functional line 2069
0x40210e14: loop_wrapper() at /Users/user123/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/cores/esp8266/core_esp8266_main.cpp line 118
When I select the SSID, the cursor should be positioned in the text box of the key, because if we have more than 10 networks (for example), we would have to scroll to write the key but that would not be necessary if the function for example: document.getElementById ('password'). focus ();
Is it possible to
When the device (esp8266) has already connected to the Wi-Fi network, the AP mode should be turned off, since some intruder could connect to the AP and change the configuration of the device (Esp8266).
When the key has been changed in the modem the AP should start again in order to update the key and after the connection is established it should be switched off again
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.