No IP set after WebConfig

50 views
Skip to first unread message

Juan Pablo Kutianski

unread,
Aug 26, 2016, 10:44:20 PM8/26/16
to souliss
Using

#define WIFICONF_INSKETCH
#define WiFi_SSID               "SSID"
#define WiFi_Password           "pass"

works fine but when I disable WIFICONF_INSKETCH and set the network via WebConfig the DHCP client doesn't work.

Mode: AP
PHY mode: N
Channel: 1
AP id: 0
Status: 255
Auto connect: 1
SSID (6): SSID
Passphrase (10): pass
BSSID set: 0
Setting as Gateway
(ss)<rPddr> <|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x0|0x>
Received IP address: 
0.0.0.0

This is my partial sketch

// Include framework code and libraries
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <EEPROM.h>
#include <SPI.h>
#include <WiFiUdp.h>


// Configure the framework
#include "bconf/MCU_ESP8266.h"              // Load the code directly on the ESP8266
#include "conf/RuntimeGateway.h"            // This node is a Peer and can became a Gateway at runtime
#include "conf/DynamicAddressing.h"         // Use dynamically assigned addresses
#include "conf/IPBroadcast.h"               // Use IP Broadcast for Ethernet/WiFi nodes without a static address
#include "conf/WEBCONFinterface.h"          // Web Config

void setup()
{
    Serial.begin(115200);

    Initialize();

    pinMode(0, INPUT); 

    WiFi.printDiag(Serial);

    if(subscribe(Notify_GatewayAlive)) {
        Serial.println("Setting as Peer");
        // This board request an address to the gateway at runtime, no need
        // to configure any parameter here.
        SetDynamicAddressing();  
        GetAddress();
    } else {
        Serial.println("Setting as Gateway");
        // Connect to the WiFi network and get an address from DHCP
        Souliss_GetIPAddress();                     
        SetAsGateway(myvNet_dhcp);       // Set this node as gateway for SoulissApp  
        SetAddressingServer();
    }

    Serial.println("Received IP address: ");
    Serial.println(WiFi.localIP());
}

void loop()
{
    if(!digitalRead(0)) {
      Serial.println("Initializing configuration space");
       // Initialize config store
       Store_Init();
       Store_Clear();
       Store_Commit();
       
       Serial.println("Start WebConfig");
       // Start the node as access point with a configuration WebServer
       SetAccessPoint();
       startWebServer();
    
       // We have nothing more than the WebServer for the configuration
       // to run, once configured the node will quit this.
       while(1)
       {
          yield();
          runWebServer(); 
       }
    }

    // Here we start to play
    EXECUTEFAST() {                     
        UPDATEFAST();

        FAST_50ms() {   // We process the logic and relevant input and output every 50 millisecond
            ProcessCommunication();
        }

        if (IsRuntimeGateway()){
            FAST_21110ms() {
              publish(Notify_GatewayAlive);
            }
        
            FAST_GatewayComms();
        } else {
            FAST_PeerComms(); 
        }
    }
    EXECUTESLOW() { 
        UPDATESLOW();
                    
        if (!IsRuntimeGateway())
            SLOW_PeerJoin();
    }

I'm using Arduino 1.6.5 with ESP 2.3.0 & Souliss 7.1.0.

Any idea?

Di Maio, Dario

unread,
Aug 27, 2016, 2:30:45 AM8/27/16
to sou...@googlegroups.com

You should define if the node shall start as access point with WebConfig at the setup() before all the configuration steps.

Look at the LYT8266 example. Use the latest Souliss release.

Dario.

From Mobile.

--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+unsubscribe@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/2017efc0-4075-4012-858d-9ab6c978e0b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages