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

ArduinoUploadAndSerial: screen: device or resource busy #52

Open
elig0n opened this issue Aug 30, 2022 · 4 comments
Open

ArduinoUploadAndSerial: screen: device or resource busy #52

elig0n opened this issue Aug 30, 2022 · 4 comments

Comments

@elig0n
Copy link
Contributor

elig0n commented Aug 30, 2022

When running :ArduinoUploadAndSerial screen's terminal window will open concurrently with the compile&upload terminal window but arduino cannot upload a sketch when the device is open and so prints this:

  File ".../.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/pyserial/serial/serialposix.py", line 325, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 16] could not open port /dev/ttyUSB0: [Errno 16] Device or resource busy: '/dev/ttyUSB0'
Error during Upload: Failed uploading: uploading error: exit status 1

System information

  • OS: linux
  • Vim: vim
  • Arduino: 1.8.19
  • CLI version: 0.24.0
@elig0n elig0n changed the title screen: device or resource busy ArduinoUploadAndSerial: screen: device or resource busy Aug 30, 2022
@stevearc
Copy link
Owner

stevearc commented Sep 1, 2022

Ah, yeah this is because originally the commands were run with the simple :!cmd method, which runs synchronously so the upload comes before the serial. Now that we're using :terminal! for most things, the experience is better for everything except that the upload command doesn't block so the two get run at the same time.

The idea of writing more vimscript to cleanly block until complete on either vim or neovim is about as appealing as walking over broken glass. I'd be willing to review a PR for this, but I'm not likely to spend much time myself on supporting vimscript plugins anymore.

@Paxxous
Copy link

Paxxous commented Nov 20, 2022

Having the same issue, is there any fix for this?

@stevearc
Copy link
Owner

Nope. PRs welcome :)

@Paxxous
Copy link

Paxxous commented Nov 20, 2022

I've found a fix, I'm using lsof to find the processes running under the device directory. Then I use the kill command to kill the running process, (this isn't a permanent fix, also make sure to have sudo privileges when using finding and killing the process).

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

3 participants