Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull (#6765) breaks arduino-esp8266fs-plugin functionality #6777

Closed
2 of 6 tasks
gnu-emu opened this issue Nov 15, 2019 · 12 comments
Closed
2 of 6 tasks

Pull (#6765) breaks arduino-esp8266fs-plugin functionality #6777

gnu-emu opened this issue Nov 15, 2019 · 12 comments
Assignees
Milestone

Comments

@gnu-emu
Copy link

gnu-emu commented Nov 15, 2019

Basic Infos

  • This issue complies with the issue POLICY doc.
  • 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).
  • 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

@devyte
Copy link
Collaborator

devyte commented Nov 15, 2019

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.

@devyte
Copy link
Collaborator

devyte commented Nov 15, 2019

@earlephilhower I think a new plugin version is needed

@gnu-emu
Copy link
Author

gnu-emu commented Nov 15, 2019

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.

esp8266/arduino-esp8266fs-plugin#62

@gnu-emu gnu-emu closed this as completed Nov 15, 2019
@gnu-emu
Copy link
Author

gnu-emu commented Nov 15, 2019

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.

@devyte
Copy link
Collaborator

devyte commented Nov 15, 2019

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

@devyte
Copy link
Collaborator

devyte commented Nov 15, 2019

@devyte devyte changed the title Pull (#6765) breaks arduino-esp8266fs-plugin functoinality Pull (#6765) breaks arduino-esp8266fs-plugin functionality Nov 15, 2019
@devyte devyte added this to the 2.7.0 milestone Nov 15, 2019
@d-a-v
Copy link
Collaborator

d-a-v commented Nov 15, 2019

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

@gnu-emu
Copy link
Author

gnu-emu commented Nov 15, 2019

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 :)

@gnu-emu
Copy link
Author

gnu-emu commented Nov 15, 2019

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'].

@gnu-emu
Copy link
Author

gnu-emu commented Nov 15, 2019

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 :)

@d-a-v
Copy link
Collaborator

d-a-v commented Nov 15, 2019

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

gnu-emu added a commit to gnu-emu/arduino-esp8266littlefs-plugin that referenced this issue Nov 15, 2019
gnu-emu added a commit to gnu-emu/arduino-esp8266fs-plugin that referenced this issue Nov 15, 2019
@devyte devyte modified the milestones: 2.7.0, 2.6.2 Nov 16, 2019
@earlephilhower
Copy link
Collaborator

Closing as fixed w/#6788

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants