mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-07 02:18:09 +00:00
Merge branch 'develop' into nice-threads
This commit is contained in:
@@ -140,7 +140,7 @@ void registerHandlers(HTTPServer *insecureServer, HTTPSServer *secureServer)
|
||||
void handleAPIv1FromRadio(HTTPRequest *req, HTTPResponse *res)
|
||||
{
|
||||
|
||||
DEBUG_MSG("webAPI handleAPIv1FromRadio\n");
|
||||
LOG_DEBUG("webAPI handleAPIv1FromRadio\n");
|
||||
|
||||
/*
|
||||
For documentation, see:
|
||||
@@ -185,12 +185,12 @@ void handleAPIv1FromRadio(HTTPRequest *req, HTTPResponse *res)
|
||||
res->write(txBuf, len);
|
||||
}
|
||||
|
||||
DEBUG_MSG("webAPI handleAPIv1FromRadio, len %d\n", len);
|
||||
LOG_DEBUG("webAPI handleAPIv1FromRadio, len %d\n", len);
|
||||
}
|
||||
|
||||
void handleAPIv1ToRadio(HTTPRequest *req, HTTPResponse *res)
|
||||
{
|
||||
DEBUG_MSG("webAPI handleAPIv1ToRadio\n");
|
||||
LOG_DEBUG("webAPI handleAPIv1ToRadio\n");
|
||||
|
||||
/*
|
||||
For documentation, see:
|
||||
@@ -213,11 +213,11 @@ void handleAPIv1ToRadio(HTTPRequest *req, HTTPResponse *res)
|
||||
byte buffer[MAX_TO_FROM_RADIO_SIZE];
|
||||
size_t s = req->readBytes(buffer, MAX_TO_FROM_RADIO_SIZE);
|
||||
|
||||
DEBUG_MSG("Received %d bytes from PUT request\n", s);
|
||||
LOG_DEBUG("Received %d bytes from PUT request\n", s);
|
||||
webAPI.handleToRadio(buffer, s);
|
||||
|
||||
res->write(buffer, s);
|
||||
DEBUG_MSG("webAPI handleAPIv1ToRadio\n");
|
||||
LOG_DEBUG("webAPI handleAPIv1ToRadio\n");
|
||||
}
|
||||
|
||||
void htmlDeleteDir(const char *dirname)
|
||||
@@ -238,7 +238,7 @@ void htmlDeleteDir(const char *dirname)
|
||||
} else {
|
||||
String fileName = String(file.name());
|
||||
file.close();
|
||||
DEBUG_MSG(" %s\n", fileName.c_str());
|
||||
LOG_DEBUG(" %s\n", fileName.c_str());
|
||||
FSCom.remove(fileName);
|
||||
}
|
||||
file = root.openNextFile();
|
||||
@@ -335,7 +335,7 @@ void handleFsDeleteStatic(HTTPRequest *req, HTTPResponse *res)
|
||||
if (params->getQueryParameter("delete", paramValDelete)) {
|
||||
std::string pathDelete = "/" + paramValDelete;
|
||||
if (FSCom.remove(pathDelete.c_str())) {
|
||||
Serial.println(pathDelete.c_str());
|
||||
LOG_INFO("%s\n", pathDelete.c_str());
|
||||
JSONObject jsonObjOuter;
|
||||
jsonObjOuter["status"] = new JSONValue("ok");
|
||||
JSONValue *value = new JSONValue(jsonObjOuter);
|
||||
@@ -343,7 +343,7 @@ void handleFsDeleteStatic(HTTPRequest *req, HTTPResponse *res)
|
||||
delete value;
|
||||
return;
|
||||
} else {
|
||||
Serial.println(pathDelete.c_str());
|
||||
LOG_INFO("%s\n", pathDelete.c_str());
|
||||
JSONObject jsonObjOuter;
|
||||
jsonObjOuter["status"] = new JSONValue("Error");
|
||||
JSONValue *value = new JSONValue(jsonObjOuter);
|
||||
@@ -379,13 +379,13 @@ void handleStatic(HTTPRequest *req, HTTPResponse *res)
|
||||
if (FSCom.exists(filename.c_str())) {
|
||||
file = FSCom.open(filename.c_str());
|
||||
if (!file.available()) {
|
||||
DEBUG_MSG("File not available - %s\n", filename.c_str());
|
||||
LOG_WARN("File not available - %s\n", filename.c_str());
|
||||
}
|
||||
} else if (FSCom.exists(filenameGzip.c_str())) {
|
||||
file = FSCom.open(filenameGzip.c_str());
|
||||
res->setHeader("Content-Encoding", "gzip");
|
||||
if (!file.available()) {
|
||||
DEBUG_MSG("File not available - %s\n", filenameGzip.c_str());
|
||||
LOG_WARN("File not available - %s\n", filenameGzip.c_str());
|
||||
}
|
||||
} else {
|
||||
has_set_content_type = true;
|
||||
@@ -393,7 +393,7 @@ void handleStatic(HTTPRequest *req, HTTPResponse *res)
|
||||
file = FSCom.open(filenameGzip.c_str());
|
||||
res->setHeader("Content-Type", "text/html");
|
||||
if (!file.available()) {
|
||||
DEBUG_MSG("File not available - %s\n", filenameGzip.c_str());
|
||||
LOG_WARN("File not available - %s\n", filenameGzip.c_str());
|
||||
res->println("Web server is running.<br><br>The content you are looking for can't be found. Please see: <a "
|
||||
"href=https://meshtastic.org/docs/getting-started/faq#wifi--web-browser>FAQ</a>.<br><br><a "
|
||||
"href=/admin>admin</a>");
|
||||
@@ -437,7 +437,7 @@ void handleStatic(HTTPRequest *req, HTTPResponse *res)
|
||||
return;
|
||||
|
||||
} else {
|
||||
DEBUG_MSG("ERROR: This should not have happened...\n");
|
||||
LOG_ERROR("This should not have happened...\n");
|
||||
res->println("ERROR: This should not have happened...");
|
||||
}
|
||||
}
|
||||
@@ -445,7 +445,7 @@ void handleStatic(HTTPRequest *req, HTTPResponse *res)
|
||||
void handleFormUpload(HTTPRequest *req, HTTPResponse *res)
|
||||
{
|
||||
|
||||
DEBUG_MSG("Form Upload - Disabling keep-alive\n");
|
||||
LOG_DEBUG("Form Upload - Disabling keep-alive\n");
|
||||
res->setHeader("Connection", "close");
|
||||
|
||||
// First, we need to check the encoding of the form that we have received.
|
||||
@@ -453,7 +453,7 @@ void handleFormUpload(HTTPRequest *req, HTTPResponse *res)
|
||||
// Then we select the body parser based on the encoding.
|
||||
// Actually we do this only for documentary purposes, we know the form is going
|
||||
// to be multipart/form-data.
|
||||
DEBUG_MSG("Form Upload - Creating body parser reference\n");
|
||||
LOG_DEBUG("Form Upload - Creating body parser reference\n");
|
||||
HTTPBodyParser *parser;
|
||||
std::string contentType = req->getHeader("Content-Type");
|
||||
|
||||
@@ -469,10 +469,10 @@ void handleFormUpload(HTTPRequest *req, HTTPResponse *res)
|
||||
|
||||
// Now, we can decide based on the content type:
|
||||
if (contentType == "multipart/form-data") {
|
||||
DEBUG_MSG("Form Upload - multipart/form-data\n");
|
||||
LOG_DEBUG("Form Upload - multipart/form-data\n");
|
||||
parser = new HTTPMultipartBodyParser(req);
|
||||
} else {
|
||||
Serial.printf("Unknown POST Content-Type: %s\n", contentType.c_str());
|
||||
LOG_DEBUG("Unknown POST Content-Type: %s\n", contentType.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -499,19 +499,19 @@ void handleFormUpload(HTTPRequest *req, HTTPResponse *res)
|
||||
std::string filename = parser->getFieldFilename();
|
||||
std::string mimeType = parser->getFieldMimeType();
|
||||
// We log all three values, so that you can observe the upload on the serial monitor:
|
||||
DEBUG_MSG("handleFormUpload: field name='%s', filename='%s', mimetype='%s'\n", name.c_str(), filename.c_str(),
|
||||
LOG_DEBUG("handleFormUpload: field name='%s', filename='%s', mimetype='%s'\n", name.c_str(), filename.c_str(),
|
||||
mimeType.c_str());
|
||||
|
||||
// Double check that it is what we expect
|
||||
if (name != "file") {
|
||||
DEBUG_MSG("Skipping unexpected field\n");
|
||||
LOG_DEBUG("Skipping unexpected field\n");
|
||||
res->println("<p>No file found.</p>");
|
||||
return;
|
||||
}
|
||||
|
||||
// Double check that it is what we expect
|
||||
if (filename == "") {
|
||||
DEBUG_MSG("Skipping unexpected field\n");
|
||||
LOG_DEBUG("Skipping unexpected field\n");
|
||||
res->println("<p>No file found.</p>");
|
||||
return;
|
||||
}
|
||||
@@ -532,7 +532,7 @@ void handleFormUpload(HTTPRequest *req, HTTPResponse *res)
|
||||
|
||||
byte buf[512];
|
||||
size_t readLength = parser->read(buf, 512);
|
||||
// DEBUG_MSG("\n\nreadLength - %i\n", readLength);
|
||||
// LOG_DEBUG("\n\nreadLength - %i\n", readLength);
|
||||
|
||||
// Abort the transfer if there is less than 50k space left on the filesystem.
|
||||
if (FSCom.totalBytes() - FSCom.usedBytes() < 51200) {
|
||||
@@ -548,7 +548,7 @@ void handleFormUpload(HTTPRequest *req, HTTPResponse *res)
|
||||
// if (readLength) {
|
||||
file.write(buf, readLength);
|
||||
fileLength += readLength;
|
||||
DEBUG_MSG("File Length %i\n", fileLength);
|
||||
LOG_DEBUG("File Length %i\n", fileLength);
|
||||
//}
|
||||
}
|
||||
// enableLoopWDT();
|
||||
@@ -671,7 +671,7 @@ void handleReport(HTTPRequest *req, HTTPResponse *res)
|
||||
*/
|
||||
void handleHotspot(HTTPRequest *req, HTTPResponse *res)
|
||||
{
|
||||
DEBUG_MSG("Hotspot Request\n");
|
||||
LOG_INFO("Hotspot Request\n");
|
||||
|
||||
/*
|
||||
If we don't do a redirect, be sure to return a "Success" message
|
||||
@@ -697,7 +697,7 @@ void handleDeleteFsContent(HTTPRequest *req, HTTPResponse *res)
|
||||
res->println("<h1>Meshtastic</h1>\n");
|
||||
res->println("Deleting Content in /static/*");
|
||||
|
||||
DEBUG_MSG("Deleting files from /static/* : \n");
|
||||
LOG_INFO("Deleting files from /static/* : \n");
|
||||
|
||||
htmlDeleteDir("/static");
|
||||
|
||||
@@ -771,7 +771,7 @@ void handleRestart(HTTPRequest *req, HTTPResponse *res)
|
||||
res->println("<h1>Meshtastic</h1>\n");
|
||||
res->println("Restarting");
|
||||
|
||||
DEBUG_MSG("***** Restarted on HTTP(s) Request *****\n");
|
||||
LOG_DEBUG("***** Restarted on HTTP(s) Request *****\n");
|
||||
webServerThread->requestRestart = (millis() / 1000) + 5;
|
||||
}
|
||||
|
||||
|
||||
@@ -68,19 +68,19 @@ static void taskCreateCert(void *parameter)
|
||||
|
||||
#if 0
|
||||
// Delete the saved certs (used in debugging)
|
||||
DEBUG_MSG("Deleting any saved SSL keys ...\n");
|
||||
LOG_DEBUG("Deleting any saved SSL keys ...\n");
|
||||
// prefs.clear();
|
||||
prefs.remove("PK");
|
||||
prefs.remove("cert");
|
||||
#endif
|
||||
|
||||
DEBUG_MSG("Checking if we have a previously saved SSL Certificate.\n");
|
||||
LOG_INFO("Checking if we have a previously saved SSL Certificate.\n");
|
||||
|
||||
size_t pkLen = prefs.getBytesLength("PK");
|
||||
size_t certLen = prefs.getBytesLength("cert");
|
||||
|
||||
if (pkLen && certLen) {
|
||||
DEBUG_MSG("Existing SSL Certificate found!\n");
|
||||
LOG_INFO("Existing SSL Certificate found!\n");
|
||||
|
||||
uint8_t *pkBuffer = new uint8_t[pkLen];
|
||||
prefs.getBytes("PK", pkBuffer, pkLen);
|
||||
@@ -90,12 +90,12 @@ static void taskCreateCert(void *parameter)
|
||||
|
||||
cert = new SSLCert(certBuffer, certLen, pkBuffer, pkLen);
|
||||
|
||||
DEBUG_MSG("Retrieved Private Key: %d Bytes\n", cert->getPKLength());
|
||||
DEBUG_MSG("Retrieved Certificate: %d Bytes\n", cert->getCertLength());
|
||||
LOG_DEBUG("Retrieved Private Key: %d Bytes\n", cert->getPKLength());
|
||||
LOG_DEBUG("Retrieved Certificate: %d Bytes\n", cert->getCertLength());
|
||||
|
||||
} else {
|
||||
|
||||
DEBUG_MSG("Creating the certificate. This may take a while. Please wait...\n");
|
||||
LOG_INFO("Creating the certificate. This may take a while. Please wait...\n");
|
||||
yield();
|
||||
cert = new SSLCert();
|
||||
yield();
|
||||
@@ -104,14 +104,14 @@ static void taskCreateCert(void *parameter)
|
||||
yield();
|
||||
|
||||
if (createCertResult != 0) {
|
||||
DEBUG_MSG("Creating the certificate failed\n");
|
||||
LOG_ERROR("Creating the certificate failed\n");
|
||||
|
||||
} else {
|
||||
DEBUG_MSG("Creating the certificate was successful\n");
|
||||
LOG_INFO("Creating the certificate was successful\n");
|
||||
|
||||
DEBUG_MSG("Created Private Key: %d Bytes\n", cert->getPKLength());
|
||||
LOG_DEBUG("Created Private Key: %d Bytes\n", cert->getPKLength());
|
||||
|
||||
DEBUG_MSG("Created Certificate: %d Bytes\n", cert->getCertLength());
|
||||
LOG_DEBUG("Created Certificate: %d Bytes\n", cert->getCertLength());
|
||||
|
||||
prefs.putBytes("PK", (uint8_t *)cert->getPKData(), cert->getPKLength());
|
||||
prefs.putBytes("cert", (uint8_t *)cert->getCertData(), cert->getCertLength());
|
||||
@@ -140,11 +140,11 @@ void createSSLCert()
|
||||
16, /* Priority of the task. */
|
||||
NULL); /* Task handle. */
|
||||
|
||||
DEBUG_MSG("Waiting for SSL Cert to be generated.\n");
|
||||
LOG_DEBUG("Waiting for SSL Cert to be generated.\n");
|
||||
while (!isCertReady) {
|
||||
if ((millis() / 500) % 2) {
|
||||
if (runLoop) {
|
||||
DEBUG_MSG(".");
|
||||
LOG_DEBUG(".");
|
||||
|
||||
yield();
|
||||
esp_task_wdt_reset();
|
||||
@@ -159,7 +159,7 @@ void createSSLCert()
|
||||
runLoop = true;
|
||||
}
|
||||
}
|
||||
DEBUG_MSG("SSL Cert Ready!\n");
|
||||
LOG_INFO("SSL Cert Ready!\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ int32_t WebServerThread::runOnce()
|
||||
|
||||
void initWebServer()
|
||||
{
|
||||
DEBUG_MSG("Initializing Web Server ...\n");
|
||||
LOG_DEBUG("Initializing Web Server ...\n");
|
||||
|
||||
// We can now use the new certificate to setup our server as usual.
|
||||
secureServer = new HTTPSServer(cert);
|
||||
@@ -198,15 +198,15 @@ void initWebServer()
|
||||
registerHandlers(insecureServer, secureServer);
|
||||
|
||||
if (secureServer) {
|
||||
DEBUG_MSG("Starting Secure Web Server...\n");
|
||||
LOG_INFO("Starting Secure Web Server...\n");
|
||||
secureServer->start();
|
||||
}
|
||||
DEBUG_MSG("Starting Insecure Web Server...\n");
|
||||
LOG_INFO("Starting Insecure Web Server...\n");
|
||||
insecureServer->start();
|
||||
if (insecureServer->isRunning()) {
|
||||
DEBUG_MSG("Web Servers Ready! :-) \n");
|
||||
LOG_INFO("Web Servers Ready! :-) \n");
|
||||
isWebServerReady = true;
|
||||
} else {
|
||||
DEBUG_MSG("Web Servers Failed! ;-( \n");
|
||||
LOG_ERROR("Web Servers Failed! ;-( \n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ static int32_t reconnectWiFi()
|
||||
// Make sure we clear old connection credentials
|
||||
WiFi.disconnect(false, true);
|
||||
|
||||
DEBUG_MSG("Reconnecting to WiFi access point %s\n",wifiName);
|
||||
LOG_INFO("Reconnecting to WiFi access point %s\n",wifiName);
|
||||
|
||||
WiFi.mode(WIFI_MODE_STA);
|
||||
WiFi.begin(wifiName, wifiPsw);
|
||||
@@ -64,9 +64,9 @@ static int32_t reconnectWiFi()
|
||||
|
||||
#ifndef DISABLE_NTP
|
||||
if (WiFi.isConnected() && (((millis() - lastrun_ntp) > 43200000) || (lastrun_ntp == 0))) { // every 12 hours
|
||||
DEBUG_MSG("Updating NTP time from %s\n",config.network.ntp_server);
|
||||
LOG_DEBUG("Updating NTP time from %s\n",config.network.ntp_server);
|
||||
if (timeClient.update()) {
|
||||
DEBUG_MSG("NTP Request Success - Setting RTCQualityNTP if needed\n");
|
||||
LOG_DEBUG("NTP Request Success - Setting RTCQualityNTP if needed\n");
|
||||
|
||||
struct timeval tv;
|
||||
tv.tv_sec = timeClient.getEpochTime();
|
||||
@@ -76,7 +76,7 @@ static int32_t reconnectWiFi()
|
||||
lastrun_ntp = millis();
|
||||
|
||||
} else {
|
||||
DEBUG_MSG("NTP Update failed\n");
|
||||
LOG_DEBUG("NTP Update failed\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -101,12 +101,12 @@ bool isWifiAvailable()
|
||||
// Disable WiFi
|
||||
void deinitWifi()
|
||||
{
|
||||
DEBUG_MSG("WiFi deinit\n");
|
||||
LOG_INFO("WiFi deinit\n");
|
||||
|
||||
if (isWifiAvailable()) {
|
||||
WiFi.disconnect(true);
|
||||
WiFi.mode(WIFI_MODE_NULL);
|
||||
DEBUG_MSG("WiFi Turned Off\n");
|
||||
LOG_INFO("WiFi Turned Off\n");
|
||||
// WiFi.printDiag(Serial);
|
||||
}
|
||||
}
|
||||
@@ -115,20 +115,20 @@ static void onNetworkConnected()
|
||||
{
|
||||
if (!APStartupComplete) {
|
||||
// Start web server
|
||||
DEBUG_MSG("Starting network services\n");
|
||||
LOG_INFO("Starting network services\n");
|
||||
|
||||
// start mdns
|
||||
if (!MDNS.begin("Meshtastic")) {
|
||||
DEBUG_MSG("Error setting up MDNS responder!\n");
|
||||
LOG_ERROR("Error setting up MDNS responder!\n");
|
||||
} else {
|
||||
DEBUG_MSG("mDNS responder started\n");
|
||||
DEBUG_MSG("mDNS Host: Meshtastic.local\n");
|
||||
LOG_INFO("mDNS responder started\n");
|
||||
LOG_INFO("mDNS Host: Meshtastic.local\n");
|
||||
MDNS.addService("http", "tcp", 80);
|
||||
MDNS.addService("https", "tcp", 443);
|
||||
}
|
||||
|
||||
#ifndef DISABLE_NTP
|
||||
DEBUG_MSG("Starting NTP time client\n");
|
||||
LOG_INFO("Starting NTP time client\n");
|
||||
timeClient.begin();
|
||||
timeClient.setUpdateInterval(60 * 60); // Update once an hour
|
||||
#endif
|
||||
@@ -182,8 +182,7 @@ bool initWifi()
|
||||
|
||||
WiFi.onEvent(
|
||||
[](WiFiEvent_t event, WiFiEventInfo_t info) {
|
||||
Serial.print("WiFi lost connection. Reason: ");
|
||||
Serial.println(info.wifi_sta_disconnected.reason);
|
||||
LOG_WARN("WiFi lost connection. Reason: %s", info.wifi_sta_disconnected.reason);
|
||||
|
||||
/*
|
||||
If we are disconnected from the AP for some reason,
|
||||
@@ -196,12 +195,12 @@ bool initWifi()
|
||||
},
|
||||
WiFiEvent_t::ARDUINO_EVENT_WIFI_STA_DISCONNECTED);
|
||||
|
||||
DEBUG_MSG("JOINING WIFI soon: ssid=%s\n", wifiName);
|
||||
LOG_DEBUG("JOINING WIFI soon: ssid=%s\n", wifiName);
|
||||
wifiReconnect = new Periodic("WifiConnect", reconnectWiFi);
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
DEBUG_MSG("Not using WIFI\n");
|
||||
LOG_INFO("Not using WIFI\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -209,137 +208,135 @@ bool initWifi()
|
||||
// Called by the Espressif SDK to
|
||||
static void WiFiEvent(WiFiEvent_t event)
|
||||
{
|
||||
DEBUG_MSG("WiFi-Event %d: ", event);
|
||||
LOG_DEBUG("WiFi-Event %d: ", event);
|
||||
|
||||
switch (event) {
|
||||
case ARDUINO_EVENT_WIFI_READY:
|
||||
DEBUG_MSG("WiFi interface ready\n");
|
||||
LOG_INFO("WiFi interface ready\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_WIFI_SCAN_DONE:
|
||||
DEBUG_MSG("Completed scan for access points\n");
|
||||
LOG_INFO("Completed scan for access points\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_WIFI_STA_START:
|
||||
DEBUG_MSG("WiFi station started\n");
|
||||
LOG_INFO("WiFi station started\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_WIFI_STA_STOP:
|
||||
DEBUG_MSG("WiFi station stopped\n");
|
||||
LOG_INFO("WiFi station stopped\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_WIFI_STA_CONNECTED:
|
||||
DEBUG_MSG("Connected to access point\n");
|
||||
LOG_INFO("Connected to access point\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_WIFI_STA_DISCONNECTED:
|
||||
DEBUG_MSG("Disconnected from WiFi access point\n");
|
||||
LOG_INFO("Disconnected from WiFi access point\n");
|
||||
WiFi.disconnect(false, true);
|
||||
needReconnect = true;
|
||||
wifiReconnect->setIntervalFromNow(1000);
|
||||
break;
|
||||
case ARDUINO_EVENT_WIFI_STA_AUTHMODE_CHANGE:
|
||||
DEBUG_MSG("Authentication mode of access point has changed\n");
|
||||
LOG_INFO("Authentication mode of access point has changed\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_WIFI_STA_GOT_IP:
|
||||
DEBUG_MSG("Obtained IP address: ");
|
||||
Serial.println(WiFi.localIP());
|
||||
LOG_INFO("Obtained IP address: ", WiFi.localIPv6());
|
||||
onNetworkConnected();
|
||||
break;
|
||||
case ARDUINO_EVENT_WIFI_STA_GOT_IP6:
|
||||
DEBUG_MSG("Obtained IP6 address: ");
|
||||
Serial.println(WiFi.localIPv6());
|
||||
LOG_INFO("Obtained IP6 address: %s", WiFi.localIPv6());
|
||||
break;
|
||||
case ARDUINO_EVENT_WIFI_STA_LOST_IP:
|
||||
DEBUG_MSG("Lost IP address and IP address is reset to 0\n");
|
||||
LOG_INFO("Lost IP address and IP address is reset to 0\n");
|
||||
WiFi.disconnect(false, true);
|
||||
needReconnect = true;
|
||||
wifiReconnect->setIntervalFromNow(1000);
|
||||
break;
|
||||
case ARDUINO_EVENT_WPS_ER_SUCCESS:
|
||||
DEBUG_MSG("WiFi Protected Setup (WPS): succeeded in enrollee mode\n");
|
||||
LOG_INFO("WiFi Protected Setup (WPS): succeeded in enrollee mode\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_WPS_ER_FAILED:
|
||||
DEBUG_MSG("WiFi Protected Setup (WPS): failed in enrollee mode\n");
|
||||
LOG_INFO("WiFi Protected Setup (WPS): failed in enrollee mode\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_WPS_ER_TIMEOUT:
|
||||
DEBUG_MSG("WiFi Protected Setup (WPS): timeout in enrollee mode\n");
|
||||
LOG_INFO("WiFi Protected Setup (WPS): timeout in enrollee mode\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_WPS_ER_PIN:
|
||||
DEBUG_MSG("WiFi Protected Setup (WPS): pin code in enrollee mode\n");
|
||||
LOG_INFO("WiFi Protected Setup (WPS): pin code in enrollee mode\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_WPS_ER_PBC_OVERLAP:
|
||||
DEBUG_MSG("WiFi Protected Setup (WPS): push button overlap in enrollee mode\n");
|
||||
LOG_INFO("WiFi Protected Setup (WPS): push button overlap in enrollee mode\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_WIFI_AP_START:
|
||||
DEBUG_MSG("WiFi access point started\n");
|
||||
LOG_INFO("WiFi access point started\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_WIFI_AP_STOP:
|
||||
DEBUG_MSG("WiFi access point stopped\n");
|
||||
LOG_INFO("WiFi access point stopped\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_WIFI_AP_STACONNECTED:
|
||||
DEBUG_MSG("Client connected\n");
|
||||
LOG_INFO("Client connected\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_WIFI_AP_STADISCONNECTED:
|
||||
DEBUG_MSG("Client disconnected\n");
|
||||
LOG_INFO("Client disconnected\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_WIFI_AP_STAIPASSIGNED:
|
||||
DEBUG_MSG("Assigned IP address to client\n");
|
||||
LOG_INFO("Assigned IP address to client\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_WIFI_AP_PROBEREQRECVED:
|
||||
DEBUG_MSG("Received probe request\n");
|
||||
LOG_INFO("Received probe request\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_WIFI_AP_GOT_IP6:
|
||||
DEBUG_MSG("IPv6 is preferred\n");
|
||||
LOG_INFO("IPv6 is preferred\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_WIFI_FTM_REPORT:
|
||||
DEBUG_MSG("Fast Transition Management report\n");
|
||||
LOG_INFO("Fast Transition Management report\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_ETH_START:
|
||||
DEBUG_MSG("Ethernet started\n");
|
||||
LOG_INFO("Ethernet started\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_ETH_STOP:
|
||||
DEBUG_MSG("Ethernet stopped\n");
|
||||
LOG_INFO("Ethernet stopped\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_ETH_CONNECTED:
|
||||
DEBUG_MSG("Ethernet connected\n");
|
||||
LOG_INFO("Ethernet connected\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_ETH_DISCONNECTED:
|
||||
DEBUG_MSG("Ethernet disconnected\n");
|
||||
LOG_INFO("Ethernet disconnected\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_ETH_GOT_IP:
|
||||
DEBUG_MSG("Obtained IP address (ARDUINO_EVENT_ETH_GOT_IP)\n");
|
||||
LOG_INFO("Obtained IP address (ARDUINO_EVENT_ETH_GOT_IP)\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_ETH_GOT_IP6:
|
||||
DEBUG_MSG("Obtained IP6 address (ARDUINO_EVENT_ETH_GOT_IP6)\n");
|
||||
LOG_INFO("Obtained IP6 address (ARDUINO_EVENT_ETH_GOT_IP6)\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_SC_SCAN_DONE:
|
||||
DEBUG_MSG("SmartConfig: Scan done\n");
|
||||
LOG_INFO("SmartConfig: Scan done\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_SC_FOUND_CHANNEL:
|
||||
DEBUG_MSG("SmartConfig: Found channel\n");
|
||||
LOG_INFO("SmartConfig: Found channel\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_SC_GOT_SSID_PSWD:
|
||||
DEBUG_MSG("SmartConfig: Got SSID and password\n");
|
||||
LOG_INFO("SmartConfig: Got SSID and password\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_SC_SEND_ACK_DONE:
|
||||
DEBUG_MSG("SmartConfig: Send ACK done\n");
|
||||
LOG_INFO("SmartConfig: Send ACK done\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_PROV_INIT:
|
||||
DEBUG_MSG("Provisioning: Init\n");
|
||||
LOG_INFO("Provisioning: Init\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_PROV_DEINIT:
|
||||
DEBUG_MSG("Provisioning: Stopped\n");
|
||||
LOG_INFO("Provisioning: Stopped\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_PROV_START:
|
||||
DEBUG_MSG("Provisioning: Started\n");
|
||||
LOG_INFO("Provisioning: Started\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_PROV_END:
|
||||
DEBUG_MSG("Provisioning: End\n");
|
||||
LOG_INFO("Provisioning: End\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_PROV_CRED_RECV:
|
||||
DEBUG_MSG("Provisioning: Credentials received\n");
|
||||
LOG_INFO("Provisioning: Credentials received\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_PROV_CRED_FAIL:
|
||||
DEBUG_MSG("Provisioning: Credentials failed\n");
|
||||
LOG_INFO("Provisioning: Credentials failed\n");
|
||||
break;
|
||||
case ARDUINO_EVENT_PROV_CRED_SUCCESS:
|
||||
DEBUG_MSG("Provisioning: Credentials success\n");
|
||||
LOG_INFO("Provisioning: Credentials success\n");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user