Browse Source

Force device in AP mode to use 192.168.4.1 always

fastled
Xose Pérez 7 years ago
parent
commit
0f125d6ed8
2 changed files with 7 additions and 2 deletions
  1. +5
    -0
      code/espurna/config/general.h
  2. +2
    -2
      code/espurna/wifi.ino

+ 5
- 0
code/espurna/config/general.h View File

@ -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
// -----------------------------------------------------------------------------


+ 2
- 2
code/espurna/wifi.ino View File

@ -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;


Loading…
Cancel
Save