These are chat archives for esp8266/Arduino

5th
Jun 2016
Clemens Kirchgatterer
@everslick
Jun 05 2016 07:43
so, the migration to async webserver is done, but the OTA update stack-dumps on me. :-(
clemens@secrets:~/Devel/ESP8266/genesys$ make stack
0x402010cf: __wrap_realloc at ??:?
0x40104c5c: lmacTxFrame at ??:?
0x4020ffcc: yield at ??:?
0x4020f76d: UpdaterClass::_writeBuffer() at ??:?
0x4020f81f: UpdaterClass::write(unsigned char*, unsigned int) at ??:?
0x402102da: String::String(char const*) at ??:?
0x4020de24: handle_update_progress_cb(AsyncWebServerRequest*, String, unsigned int, unsigned char*, unsigned int, bool) at http.cpp:?
This message was deleted
UpdaterClass::_writeBuffer() calls yield(). Isn't that forbidden in AsyncTCP ?
You can not use yield or delay or any function that uses them inside the callbacks
@me-no-dev looks pretty dim. :-(
Me No Dev
@me-no-dev
Jun 05 2016 08:14
yes, let me look at the updater
I know some folks got it to run async
can you try commenting out the yield calls in write and _writeBuffer
Me No Dev
@me-no-dev
Jun 05 2016 08:20
if that works, I'll PR a writeAsync method to the Updater
Clemens Kirchgatterer
@everslick
Jun 05 2016 08:43
ok, i test it
it uploads the file, then reboots, but does not start anymore
Me No Dev
@me-no-dev
Jun 05 2016 08:47
that should not be connected
Clemens Kirchgatterer
@everslick
Jun 05 2016 08:47
either the update is not finished correctly (but on my side) or the update does not work correctly anymore
Me No Dev
@me-no-dev
Jun 05 2016 08:47
if the updater said it's good, then it should by all means work
debug enabled on Updater?
Clemens Kirchgatterer
@everslick
Jun 05 2016 08:48
no not anabled
trying that
skrew that, it worked, it just booted into bootloader
Me No Dev
@me-no-dev
Jun 05 2016 08:49
btw, you did restart manually after Serial upload right?
Clemens Kirchgatterer
@everslick
Jun 05 2016 08:49
hehe, exactly
everything is fine
i tried 5 times now, and it worked every single time
Me No Dev
@me-no-dev
Jun 05 2016 08:50
it was expected :)
Clemens Kirchgatterer
@everslick
Jun 05 2016 08:52
the progress log (in my code) is borked, but this will be easily fixable.
reloading different pages is now faster and more stable, i'm quite happy
Me No Dev
@me-no-dev
Jun 05 2016 08:53
btw I do not know if you know, but there is an Async MQTT imlementation now based on AsyncTCP
Clemens Kirchgatterer
@everslick
Jun 05 2016 08:53
no, i didn't
Me No Dev
@me-no-dev
Jun 05 2016 08:53
the drawback is not supporting HTTPS yet
Clemens Kirchgatterer
@everslick
Jun 05 2016 08:54
TLS
i guess
Me No Dev
@me-no-dev
Jun 05 2016 08:54
but it has been tested with millions of messages to no fail
yes
Clemens Kirchgatterer
@everslick
Jun 05 2016 08:54
sounds great
Clemens Kirchgatterer
@everslick
Jun 05 2016 08:54
i will need TLS though, (even though i don't have it now)
is TLS planned?
click
Me No Dev
@me-no-dev
Jun 05 2016 08:55
yes, as soon as I find implementable
axtls does not work with async
Clemens Kirchgatterer
@everslick
Jun 05 2016 08:56
IC
Clemens Kirchgatterer
@everslick
Jun 05 2016 09:04
@me-no-dev : anyway, thank you very much. can you pls announce here, if the asyncUpdater gets merged?
Me No Dev
@me-no-dev
Jun 05 2016 09:04
sure thing, I'll post PR in a bit
Clemens Kirchgatterer
@everslick
Jun 05 2016 09:05
i will pospone my push until it is at least in master
after more testing i have to say async works so much better, it really should be the default!
Me No Dev
@me-no-dev
Jun 05 2016 09:16
it is better, but it's not as easy as the regular one :) there are many things that you can not do inside async callbacks that users can do in the callbacks of the included server
Me No Dev
@me-no-dev
Jun 05 2016 09:45
esp8266/Arduino#2096 is the PR, it adds Updater.runAsync(true/false); to switch the modes
Me No Dev
@me-no-dev
Jun 05 2016 10:01
@everslick merged into master ;)
@igrr thanks :)
Ivan Grokhotkov
@igrr
Jun 05 2016 10:08
Yeah, making async the default approach is the plan, but it requires some work... we need to make shooting oneself in a foot more complicated. After all, Arduino is about ease of use.
Right now i have a working port of asio, which is the candidate for networking API to be incorporated into C++ STL. It almost fits the bill, but unfortunately its dependence on STL brings some problems.
For example, it would be nice if it took Arduino strings, but of course it takes STL strings instead...
Me No Dev
@me-no-dev
Jun 05 2016 10:18
seems pretty easy to use
are you planning to ditch lwip all together?
Clemens Kirchgatterer
@everslick
Jun 05 2016 14:06
so i have to call Update.runAsync() after Update.begin(). COOL!
thx guys!
works as advertised! :)
Clemens Kirchgatterer
@everslick
Jun 05 2016 14:18
i can now push the hardware really hard, i.e. pressing reload on a page that immediately opens a websocket back from the browser as fast as i can. i can trigger an out of memory condition after ~20 reloads and even then it seldomly crashes. before that, it would reboot after 3 reloads at max.
Martin Ayotte
@martinayotte
Jun 05 2016 15:59
About my NYTimes tests, I'm still pulling my hairs with WTDs, I think will wait the dusts coming down, especially that @vicnevicne got it working on his side.
Ivan Grokhotkov
@igrr
Jun 05 2016 16:11
@me-no-dev it's not a replacement for LwIP (which is a TCP/IP stack), it's an API wrapper around sockets, readv, writev, and select.
so no, not ditching LwIP
Me No Dev
@me-no-dev
Jun 05 2016 17:28
@igrr maybe I missread something :) it looked like full-on stack