These are chat archives for esp8266/Arduino

28th
Jul 2016
Loial Otter
@LoialOtter_twitter
Jul 28 2016 02:22 UTC
Has anyone made a minimalistic OTA Update firmware? I'm looking for something to be used both as the initial loader as well as a failsafe recovery in case of a boot loop
Loial Otter
@LoialOtter_twitter
Jul 28 2016 07:19 UTC
Okay, so it looks like the ArduinoOTA is a reasonably simple setup using UDP packets to configure than TCP to transfer. It looks like it uses a MD5 hash for the password. Once everything's set up, the module opens a TCP port up to the initiating host and writes everything it receives into place.
Ivan Grokhotkov
@igrr
Jul 28 2016 07:19 UTC
Correct :)
Loial Otter
@LoialOtter_twitter
Jul 28 2016 07:20 UTC
looks like it should be portable away from the rest of the system - should be able to be programmed in C... intent is to make something tiny
Right now I'm in a bit of a bind in that the arduino variant software I just wrote works great but is too large to hold in my other CPU and I never designed the board for direct programming of the ESP8266 (the CPU was supposed to do that)... so making an initial bootstrap is one of the available options
thanks
Ivan Grokhotkov
@igrr
Jul 28 2016 07:24 UTC
How tiny do you want it to be?
Loial Otter
@LoialOtter_twitter
Jul 28 2016 07:25 UTC
something similar to mboot if possible - small enough that it doesn't take away much sketch space and can be left in the system after as a recovery method
absolute requirement is under 180KB as that's the payload limit on my main CPU... if possible way under that
I probably have my names wrong
eboot, i meant; something to work along side it
Akash Ashok
@thehellmaker
Jul 28 2016 07:28 UTC
Regarding #2330 looks like open source lwip 1.4.1 also has ARP response issue
Loial Otter
@LoialOtter_twitter
Jul 28 2016 07:29 UTC
I'll test a minimal sketch tomorrow then port it if that doesn't work. Thanks again... this is a really fantastic project
Ivan Grokhotkov
@igrr
Jul 28 2016 07:29 UTC
eboot can not do wifi...
you need OTA over wifi, right?
i'm not 100% sure, but fitting wifi and tcp/ip stacks into 180k may not be possible.
Loial Otter
@LoialOtter_twitter
Jul 28 2016 07:33 UTC
correct, and ya. It is possible, just quite tight. My previous firmware is 37K+149K and includes all the OSC/serial/UDP and webserver setup (though not files, that was 48k of espfs)
it was all in C though
Ivan Grokhotkov
@igrr
Jul 28 2016 07:38 UTC
okay
yes, should be doable
Clemens Kirchgatterer
@everslick
Jul 28 2016 10:25 UTC
why is the MDNSResponder creating an global object of itself (MDNS)? this makes runtime memory management kinda difficult. :-(
Ivan Grokhotkov
@igrr
Jul 28 2016 10:27 UTC
initially it didn't, but then we changed this to arduino-like "global object" pattern. don't remember the exact reason right now
Clemens Kirchgatterer
@everslick
Jul 28 2016 10:27 UTC
i can call the destructor manually MDNS.~MDNSResponder(); which is bad enough, but that won't free its mem. :-/
Ivan Grokhotkov
@igrr
Jul 28 2016 10:30 UTC
maybe we can add MDNS.end() which will free up all the stuff
Clemens Kirchgatterer
@everslick
Jul 28 2016 10:30 UTC
but the object itself still cannot be freed, can it?
Ivan Grokhotkov
@igrr
Jul 28 2016 10:30 UTC
except for the sizeof(MDNS), but it's probably only around 80 bytes
Clemens Kirchgatterer
@everslick
Jul 28 2016 10:31 UTC
IC
Me No Dev
@me-no-dev
Jul 28 2016 10:31 UTC
@everslick what is your use case?
Clemens Kirchgatterer
@everslick
Jul 28 2016 10:32 UTC
the use case ist, that the user can disable and enable modules at will. if he does not want a webserver, it will not get instantiated and won't eat memory.
Karol
@KaDw
Jul 28 2016 10:34 UTC
Hi, I'm having trouble with WiFi.scanNetworks(), I'm in AP mode trying to get other networks around me and send them using websockets to my config page. Unfortunately scanNe
tworks returns 0 all the time. I also tried scanning in STA mode, here is code http://pastebin.com/jpPnHb8K
Clemens Kirchgatterer
@everslick
Jul 28 2016 10:34 UTC
i'm now able to load and unload modules at runtime and allocate/free them nicly, but global objects make this moot.
Ivan Grokhotkov
@igrr
Jul 28 2016 10:34 UTC
we can add #ifdef NO_MDNS_GLOBAL for you
or you can add it yourself and set it in makefile
Clemens Kirchgatterer
@everslick
Jul 28 2016 10:35 UTC
i'd prefere to have it in upstream, otherwise i have to patch upstream each time i pull master
Ivan Grokhotkov
@igrr
Jul 28 2016 10:36 UTC
  • or you can add it yourself and make a pull request
Clemens Kirchgatterer
@everslick
Jul 28 2016 10:36 UTC
that is fin with me! :)
i will look for other GLOBALS in the lib in the same go?
Ivan Grokhotkov
@igrr
Jul 28 2016 10:38 UTC
EEPROM, SSDP, SPI, Wire, ArduinoOTA
Clemens Kirchgatterer
@everslick
Jul 28 2016 10:38 UTC
ESP8266HTTPUpdate ESPhttpUpdate;
Ivan Grokhotkov
@igrr
Jul 28 2016 10:39 UTC
SPIFFS FWIW
Clemens Kirchgatterer
@everslick
Jul 28 2016 10:40 UTC
how about '#ifndef NO_GLOBAL_INSTANCE' ?
Ivan Grokhotkov
@igrr
Jul 28 2016 10:40 UTC
if there are no dependencies on these objects then that's fine.
i.e. if no other library is using ArduinoOTA or SPIFFS explicitly
if it does, it probably has to be refactored to take instance as an argument.
Clemens Kirchgatterer
@everslick
Jul 28 2016 10:41 UTC
but it won't affect anybody who does not have the define set
Ivan Grokhotkov
@igrr
Jul 28 2016 10:41 UTC
(which is okay for SPIFFS but is a bit awkward for ArduinoOTA)
how about #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SPIFFS)
NO_GLOBAL_MDNS
etc
Clemens Kirchgatterer
@everslick
Jul 28 2016 10:43 UTC
ok
so we can switch them off globally and individually.
Martin Ayotte
@martinayotte
Jul 28 2016 14:08 UTC
@Def152 , it is normal that WIFI_AP, doesn't scan any network since you can not connect as STA at the same time. You need to use WIFI_AP_STA to get both.
Karol
@KaDw
Jul 28 2016 15:15 UTC
@martinayotte even if I'm in STA mode and start scanning I get 0
Also tried WIFI_STA_AP, still 0
SteveToulouse
@SteveToulouse
Jul 28 2016 16:09 UTC
@Def152 if you call scan from the main loop, instead of in the timer callback, can you see networks?