scottchiefbaker / ESP-WebOTA

Simple web based Over-the-Air (OTA) updates for ESP based projects
MIT License
283 stars 38 forks source link

Use with WiFiManager.h #2

Closed bill-orange closed 4 years ago

bill-orange commented 5 years ago

@scottchiefbaker Can your library somehow be used with WiFiManager.h? On an unattached ESP32 it would be good to update and setup Wifi without tethering to a PC.

Please advise.

P.S. Nice work. Worked on the first try!

scottchiefbaker commented 5 years ago

Yes the two should work together just fine, but I haven't tried it. WebOTA binds to port 8080 by deault which should not conflict with WifiManager.

I've never used WifiManager, so let me know your test results and I can update the docs.

bill-orange commented 5 years ago

Will do. I will let you know the result.

Invoke WifiManager before init_wifi(ssid, password, host); ?

scottchiefbaker commented 5 years ago

init_wifi(ssid, password, host); is just a wrapper around the regular joining WiFi stuff. I would anticipate that part would conflict with WifiManager?

For simplicity, connect to WiFi (however you do it) before running the OTA handle stuff. In my case I use init_wifi() because it simplifies the process of connecting to WiFi and starting mDNS.

bill-orange commented 5 years ago

@scottchiefbaker Understand.

This seems to work:

Modify WebOTA.h (middle line added):

int init_wifi(const char *ssid, const char *password, const char *mdns_hostname);
int init_mdns(const char *host);
extern WebOTA webota;

In sketch use:init_mdns(host) instead of init_wifi(ssid, password, host)

In my network http://ESP-OTA.local:8080/update does not work. I need to use:

http://ESP-OTA:8080/update

This seems like a common concern. When I set up OCTOPI for 3D printing, the instructions said to use OCTOPI.local and if it did not work to try OCTOPI.

scottchiefbaker commented 4 years ago

Where did we leave this?

bill-orange commented 4 years ago

I am running, but with a modification to WebOTS.h as described above. I am hesitant to recommend WebOTA.h be revised. I don’t know what the impact of this change would in other people’s situations.

scottchiefbaker commented 4 years ago

I just used WifiManager and WebOTA together in the same sketch with no changes required.