These are chat archives for esp8266/Arduino

2nd
Nov 2015
WhiteHare
@WhiteHare
Nov 02 2015 00:37
Is there a clear example somewhere of how to update an arduino sketch that's running on an esp8266 by sending the updated sketch over-the-air?
Is it even currently possible?
The "reference" document at https://github.com/esp8266/Arduino/blob/master/doc/reference.md does seem to obliquely refer to it thusly:
|--------------|-------|---------------|--|--|--|--|--|
^ ^ ^ ^ ^
Sketch OTA update File system EEPROM WiFi config (SDK)
Ivan Grokhotkov
@igrr
Nov 02 2015 05:56
@WhiteHare This isn't documented anywhere, but you may find something useful in this issue: esp8266/Arduino#268
basically the flow is like this:
  • flash DNS_SD_Arduino_OTA example sketch
  • after some time, the board will appear in 'ports' menu
  • Select 'OTA' instead of 'Serial' in Tools > Upload using
You can now do some sketches and flash the sketch. It should be uploaded over-the-air
You also need python installed and in PATH, because the script which does OTA is currently written in python.
Ivan Grokhotkov
@igrr
Nov 02 2015 06:01
There are also samples bundled with the IDE which show how to do OTA using an HTTP upload. In some contexts this might be more convenient.
Luc
@luc-github
Nov 02 2015 15:26

Hi about OTA procedure:

I use the content of BasicOTA.ino in my project and flashed my NodeMCU, serial terminal shows :
M117 Connecting...
M117 192.168.0.120
OTA server at: ESP8266-OTA-22e89:8266

so server look ready

I use the tool python ota_server.py to do OTA to flash a new version of my project

C:\Users\user\Desktop\ld5110>python ota_server.py 192.168.0.120 esp8266.cpp.bin

so terminal display this:

starting up on 0.0.0.0 port 48266
upload size: 437120
sending invitation
waiting for a connection
connection from ('192.168.0.120', 4097)
opening file esp8266.cpp.bin
sending 4096
sending 4096
....
sending 4096
sending 2944
done!

and serial terminal display this:
Update Start: ip:192.168.0.101, port:48266, size:437120
ERROR[0]: No Error

looks fine but atually ESP Fw is not modified even after a restart
do I missed something ?

Luc
@luc-github
Nov 02 2015 15:34
Thanks
Dmitry Kireev
@kireevco
Nov 02 2015 18:14
@kathir1951 hey, so looks like my environment and script works fine. tested 3 times
kathir1951
@kathir1951
Nov 02 2015 19:53
@kireevco Thanks Nice
Dmitry Kireev
@kireevco
Nov 02 2015 19:53
I will test more for linux and mac, and I hope we can have a nice cross-platform build script for toolchain
Ivan Grokhotkov
@igrr
Nov 02 2015 20:01
@kireevco for OS X don't forget to add export MACOSX_DEPLOYMENT_TARGET=10.7 (or maybe even 10.6) to the build script.
Dmitry Kireev
@kireevco
Nov 02 2015 20:01
@igrr what does it do? (where is it used)
@igrr thank you
Ivan Grokhotkov
@igrr
Nov 02 2015 20:03
basically when someone builds an executable on OS X, by default compiler will target the same OS X version. the option i mentioned is to make sure the binary will run on older versions as well
it's used by clang/gcc
Dmitry Kireev
@kireevco
Nov 02 2015 20:03
ah, that’s for gcc?
got it
thank you. mac specific.
Ivan Grokhotkov
@igrr
Nov 02 2015 20:04
there's also an equivalent GCC/clang command line option, -mmacosx-version-min, but i find it easier to set MACOSX_DEPLOYMENT_TARGET once in the environment rather than making sure -mmacosx-version-min gets passed into each configure script correctly.
just my 2 cents, i remember people having issues when I built toolchain without this option
Dmitry Kireev
@kireevco
Nov 02 2015 20:09
@igrr appreciate it!
I like esp-open-sdk because it’s open… but it doesnt’ work on windows yet :(
doesn’t build..
Ivan Grokhotkov
@igrr
Nov 02 2015 20:11
yeah, i saw pfalcon is reluctant to fix that, despite the fact that windows has about 80% user share in the esp8266 community
Dmitry Kireev
@kireevco
Nov 02 2015 20:11
yep :(
I’m trying to arrange build environment here https://github.com/kireevco/packages/tree/master/esp-open-sdk/windows
tried cygwin, mingw… there are issues… and testing cycle is pretty long .
(just complaining) :-D lol.
Ivan Grokhotkov
@igrr
Nov 02 2015 20:14
yeah, i remember it took me a few nights to troubleshoot everything and build windows toolchain on my old laptop
last time i had to do this, i got myself a D4 instance from azure cloud
Dmitry Kireev
@kireevco
Nov 02 2015 20:20
I got myself a host on hetzner, and built a proxmox host
you did a great job, thanks for your help too :)
Ivan Grokhotkov
@igrr
Nov 02 2015 20:29
ok, actually windows is down to 67%
esptool-0.4.5-linux32.tar.gz: 1103 downloads
esptool-0.4.5-linux64.tar.gz: 5845 downloads
esptool-0.4.5-osx.tar.gz: 5592 downloads
esptool-0.4.5-win32.zip: 27600 downloads
Dmitry Kireev
@kireevco
Nov 02 2015 20:30
nice data
still, lots of windows users
Ivan Grokhotkov
@igrr
Nov 02 2015 21:14
@luc-github what does the serial log show after (and during) restart?