homieiot / homie-esp8266

πŸ’‘ ESP8266 framework for Homie, a lightweight MQTT convention for the IoT
http://homieiot.github.io/homie-esp8266
MIT License
1.36k stars 308 forks source link

Homie does not show the configuration page #231

Closed averri closed 7 years ago

averri commented 7 years ago

I'm running the example https://github.com/marvinroger/homie-esp8266/blob/master/examples/HookToEvents/HookToEvents.ino in the ESP8266.

The device enters in the AP mode, it's possible to get access to the WiFi, but the configuration page does not appear in the browser.

marvinroger commented 7 years ago

The configuration page (ui_bundle.gz) has to be flashed to the SPIFFS. See UI bundle

averri commented 7 years ago

Hi @marvinroger, thanks for informing that. I have tried with no success. I can connect to the WiFi, but the captive portal is not working.

Following the instructions in the page https://github.com/marvinroger/homie-esp8266/tree/develop/data/homie, I understand that the items 1 and 2 are mutually exclusive, is that right? I'm not using the config.json file, as I want to use the captive portal.

image

marvinroger commented 7 years ago

When you say "the captive portal is not working", does it show something?

averri commented 7 years ago

No, it doesn't show anything. The browser doesn't open, and even if you open it manually and type any url, the captive portal does not appear.

marvinroger commented 7 years ago

The captive portal does not appear, but what appears? A 404?

averri commented 7 years ago

No, there is no 404. The browser says "There is no internet connection." Is Homie using DNS for the captive portal? I'm asking this because there is no DNS resolution during the configuration mode.

averri commented 7 years ago

It looks like the ui_bundle.gz is not being added to the SPIFFS. I have added a small code into the setup function to print the directories from SPIFFS:

void setup() {

    Serial.begin(115200);
    Serial.println();
    Serial.println();

    Serial.println("Directories:");
    String str = "";
    SPIFFS.begin();
    Dir dir = SPIFFS.openDir("/");
    while (dir.next()) {
        str += dir.fileName();
        str += " / ";
        str += dir.fileSize();
        str += "\r\n";
    }
    Serial.print(str);

    Homie.enableLogging(true);
    Homie.setFirmware("events-test", "1.0.0");
    Homie.onEvent(onHomieEvent);
    Homie.setup();
}

It prints "Directories:" and nothing else, which is an evidence that there is no homie directory in the SPIFFS. I have noticed that the data folder was in the wrong place, it should be in the root directory of the project. I have changed it accordingly, but still no success. I'm using Platformio to compile the project.

marvinroger commented 7 years ago

Here's how it works:

Have you read http://docs.platformio.org/en/stable/platforms/espressif8266.html?highlight=spiffs#uploading-files-to-file-system-spiffs ?

averri commented 7 years ago

Yes, I'm using that process to upload to SPIFFS. Now, I can see the file there:

/homie/ui_bundle.gz / 49414

But sill not getting redirected to the web ui.

marvinroger commented 7 years ago

What if you type directly 192.168.123.1 in your web browser?

averri commented 7 years ago

It says:

This site can’t be reached 192.168.123.1 took too long to respond.

marvinroger commented 7 years ago

Which version of Homie for ESP8266 do you use?

Gulaschcowboy commented 7 years ago

@marvinroger Is "Have you read http://docs.platformio.org/en/stable/platforms/espressif8266.html?highlight=spiffs#uploading-files-to-file-system-spiffs ?" a platformio-only function?

If yes, did I miss that in the docs?

averri commented 7 years ago

I'm using Homie version 1.5.0, installed from Platformio. Would you like me to try any other version?

marvinroger commented 7 years ago

@averri that's why, the captive portal is implemented as of 2.0.0, which is not yet released in pio as it's not yet ready. See the Note for v1.x users in the README, about where to find the docs.

@Gulaschcowboy no it's not a pio only function. πŸ˜‰ You can do that from the Arduino IDE too (see http://esp8266.github.io/Arduino/versions/2.3.0/doc/filesystem.html#uploading-files-to-file-system)

averri commented 7 years ago

Ahhh, that's it. :)

Thanks for informing that. This is the excitement effect, people get excited with the project and start using it even before reading the entire documentation (myself included).

marvinroger commented 7 years ago

No problems! πŸ˜ƒ