This commit is contained in:
jomjol
2021-02-03 21:26:00 +01:00
parent 87202115d0
commit 9dbad050fd
14 changed files with 660 additions and 207 deletions

View File

@@ -80,40 +80,13 @@ extern "C" void app_main(void)
Camera.LightOnOff(false);
Init_NVS_SDCard();
// LogFile.WriteToFile("Startsequence 02");
CheckOTAUpdate();
// LogFile.WriteToFile("Startsequence 03");
std::string ssid = "";
std::string password = "";
std::string hostname = "";
std::string ip = "";
std::string gw = "";
std::string netmask = "";
std::string dns = "";
// LoadWlanFromFile("/sdcard/wlan.ini", ssid, password, hostname, ip, gw, netmask, dns);
LoadWlanFromFile("/sdcard/wlan.ini", ssid, password, hostname);
LoadNetConfigFromFile("/sdcard/wlan.ini", ip, gw, netmask, dns);
// LogFile.WriteToFile("Startsequence 04");
printf("To use WLan: %s, %s\n", ssid.c_str(), password.c_str());
printf("To set Hostename: %s\n", hostname.c_str());
printf("Fixed IP: %s, Gateway %s, Netmask %s, DNS %s\n", ip.c_str(), gw.c_str(), netmask.c_str(), dns.c_str());
if (ip.length() == 0 || gw.length() == 0 || netmask.length() == 0)
{
initialise_wifi(ssid, password, hostname);
}
else
{
initialise_wifi_fixed_ip(ip, gw, netmask, ssid, password, hostname, dns);
}
printf("Netparameter: IP: %s - GW: %s - NetMask %s\n", getIPAddress().c_str(), getGW().c_str(), getNetMask().c_str());
LoadWlanFromFile("/sdcard/wlan.ini");
ConnectToWLAN();
printf("\nNetparameter: IP: %s - GW: %s - NetMask %s\n", getIPAddress().c_str(), getGW().c_str(), getNetMask().c_str());
// LogFile.WriteToFile("Startsequence 05");
TickType_t xDelay;
xDelay = 2000 / portTICK_PERIOD_MS;
printf("Autoflow: sleep for : %ldms\n", (long) xDelay);