Skip to content
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.

Cannot select serial port, open serial port (VSCode, Arduino, Apple M1) #1232

Closed
khorbushko opened this issue Apr 15, 2021 · 12 comments
Closed
Labels
needs-more-info More details about this issue are needed for it to be actionable. serial Issues with serial ports stale

Comments

@khorbushko
Copy link

khorbushko commented Apr 15, 2021

Looks like the issue is can be reproduced on new M1 from Apple - can't select neither port neither open serial port (if manually write it in config). Upload works fine.

When clicked on "open port"button
1

Originally posted by @khorbushko in #1099 (comment)

@philffm
Copy link

philffm commented Apr 25, 2021

Second this. Tried to manually adjust the port in arduino.json file but it fails at opening the port 🤷🏽‍♂️

(M1 Mac here as well)

@khorbushko
Copy link
Author

for me, manual configuration in of arduino.jsonworks fine:

{
    "sketch": "serial.ino",
    "board": "arduino:avr:uno",
    "programmer": "arduino:usbasp",
    "port": "/dev/cu.usbmodem101"
}

To get serial port - u can use Arduino IDE or IOKit and Xcode

@philffm
Copy link

philffm commented Apr 25, 2021

Thanks for letting me know 👍

It still throws the following error

Failed to open serial port /dev/cu.usbserial-11430 due to error: + Error: dlopen(/Users/user/.vscode-insiders/extensions/vsciot-vscode.vscode-arduino-0.4.2/out/node_modules/usb-detection/build/Release/detection.node, 1): no suitable image found. Did find: /Users/user/.vscode-insiders/extensions/vsciot-vscode.vscode-arduino-0.4.2/out/node_modules/usb-detection/build/Release/detection.node: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00 /Users/user/.vscode-insiders/extensions/vsciot-vscode.vscode-arduino-0.4.2/out/node_modules/usb-detection/build/Release/detection.node: unknown file type, first eight bytes: 0x7F 0x45 0x4C 0x46 0x02 0x01 0x01 0x00

@khorbushko
Copy link
Author

yes, this is reproducible on my side as well, setting json config is just kind of workaround... neither port selection, neither connection to serial port works on my side. In same moment, in Arduino IDE everything works fine. I also created a small utility for Serial port scan and communication using IOKit - and it works just fine too. So it's looks like completely issue related to this extension.

@Yatheesha1
Copy link

for me also, manual configuration in of arduino.json works fine, but I am unable to open the serial.monitor in vscode

@robbiewu008
Copy link

The usb detection module's native binary is not for aarch64, is there one detection.node for aarch64, or can we compile one?

@robbiewu008
Copy link

After checked the upstream projects usb detection, still no official release for aarch64, I create one issue # MadLittleMods/node-usb-detection#141

@robbiewu008
Copy link

brew's node.js@16, NODE_MODULE_VERSION=93; brew's node.js@14, NODE_MODULE_VERSION=83; but the node.js embedded in vscode is NODE_MODULE_VERSION=87, so encounter new issues:

Failed to open serial port /dev/cu.usbserial-0001 due to error: + Error: The module '/Users/robbiewu/.vscode/extensions/vsciot-vscode.vscode-arduino-0.4.2/out/node_modules/usb-detection/build/Release/detection.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 93. This version of Node.js requires
NODE_MODULE_VERSION 87. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install).

Failed to open serial port /dev/cu.usbserial-0001 due to error: + Error: The module '/Users/robbiewu/.vscode/extensions/vsciot-vscode.vscode-arduino-0.4.2/out/node_modules/usb-detection/build/Release/detection.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 83. This version of Node.js requires
NODE_MODULE_VERSION 87. Please try re-compiling or re-installing
the module (for instance, using npm rebuild or npm install).

@robbiewu008
Copy link

After more debugging, the up-up stream project node-gyp's issue, I created one issue #nodejs/node-gyp#2391.

@benmcmorran benmcmorran added the serial Issues with serial ports label Jan 12, 2022
@gcampbell-msft
Copy link
Contributor

@khorbushko We have recently updated the Arduino extension to depend on a new standalone Serial Monitor extension, please upgrade your arduino extension and try out this new feature!

Let us know if it solves your issue or if the issue still persists!

@gcampbell-msft gcampbell-msft added the needs-more-info More details about this issue are needed for it to be actionable. label Feb 16, 2023
@github-actions
Copy link

This issue has been automatically marked as stale because it has been inactive for 30 days. To reactivate the issue, simply post a comment with the requested information to help us diagnose this issue. If this issue remains inactive for another 7 days, it will be automatically closed.

@github-actions github-actions bot added the stale label Mar 26, 2023
@github-actions
Copy link

github-actions bot commented Apr 2, 2023

This issue has been automatically closed due to inactivity. If you are still experiencing problems, please open a new issue.

@github-actions github-actions bot closed this as completed Apr 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs-more-info More details about this issue are needed for it to be actionable. serial Issues with serial ports stale
Projects
None yet
Development

No branches or pull requests

6 participants