Arduino: Pull (#6765) breaks arduino-esp8266fs-plugin functionality

Created on 15 Nov 2019  路  12Comments  路  Source: esp8266/Arduino

Basic Infos

  • [ ] 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.
  • [ ] If there is a stack dump, I have decoded it.
  • [ ] I have filled out all fields below.

Platform

  • Hardware: [ESP-12]
  • Core Version: [latest]
  • Development Env: [Arduino IDE]
  • Operating System: [Ubuntu]

Settings in IDE

  • Module: [Wemos D1 mini]
  • Flash Mode: [?]
  • Flash Size: [4MB]
  • lwip Variant: [v1.4|v2 Lower Memory]
  • Reset Method: [ck|nodemcu]
  • Flash Frequency: [40Mhz]
  • CPU Frequency: [80Mhz]
  • Upload Using: [SERIAL]
  • Upload Speed: [115200] (serial upload only)

Problem Description

Hi,
First time as active github contributor here so please forgive if not everything is correct.

The change in upload.py breaks arduino-esp8266fs-plugin functoinality.

The plugin esp8266fs.jar executes:

....upload.py --chip esp8266 --port /dev/ttyUSB0 --baud 921600 write_flash 0x200000/tmp/something.bin --end

... so that esptool gives out:

esptool write_flash: error: argument

: Must be pairs of an address and the binary filename to write there

The problem seems to be that the change in upload.py.

cmdline in "esptool.main(cmdline)" becomes:

--chip', 'esp8266', '--port', '/dev/ttyUSB0', '--baud', '460800', 'write_flash', '0x200000', '--end', '0x0', '/tmp/something.bin'

... so that '--end' is passed to esptool and '0x0' is passed aditionally but should not.

Ref: #6765

All 12 comments

It's not correct, you ignored the issue template which requires certain information. Please edit your post above, add the template, follow the instructions in it, and fill out the required info.

@earlephilhower I think a new plugin version is needed

Looks like changing some lines in ESP8266FS.java of arduino-esp8266fs-plugin to directly invoke esptool.py is the best and easiest solution. For me it's working. I'll try to send my proposal there.

https://github.com/esp8266/arduino-esp8266fs-plugin/issues/62

It's not correct, you ignored the issue template which requires certain information. Please edit your post above, add the template, follow the instructions in it, and fill out the required info.

I hope it's ok now. Thanks.

It's enough, and much better than other cases. Thank you! I fixed the one thing missing: a reference in the description to the PR that broke the plugins.

Strictly speaking you're correct to close this issue and raise the problem in the other repo(s). However, I consider this case to be a bit special:

  • development is hampered while the plugins are broken. This makes for a bit of urgency. I'm in this boat.
  • there are two plugins involved: the SPIFFS one and the LittleFS one. I believe @earlephilhower is handling them.
  • I don't know if the SPIFFS plugin is being updated in the original repo or in @earlephilhower 's fork.

All of this means that special coordination and tracking is needed, so I'm keeping this issue open.

In addition, the README needs to be updated:

  • add a link to both plugins in the Other links section
  • replace the esptool-ck link with esptool.py, or add the esptool.py link in addition to the other
  • add a quick link at the top to jump to the Other Useful Links section at the bottom

We can also ignore --end in upload.py.
PR is welcome

Then there is still:

cmdline = cmdline + ['0x0', binary]

... that adds the '0x0'...

Changing plugins to directly invoke esptool.py seems to me to be the easiest fix (of course it's a beginners opinion :)

And now looking a second time at the code my problem description in the first post seems to be incomplete.
It should be:

cmdline in "esptool.main(cmdline)" becomes:

['--chip', 'esp8266', '--port', '/dev/ttyUSB0', '--baud', '460800', 'write_flash', '0x200000', '--end', 'write_flash', '0x0', '/tmp/arduino_build_949720/something.bin']

...so 'write_flash' is passed two times too because of:

cmdline = cmdline + ['write_flash'].

Changing:
File uploadPyFile = new File(platform.getFolder()+"/tools", "upload.py");

to

File uploadPyFile = new File(platform.getFolder()+"/tools/esptool", "esptool.py");

and

sysExec(new String[]{pythonCmd, uploadCmd, "--chip", "esp8266", "--port", serialPort, "--baud", uploadSpeed, "write_flash", uploadAddress, imagePath, "--end"});

to

sysExec(new String[]{pythonCmd, uploadCmd, "--chip", "esp8266", "--port", serialPort, "--baud", "460800", "write_flash", uploadAddress, imagePath});

in ESP8266FS.java of the arduino-esp8266fs-plugin was the way to fix it for me. It needs further investigation if it works for every OS and every condition.

Two lines of code :)

It is now time to make your pull-requests on these repositories !

Closing as fixed w/#6788

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dariopb picture dariopb  路  3Comments

mark-hahn picture mark-hahn  路  3Comments

Chagui- picture Chagui-  路  3Comments

markusschweitzer picture markusschweitzer  路  3Comments

treii28 picture treii28  路  3Comments