These are chat archives for esp8266/Arduino

3rd
Nov 2015
Luc
@luc-github
Nov 03 2015 01:39
@igrr I use swap to avoid serial garbage when I send a retart command and I do not have serial enable few seconds after restart for same reason, so If there is no obvious mistake in procedure I describe to you - now I will dig using simple sample and report the output - thanks for your help
Luc
@luc-github
Nov 03 2015 01:57
I used BasicOTA.ino just add an output at each loop and a delay(2000) and same output - upload ok - ERROR[0]: No Error but after sample continue and do not reset - here the output
OTA server at: ESP8266-OTA-22e89:8266
Ready
First version
First version
First version
Update Start: ip:192.168.0.101, port:48266, size:346816
ERROR[0]: No Error
First version
First version
First version
if I restart it is like no upload happened :
OTA server at: ESP8266-OTA-22e89:8266
Ready
First version
First version
First version
the uploaded is same code but with output "second version"
Luc
@luc-github
Nov 03 2015 03:11
from another hand, if I use WebUpdater.ino, it works!
after upload the reset happen and new sketch is used - weird
Ivan Grokhotkov
@igrr
Nov 03 2015 08:36
since this line doesn't run, apparently there is some error:
Serial.printf("Update Success\nRebooting...\n");
can you please uncomment this line in Updater.cpp and try again?
//#define DEBUG_UPDATER Serial
Updater.cpp is in cores/esp8266 directory
Luc
@luc-github
Nov 03 2015 09:17
I have compared code and found difference between ESP8266HTTPUpdateServer.cpp and ArduinoOTA.cpp, first one use if(Update.end(true)) second use if(Update.end())
by changing if(Update.end(true)) in ArduinoOTA.cpp first time update succeed but go into dead loop second try it worked
ok will do #define DEBUG_UPDATER Serial
ok result is :
First version
Update Start: ip:192.168.0.101, port:48266, size:346928
premature end: res:0, pos:339968/346928
ERROR[0]: No Error
First version
First version
Luc
@luc-github
Nov 03 2015 09:30
looks like some part is missing
missing 6960 = 4096 + 2864
sending 4096
sending 2864
done!
could be first and last packet ? or 2 last packets ?
Luc
@luc-github
Nov 03 2015 09:39

the web update - works without problem:

Booting Sketch...
HTTPUpdateServer ready! Open http://esp8266-webupdate.local/update in your browser
Staged: address:0x00059000, size:0x00054B30

ets Jan 8 2013,rst cause:2, boot mode:(3,7)

load 0x4010f000, len 1264, room 16
tail 0
chksum 0x42
csum 0x42
@cp:0
ld
Booting
OTA server at: ESP8266-OTA-22e89:8266
Ready
Second version
Second version

could be a bug in ota_server.py ?
I tried espota.py but it is not working
Luc
@luc-github
Nov 03 2015 10:43

somehow ota_server.py connection.close() is taken in account too fast - I have added a sleep and now the number of packet is correct

adding :

finally:
  time.sleep(2)
  connection.close()

First version
First version
Update Start: ip:192.168.0.101, port:48266, size:346928
Staged: address:0x002AB000, size:0x00054B30
Update Success
Rebooting...

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1264, room 16
tail 0
chksum 0x42
csum 0x42
@cp:0
ld
Booting
OTA server at: ESP8266-OTA-22e89:8266
Ready
Second version
Second version
Second version

so problem was in python script
Luc
@luc-github
Nov 03 2015 10:50
I also was able to use python espota.py if I do not use the port parameter
it says it use port 48266. if I use:
python espota.py -i 192.168.0.120 -p 48266 -f BasicOTA.cpp.bin I got no device response error
if I use :
python espota.py -i 192.168.0.120 -f BasicOTA.cpp.bin it is fine
Me No Dev
@me-no-dev
Nov 03 2015 11:29
-p is the port number
in your case it's different than 48266
be default OTA should be at port 8266, unless somebody decided otherwise and I have not seen the commit
mDNS service should also advertise that port
Luc
@luc-github
Nov 03 2015 11:31
ho so there is some typo issue on output :
Update Start: ip:192.168.0.101, port:48266, size:346928
Staged: address:0x002AB000, size:0x00054B30
Update Success
Rebooting...
the 4 should not be there - right ?
Me No Dev
@me-no-dev
Nov 03 2015 11:32
right
by default the python script should select port 8266 I think
you can check the source
Luc
@luc-github
Nov 03 2015 11:33
I relied on output - will check the typo issue - thanks
Luc
@luc-github
Nov 03 2015 11:41
yes 8266 in script and working - and not typo issues but may be misunderstanding from me
script has both
serverPort = 48266
server_address = ('0.0.0.0', serverPort)
and remote_address = (remoteAddr, 8266)
so it is confusing
Me No Dev
@me-no-dev
Nov 03 2015 11:42
ok so this is how OTA goes
the computer sends ping to the ESP to tell it thata there is an update
that happens on port 8266 on the ESP
then the ESP calls bac the PC at port 48266 to get the update
Luc
@luc-github
Nov 03 2015 11:44
thank you
Me No Dev
@me-no-dev
Nov 03 2015 11:50
no probs :) seems I have forgotten how it worked
Luc
@luc-github
Nov 03 2015 11:52
:smile:
sticilface
@sticilface
Nov 03 2015 14:59
I need some help to get OTA working without 1) disabling firewall 2) putting my own delay in the reply, to give me enough time to click allow.. I'm using mac, el cap.

I have code signed everything on my computer. python, the arduino IDE, the ota script. in every case the output from codesign -dvvv is this

Executable=/Users/amelvin/Arduino/esp8266/tools/espota.py
Identifier=espota
Format=generic
CodeDirectory v=20100 size=115 flags=x0(none) hashes=1+2 location=embedded
Hash type=sha1 size=20
CDHash=c6c79c6ddb2ddc59f050130c279bff6e82f63da7
Signature size=1501
Authority=mycodesigning
Signed Time=3 Nov 2015, 14:28:47
Info.plist=not bound
TeamIdentifier=not set
Sealed Resources=none
Internal requirements count=2 size=136

none of it makes any difference. the cert mycodesigning is trusted for everything. i've restarted my machine.. from what i can see this should work...

brutzler
@brutzler
Nov 03 2015 19:49
Hi, can anybody help me? Looking for the "DNS_SD_Arduino_OTA"-Sketch since several hours. Looks like I am too stupid for the www.....
brutzler
@brutzler
Nov 03 2015 20:02
Oh dear.... forget it. Changing the board to an ESP.... and viola.... ESP8266mDNS is appearing. Sometimes it is so hopeless with me.