Skip to content

espota.py stalls on some OTA updates leaving Python running in a tight infinite loop #4746

Closed
@Paraphraser

Description

@Paraphraser

Basic Infos

  • [X ] This issue complies with the issue POLICY doc.
  • [X ] I have read the documentation at readthedocs and the issue is not addressed there.
  • [?] I have tested that the issue is present in current master branch (aka latest git).
  • [X ] I have searched the issue tracker for a similar issue.
  • [n/a ] If there is a stack dump, I have decoded it.
  • [X ] I have filled out all fields below.

Platform

  • Hardware: [WeMos D1 R2]
  • Core Version: [arduino.esp8266.com/stable/package_esp8266com_index.json]
  • Development Env: [Arduino IDE 1.8.5]
  • Operating System: [MacOS Sierra 10.12.6]

Settings in IDE

  • Module: [WeMos D1 R2 & Mini]
  • Flash Mode: [no such entry in IDE that I can see]
  • Flash Size: [4M (1M SPIFFS)]
  • lwip Variant: [v2 Lower Memory]
  • Reset Method: [no such entry in IDE that I can see]
  • Flash Frequency: [no such entry in IDE that I can see]
  • CPU Frequency: [80Mhz]
  • Upload Using: [OTA]
  • Upload Speed: [n/a]

Problem Description

I am using OTA updating. On most attempts (>95%) the sketch compiles and uploads without incident. On the remaining 5% of occasions:

  1. I click the "Upload" button in the IDE.
  2. The "Upload" button changes to a yellow surround.
  3. The sketch compiles.
  4. The status row changes to "Uploading...".
  5. The row of dots marches much further to the right than expected before finally stopping.
  6. The status row remains stuck at "Uploading..." indefinitely.
  7. The "Upload" button remains yellow indefinitely.
  8. I realise that the upload has stalled.
  9. I re-click the "Upload" button (which responds, even though it is still yellow).
  10. The sketch compiles.
  11. The status row changes to "Uploading...".
  12. The row of dots marches the expected distance.
  13. The status row changes to "Done uploading".
  14. The "Upload" button changes to a light green surround.

Thus far, I have never had a second attempt (ie starting at step 9) stall, requiring a third attempt.

I could live with the occasional stall but one side-effect is that Python never quits. It shows up in the Mac OS "Activity Monitor" as being responsible for 99.9% of energy consumption, which suggests it is stuck in a tight infinite loop. The high energy consumption is why I noticed the problem because the laptop I was working on became unusually hot. The only way to recover from this is to kill Python (or restart). Quitting the IDE does not cause Python to quit.

This side effect of high energy consumption by Python is my main motivation in reporting the problem, so that anyone following in my footsteps will know that finding and clobbering Python is an effective workaround.

I am not including a test sketch because OTA updating works 95% of the time, suggesting that OTA updating is set up correctly in the code running on the WeMos board. I currently have one WeMos D1 R2s and one WeMos D1 R2 Mini Pro, running totally different sketches, both being updated OTA. The problem is evident on both targets but does not "follow the board" and does not "follow the sketch". The common element is the IDE which suggests that this problem is more likely to be with either the IDE or espota.py.

The IDE does not produce any error messages associated with this problem. The closest I can get is some "ps" output for the stalled invocation of Python:

$ ps -ax|grep -i python
2040 ?? 21:59.05 python /Users/home/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.1/tools/espota.py -i 192.168.1.152 -p 8266 --auth= -f /var/folders/py/j18yts_n3rzb3hmxyz41bghm0000gn/T/arduino_build_945086/sketch_19_hikingMeterLogger_WeMosD1.ino.bin

Metadata

Metadata

Assignees

Labels

component: OTAwaiting for feedbackWaiting on additional info. If it's not received, the issue may be closed.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions