Generate ip.gcode after wifi connected

This commit is contained in:
George Fu
2020-09-08 15:08:44 +08:00
parent 1ac7da5260
commit e042b8f6c3
3 changed files with 51 additions and 1 deletions

View File

@@ -6,6 +6,14 @@
#include "ESPWebDAV.h"
#include "sdControl.h"
String IpAddress2String(const IPAddress& ipAddress)
{
return String(ipAddress[0]) + String(".") +\
String(ipAddress[1]) + String(".") +\
String(ipAddress[2]) + String(".") +\
String(ipAddress[3]) ;
}
bool Network::start() {
wifiConnected = false;
@@ -41,6 +49,8 @@ bool Network::start() {
wifiConnected = true;
config.save();
String sIp = IpAddress2String(WiFi.localIP());
config.save_ip(sIp.c_str());
SERIAL_ECHOLN("Going to start DAV server");
if(startDAVServer() < 0) return false;