|
|
|
|
@@ -289,6 +289,7 @@ ConfigParameter configParameters[] = {
|
|
|
|
|
{"int", "rotMicrostep", &g_iRotMicrostep, "Rotational Stepper Microsteps", kDefaultRotMicrostep, "", false},
|
|
|
|
|
{"int", "penMicrostep", &g_iPenMicrostep, "Pen Stepper Microsteps", kDefaultPenMicrostep, "", false},
|
|
|
|
|
{"int", "servoPin", &g_iServoPin, "Servo Pin", kDefaultServoPin, "", false},
|
|
|
|
|
{"text", "Name", &g_sHostname, "Name", 0, "EggDuino", false},
|
|
|
|
|
{"text", "wifiSsid", &g_sWifiSsid, "WLAN SSID", 0, "", false},
|
|
|
|
|
{"password", "wifiPassword", &g_sWifiPassword, "WLAN Passwort", 0, "", true},
|
|
|
|
|
};
|
|
|
|
|
@@ -500,10 +501,18 @@ void startWebInterface()
|
|
|
|
|
bool staConnected = false;
|
|
|
|
|
apModeActive = false;
|
|
|
|
|
dnsServer.stop();
|
|
|
|
|
String hostName = g_sHostname;
|
|
|
|
|
hostName.trim();
|
|
|
|
|
if (hostName.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
hostName = "EggDuino";
|
|
|
|
|
}
|
|
|
|
|
g_sHostname = hostName;
|
|
|
|
|
|
|
|
|
|
if (!g_sWifiSsid.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
WiFi.mode(WIFI_STA);
|
|
|
|
|
WiFi.setHostname(hostName.c_str());
|
|
|
|
|
WiFi.begin(g_sWifiSsid.c_str(), g_sWifiPassword.c_str());
|
|
|
|
|
|
|
|
|
|
const unsigned long connectStart = millis();
|
|
|
|
|
@@ -533,11 +542,14 @@ void startWebInterface()
|
|
|
|
|
if (!staConnected)
|
|
|
|
|
{
|
|
|
|
|
WiFi.mode(WIFI_AP);
|
|
|
|
|
#ifdef ESP32
|
|
|
|
|
WiFi.softAPsetHostname(hostName.c_str());
|
|
|
|
|
#endif
|
|
|
|
|
if (WiFi.softAP("EggDuino"))
|
|
|
|
|
{
|
|
|
|
|
apModeActive = true;
|
|
|
|
|
dnsServer.start(kDnsPort, "*", WiFi.softAPIP());
|
|
|
|
|
Serial.println(String("AP aktiv: EggDuino / http://") + WiFi.softAPIP().toString());
|
|
|
|
|
Serial.println(String("AP aktiv: EggDuino / http://") + WiFi.softAPIP().toString() + " (Name: " + hostName + ")");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|