-
-
Notifications
You must be signed in to change notification settings - Fork 398
Error detecting boards #1543
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
Comments
Hi @evanmoring. Thanks for your report. We don't provide support specific to the Snap installation of Arduino CLI. Please try latest nightly official build of Arduino CLI and then comment here to let us know whether the same problem still occurs. Download links are here: The nightly build won't affect your Snap installation at all, so you are welcome to continue to use the Snap installed version of Arduino CLI for your regular usage. |
Thanks for the quick response, I will give that a try.
Best,
Evan
…On Wed, Nov 10, 2021 at 4:45 PM per1234 ***@***.***> wrote:
I installed using sudo snap install arduino-cli
Hi @evanmoring <https://github.com/evanmoring>. Thanks for your report.
We don't provide support specific to the Snap installation of Arduino CLI.
Please try latest nightly official build of Arduino CLI and then comment
here to let us know whether the same problem still occurs.
Download links are here:
https://arduino.github.io/arduino-cli/latest/installation/#nightly-builds
The nightly build won't affect your Snap installation at all, so you are
welcome to continue to use the Snap installed version of Arduino CLI for
your regular usage.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1543 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANCEY627WLHWNQZFSL7VJI3ULMGZPANCNFSM5HXFKIPA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
There is a report of a similar error, this time using the official Arduino CLI:
|
I'm have the same issure. Using ardiono-cli in Ubuntu 20.04.3. I get the same error when I ry to arduino-cli board list. |
Fixed. Try adding tty and dialout group to your user. |
@karthikeyan-krish's solution did not fix it for me :-(
Calling I have installed arduino-cli via snap on Ubuntu 21.04. |
@frederikheld can you try using an Download links to latest version are here: https://arduino.github.io/arduino-cli/0.20/installation/#latest-release |
@silvanocerza: I tried with your installation method and it yielded exactly the same error. Some feedback about your recommended installation method:
That's why I prefer apt and snap ... |
Good to know.
No worries, you're free to install it using the method you prefer. Thanks for the test by the way. |
@evanmoring @karthikeyan-krish @frederikheld please try it again now and let us know whether you are still getting the error. The reason I'm thinking there is a possibility it was fixed since is because there is now a new release of the Arduino CLI 0.20.0 and later will automatically install and use |
Hi, i ve have encountered the same issue, but in my case it only happens when im offline, if im connected to internet the boards appear as expected but if i disconnect internet the command outputs: arduino-cli board list is this online dependency on porpoise? |
The I'll open another issue to track that, thanks for the report @Belamat. 🙏 |
Hello, I get the same error with
Is this to discover board with OTA ? I have 3 on my LAN and they ping. Just downloaded the latest release from here and I get the same error:
Best regards |
I'm having a similar error.
I'm connected to the internet and have no connection problem. Is there a workaround to this while this is resolved upstream? I have no way to upload sketches to my boards if I can't list the connected boards I think. |
Also, possibly naive question: why does |
The The first one is used to find boards connected physically to your computer, while the second is used to find boards connected to the same network your computer is connected to. When it works correctly and there is a board connected in the network it looks like this. Notice the
Run the command with the You have a different issues from the one reported since you can correctly run the discoveries, the problem is that one returns an error. The issue you have is being tracked over here: arduino/mdns-discovery#24 I also created #1666 to make the Arduino CLI more resilient to this kind of failures. |
Linux XXXX 5.4.0-99-generic #112-Ubuntu I am also experiencing this issue. The error does not occur when there are no boards connected via usb. Plugging in an Arduino Nano and running 'arduino-cli board list' invokes the permission error. The IDE seems to address "/dev/ttyUSBX" directly, while the enumerator is attempting to work with the sysfs representation. It appears that the error message originates from a call to go.bug.st/serial.v1/enumerator.GetDetailedPortsList(), possibly at line 67 of board-discovery/serial.go. The enumerator package is listed as "beta"; is this an upstream bug? |
Follow up: portlist.go from both the master and v1 branch of the enumerator work properly: $ go run portlist.go |
@b-buckley |
@cmaglie - This may be a crazy question, maybe even heresy, but would you consider a Linux serial discovery written in C rather than Go and linked against libudev1? |
I have an unverified suspicion that somewhere the enumerator is attempting to write to a file under /sys/ or open one for writing or execution. Which noone, not even root, can do. That read-only permission is enforced at the kernel level because the files under /sys are representations of kernel space memory and not regular files. To demonstrate:
|
If I'm reading the below code snippet correctly and I understand the handling of sysfs files right, if https://github.com/bugst/go-serial/blob/v1.3.4/serial_unix.go, starting at line 204:
|
It's worth noting here that This is the source of my suspicion aimed at the use of the SYSFS |
@cmaglie - Here is a C-based serial discovery using libudev. https://github.com/PaulStoffregen/serial-discovery-linux All info comes from libudev APIs. Even if you rewrite it all in Go, maybe this can help as a template for a better way to do this on Linux? |
Thanks Paul, looking at the source code I think that libudev also do lookups inside the sysfs directory. Anyway, the really weird thing is that running |
@b-buckley are you running
if yes could you try to download from the official release?
|
Ok, maybe use of libudev is just the same. @b-buckley - any chance I could talk you into running my little libudev-based tool? Is it able to list the ports on your machine, or do you get some sort of error or just wrong results? To try it, just download here (only 2 files) and type "make" to compile and "./serial-discovery" to run. Once it's running, type "LIST" and press Enter to cause it to show JSON for the serial ports on your machine. If compiling gives an error about libudev.h missing, run "sudo apt-get install libudev-dev" to install the library header files. If it also doesn't work using only libudev to do all the work, that's probably a sign something may be wrong with your system. If it does work, maybe there'll be some clue buried inside libudev? |
I think it would also be helpful if @b-buckley runs the Arduino CLI builtin After you open it write I think this is really a Snap permissions issues. |
It seems that the snap version of the arduino-cli requires extra steps to allow it to access raw-usb and serial ports: https://snapcraft.io/arduino-cli
and
|
And I can confirm that
BTW it seems that there is still no full access to the serial port, and running the following command:
so I'm stuck here now, BTW I think this issue should be moved to the snap maintainer now. |
I'm pretty sure whatever libudev is doing can list the serial ports successfully without changing permissions or groups. It even detects that /dev/ttyS0 is real hardware on my machine and the others are just placeholders, without having access to the actual device files. Sorry if I'm being annoying with this libudev stuff. Unless there is interest expressed, I promise this will be my last message on the topic. Just wanted to help. If anyone wants to explore, feel free to use the code I published. |
The question is: how can we test the libudev-based discovery under the same condition (I mean wrapped inside the constrained snap environment) |
Maybe like this?
|
No worries, your track record of contribution shows that when you say something is because you have reasons to do so :-). I've chatted a bit with @manchoz (the snap version maintainer) and I found that
Another thing that I noticed is that this virtual container seems created "on-demand" on the first write attempt from So with this in mind I tried:
so far so good, but trying with the snap version:
so the libudev based discovery crashed as well. For now, I'll update the |
Oh, tried on a clean virtual machine. I believe this is the full set of commands to try the snap packaged arduino-cli.
|
Can confirm, libudev definitely can tell the difference between /dev/ttyS* real hardware vs placeholders, without permissions to use the devices. The key ingredient is traversing to parent devices with udev_device_get_parent() until one is found with subsystem "pnp" (real hardware) or "platform" (fake placeholder). In the C code, look at line 267 and line 281 for those checks. |
Looks like serial_unix.go may be actually opening the device to check if it is real. Maybe that could have a side effect of pulsing the DTR signal? |
thanks, I'll check these ones!
I don't know if non-USB serial ports behave differently WRT the DTR signal, but it could likely be as you say. |
Running
Does that confirm that this is a snap issue? |
Hi @b-buckley, yes it's definitely an issue of the arduino-cli packaged under snap, in particular, when In my tests, I see that Anyway, the snap package is not maintained by Arduino, so for now you have to contact the maintainer to fix the bug or use a standalone arduino-cli. |
Bug Report
Current behavior
The command
arduino-cli board list
Returns this:
Error detecting boards: Error getting board list: [listing ports from discovery builtin:serial-discovery: command failed: Error while enumerating serial ports: open /sys/devices/pci0000:00/0000:00:14.0/usb1/1-2/idVendor: permission denied]
I get the same error when I try to upload compiled code.
I checked the permissions on idVendor and they seem fine: -r--r--r-- 1 root root,
I can detect and upload sketches to the board from the arduino ide.
Expected behavior
I expected it to detect my board
Environment
arduino-cli alpha Version: 0.19.3 Commit: 12f1afc Date: 2021-10-12T10:15:19Z
Ubuntu 20.04
The board is an Arduino Uno R3, same thing happended with an UNO SMD R2
Additional context
I installed using
sudo snap install arduino-cli
The text was updated successfully, but these errors were encountered: