From 0f125d6ed802868b38887170781449ee9e87fc77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Fri, 10 Feb 2017 14:27:08 +0100 Subject: [PATCH] Force device in AP mode to use 192.168.4.1 always --- code/espurna/config/general.h | 5 +++++ code/espurna/wifi.ino | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/code/espurna/config/general.h b/code/espurna/config/general.h index 1c1c29f9..65d02b48 100644 --- a/code/espurna/config/general.h +++ b/code/espurna/config/general.h @@ -83,6 +83,11 @@ #define WS_TIMEOUT 1800000 #define DNS_PORT 53 +#define AP_MODE AP_MODE_ALONE +#define AP_MODE_IP "192.168.4.1" +#define AP_MODE_GW "192.168.4.1" +#define AP_MODE_MASK "255.255.255.0" + // ----------------------------------------------------------------------------- // OTA & NOFUSS // ----------------------------------------------------------------------------- diff --git a/code/espurna/wifi.ino b/code/espurna/wifi.ino index 8826c256..26d8e474 100644 --- a/code/espurna/wifi.ino +++ b/code/espurna/wifi.ino @@ -51,8 +51,8 @@ bool createAP() { void wifiConfigure() { jw.scanNetworks(true); jw.setHostname(getSetting("hostname", HOSTNAME).c_str()); - jw.setSoftAP(getSetting("hostname", HOSTNAME).c_str(), getSetting("adminPass", ADMIN_PASS).c_str()); - jw.setAPMode(AP_MODE_ALONE); + jw.setSoftAP(getSetting("hostname", HOSTNAME).c_str(), getSetting("adminPass", ADMIN_PASS).c_str(), AP_MODE_IP, AP_MODE_GW, AP_MODE_MASK); + jw.setAPMode(AP_MODE); jw.cleanNetworks(); for (int i = 0; i< WIFI_MAX_NETWORKS; i++) { if (getSetting("ssid" + String(i)).length() == 0) break;