Comments (4)
- Uniqueization of APID is possible even of the current release
AutoConnectConfig config;
config.apid = String(AUTOCONNECT_APID)+"_"+String(ESP.getChipId(),HEX));
portal.config(config);
portal.begin();
- hostname
I accept your proposal. I prepare like as:
AutoConnectConfig config;
config.apid = String(AUTOCONNECT_APID)+"_"+String(ESP.getChipId(),HEX)); // If you want
config.hostname = "name_of_host";
portal.config(config);
portal.begin();
so, WiFi.hostname() behaves with the hostname contained in the AutoConnectConfig before first WiFi.begin().
from autoconnect.
Great to here about accepting the hostname config.
when trying out the code from the first point, i become a wdt error.
Can't figure out what causes it.
here is a part of the serial log.
[AC] WiFi.begin()
[AC] Connecting.[AC] established IP:192.168.1.207
ets Jan 8 2013,rst cause:4, boot mode:(3,6)
wdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
vbb28d4a3
~ld
[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] DHCP client(STARTED)
[AC] WiFi.begin()
[AC] Connecting.[AC] established IP:192.168.1.207```
and this is the code
/*
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 <AutoConnect.h>
#include <ArduinoOTA.h>
#include <ESP8266HTTPUpdateServer.h>
#include <ESP8266mDNS.h>
ESP8266WebServer Server;
AutoConnect Portal(Server);
ESP8266HTTPUpdateServer UpdateServer;
AutoConnectConfig config;
void rootPage() {
String content =
""
""
"<meta name="viewport" content="width=device-width, initial-scale=1">"
""
""
"<h2 align="center" style="color:blue;margin:20px;">Hello, world"
"<p style="padding-top:10px;text-align:center">" AUTOCONNECT_LINK(COG_32) "
""
"";
Server.send(200, "text/html", content);
}
void StartOTAServer (){
//Starting Update Server
ArduinoOTA.onStart( {
String type;
if (ArduinoOTA.getCommand() == U_FLASH) {
type = "sketch";
} else { // U_SPIFFS
type = "filesystem";
}
// NOTE: if updating SPIFFS this would be the place to unmount SPIFFS using SPIFFS.end()
Serial.println("Start updating " + type);
});
ArduinoOTA.onEnd([]() {
Serial.println("\nEnd");
});
ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
Serial.printf("Progress: %u%%\r", (progress / (total / 100)));
});
ArduinoOTA.onError([](ota_error_t error) {
Serial.printf("Error[%u]: ", error);
if (error == OTA_AUTH_ERROR) {
Serial.println("Auth Failed");
} else if (error == OTA_BEGIN_ERROR) {
Serial.println("Begin Failed");
} else if (error == OTA_CONNECT_ERROR) {
Serial.println("Connect Failed");
} else if (error == OTA_RECEIVE_ERROR) {
Serial.println("Receive Failed");
} else if (error == OTA_END_ERROR) {
Serial.println("End Failed");
}
});
ArduinoOTA.begin();
Serial.println("OTA server started.");
}
void setup() {
delay(1000);
Serial.begin(115200);
Serial.println();
// config.apid = String(AUTOCONNECT_APID)+"______"+String(ESP.getChipId(),HEX);
UpdateServer.setup(&Server);
config.apid = String(AUTOCONNECT_APID)+"_"+String(ESP.getChipId(),HEX);
Portal.config(config);
Server.on("/", rootPage);
if (Portal.begin()) {
Serial.println("WiFi connected: " + WiFi.localIP().toString());
StartOTAServer();
//Added by AJG, the device will be acsabible from [name].local
// char __dataFileName[sizeof(Portal.AP_hostname)];
// Portal.AP_hostname.toCharArray(__dataFileName, sizeof(__dataFileName));
// MDNS.begin(__dataFileName );
}
}
void loop() {
Portal.handleClient();
ArduinoOTA.handle();
}
from autoconnect.
a little update, when ussing AutoConnect-enhance-AutoConnectAux lib. the sketch is working fine.
Are there more new things in this lib that i can try.
i saw that you aded hostname :)
from autoconnect.
Are there more new things in this lib that i can try.
It is the development branch, I updated the branch with a version you can evaluate the development situation. However, some rework is necessary and the documentation is not yet.
You can try the custom parameters handling by the mqttRSSI example.
This version is ArduinoJson required. If you don't have it, please install the ArduinoJson library v5.
from autoconnect.
Related Issues (20)
- ESP32 problem HOT 8
- Mqtt Example HOT 2
- Using "AutoConnectCore.h" header and running into errors HOT 2
- AutoConnect to offer captive portal for 5min even if ESP32 is WiFi-Connected HOT 1
- AutoConnect on WiFi connection error shows too many redirects. HOT 2
- AutoConnectCore Not Working HOT 1
- Failing to store network HOT 2
- AutoConnect not longer runningh on ESP8266 HOT 2
- Use Autoconnect library with ESP now HOT 1
- Issue after updating libraries in my PIO project: enableCors() HOT 2
- Strange Issue
- WiFiClientSecure is not working with AutoConnect HOT 1
- how to use esp8266 with WiFiClientSecure
- AutoConnectPageImpl.hpp:1001:20: error: there are no arguments to 'spi_flash_get_chip_size' that depend on a template parameter, so a declaration of 'spi_flash_get_chip_size' must be available [-fpermissive] HOT 1
- Save data from Custom Page to flash HOT 2
- esp32: frozen loop() and kicked out of the WiFi connection at Configure new AP
- WPA2 Enterprise support
- Captive portal cause watchdog triggering
- Possibility to change pass for SoftAP from webui.
- Fresh Install and even the simplest of code will not compile 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 autoconnect.