rpanfili / airQualityMeter

Detects air particulate matter (PM - pm1, pm2.5, pm10) concentrations and sends data to an MQTT server. An alternative firmware for ESP8266 devices like the NodeMCU board written for Arduino IDE and PlatformIO
GNU General Public License v3.0
19 stars 5 forks source link

wifimanager issues #7

Closed 2114L3 closed 4 years ago

2114L3 commented 4 years ago

issue with wifimanager HTTP_HEAD rename in 0.14 changing line 25 in platformio.ini from WifiManager@~0.14 to WifiManager@~0.15 resolves the compile issue, but get exception looping on reset after wifimanager is setup.

rpanfili commented 4 years ago

Hi 2114L3, WifiManager version for this (stale) project was fixed. Just checked out and it compiles fine with 0.14 and a later version is not required.

The issue that you linked is related to a naming refactor on that specific dependency that is unrelated with this project usages.

If you need further support please report your pio run compile output and any other debug that could help.

2114L3 commented 4 years ago

i'm compiling with docker using https://github.com/suculent/platformio-docker-build

0.14 errors with.

.pio/libdeps/nodemcuv2/WifiManager_ID567@0.14/WiFiManager.h:25:24: error: 'const char HTTP_HEAD []' redeclared as different kind of symbol
 const char HTTP_HEAD[] PROGMEM            = "<!DOCTYPE html><html lang=\"en\"><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1, user-scalable=no\"/><title>{v}</title>";
                        ^
In file included from .pio/libdeps/nodemcuv2/WifiManager_ID567@0.14/WiFiManager.h:17:0,
                 from src/main.cpp:5:
/root/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WebServer/src/ESP8266WebServer.h:33:39: error: previous declaration of 'HTTPMethod HTTP_HEAD'
 enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };

this is https://github.com/tzapu/WiFiManager/issues/927 which lead to the refactor in 0.15 to remove the conflict renaming manually allows compiling to succeed, but as you dont have issues with 0.14 then the issue may be in my build environment. perhaps my toolchain it too recent

rpanfili commented 4 years ago

Hi @2114L3, just tried the docker container you linked. Except for the fact that the latest build of that still links to an old (buggy) release (https://hub.docker.com/r/suculent/platformio-docker-build/tags) if you checkout the master version the main issue I think it's related to its hardcoded framework-arduinoespressif8266 dependency, installed during the dockerbuild. As you can see into the compile output the error comes from that:

In file included from .pio/libdeps/nodemcuv2/WifiManager_ID567/WiFiManager.h:17:0,
                 from src/main.cpp:5:
/root/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WebServer/src/ESP8266WebServer.h:33:39: error: previous declaration of 'HTTPMethod HTTP_HEAD'
 enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_HEAD, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
                                       ^

I attached into the latest build container (that as you can see avoids that part), replaced the cmd.sh with the latest one on the repo, fixed the dir pathname around line https://github.com/suculent/platformio-docker-build/blob/master/cmd.sh#L79-L85 and compiled without any issues with this repo code, without upgrading anything.

rpanfili commented 4 years ago

Hi again @2114L3, I spent a couple of minutes to test dependencies and build routines and I just fixed them. Now it works even on the (most recent) master build of suculent/platformio-docker-build container.

Just to avoid additional issues I also configured TravisCI to build the code and upload it on github as a binary release: https://github.com/rpanfili/airQualityMeter/releases/tag/v1.1.1

Enjoy :)

2114L3 commented 4 years ago

awesome yeh i did log an issue with suculent/platformio-docker-build re the latest tags. looks like they have updated this the following day for your tests above.

i will update and try again. thanks!

2114L3 commented 4 years ago

tested all good, cheers