Unable to drive Arduino over USB from Arduino IDE snap

Bug #1606674 reported by Michael Hall on 2016-07-26
This bug affects 8 people
Affects Status Importance Assigned to Milestone

Bug Description

I am making a snap package of the Arduino IDE, which connects to an Adruino board over USB. However, it is unable to access the board, even in devmode.

When trying to upload the script to the device, it outputs the following error:

avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied
ioctl("TIOCMGET"): Inappropriate ioctl for device

jdstrand suggested that I should use the serial-port interface, but "snap interfaces" doesn't list any such interface.

Michael Hall (mhall119) wrote :

Attached is the output from `snappy-debug.security scanlog arduino`

Michael Hall (mhall119) wrote :

Arduino IDE requires that your user be part of the "dialout" group in order to connect to an Arduino device over USB. After adding myself to this group, I can now access the device from the snap when it is running in --devmode.

It still needs something more in order to access the device without --devmode

Michael Hall (mhall119) wrote :

Attached is a new snappy-debug.security log, after adding my user to the dialout group

Jamie Strandboge (jdstrand) wrote :

Assigning zyga for now since he implemented the interface.

Zygmunt, serial-port is an interface, but it looks like it was designed for either the gadget snap or core snap to populate the devices that are exposed for connecting snaps to then 'plugs', but the core snap is not currently doing this. I'm also not sure how that would work on classic. IIRC, this was all blocked on hooks that have recently landed. Can you comment on how serial-port is supposed to work? Thanks!

Changed in snappy:
assignee: nobody → Zygmunt Krynicki (zyga)
importance: Undecided → High
status: New → Confirmed
Zygmunt Krynicki (zyga) wrote :

That is exactly right Jamie. Snapd has no mechanis to detect or track dynamically attached devices like USB-serial port adapters built into Arduino boards. The serial port is a proper interface but with the current limitations in snapd you cannot create dynamic instances of that interface (slots) in response to dynamically changing hardware.

I can offer an alternatives, an new interface e.g. "all-serial-ports" could just expose all serial ports on the system. Over time, as we teach snapd about device changes, we could do other things but then it would be somewhat better to integrate that into the arduino IDE (so that it is aware about connections to dynamically allocated devices) just so that the user interface and user experience is better suited to what is happening.

Jamie Strandboge (jdstrand) wrote :

Ok, thanks!

So, I wonder if rather than adding "all-serial-ports" we instead add an attribute to 'serial-port' that specifies all. The OS snap could then expose this for plugging snaps and add security policy for all serial ports on connect. Then in the future we only deprecate the attribute.

Jamie Strandboge (jdstrand) wrote :

Note that the core snap still doesn't add implicit slots for plugged in devices, but the raw-usb interface has been introduced to allow accessing all USB devices while this is in development.

Changed in snappy:
status: Confirmed → Triaged
tags: added: isv
Kyle Fazzari (kyrofa) wrote :

@Jamie, raw-usb doesn't seem to cover /dev/ttyUSB* and the like, which is what I'm looking for.

affects: snappy → snapd

For reference this bug has been discussed in the following forum thread.


summary: - Unable to drive Adruino over USB from Arduino IDE snap
+ Unable to drive Arduino over USB from Arduino IDE snap
Zygmunt Krynicki (zyga) on 2018-11-29
Changed in snapd:
assignee: Zygmunt Krynicki (zyga) → nobody
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers