philbowles / PangolinMQTT

PangolinMQTT - ArduinoIDE client library for ESP8266, ESP32 and STM32-NUCLEO
Other
70 stars 22 forks source link

SessionRecovery2 example entirely broken #17

Closed pfeerick closed 4 years ago

pfeerick commented 4 years ago

https://github.com/philbowles/PangolinMQTT/tree/master/examples/SessionRecovery2

It looks like options.h was somehow overwritten with the contents of SessionRecovery2.ino, rendering this example unusable in it's present form.

philbowles commented 4 years ago

Thank you. Have you tried replacing options.h with the copy found in SessionRecovery1 ? It should be the same and enable the sketch to run.

pfeerick commented 4 years ago

Just tried that, and after disabling USE_TLS SessionRecover2 works fine with the options.h from SessionRecovery1.

I was going to use https://github.com/jeroenst/ESPAsyncTCP to do the compile test with USE_TLS (since that is fork of https://github.com/me-no-dev/ESPAsyncTCP with the SSL fix applied as a single commit), but I can see after pulling both your and no-me-dev's repos and diff'ing them (and you didn't fork because...?) that since PangolinMQTT relies on the ASYNC_TCP_SSL_ENABLED define being set, and the Arduino preprocessor is still stupidly doing library includes before defines, setting it in sketch fails miserably, so it needs to be done in-library. So https://github.com/philbowles/ESPAsyncTCP it was, and yes, it works also.

So I look forward to the next release including the correct options.h so that the example works OOTB! 😉 Otherwise this should say Alpha, not Beta, on the tin! 😛