Unable to drive Arduino over USB from Arduino IDE snap

Bug #1606674 reported by Michael Hall
38
This bug affects 8 people
Affects Status Importance Assigned to Milestone
snapd
Triaged
Low
Unassigned

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.

Revision history for this message
Michael Hall (mhall119) wrote :

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

Revision history for this message
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

Revision history for this message
Michael Hall (mhall119) wrote :

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

Revision history for this message
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
Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
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
Revision history for this message
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
Revision history for this message
Alan Pope 🍺🐧🐱 🦄 (popey) wrote :

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

https://forum.snapcraft.io/t/what-priority-of-hotplug-support-getting/345

summary: - Unable to drive Adruino over USB from Arduino IDE snap
+ Unable to drive Arduino over USB from Arduino IDE snap
Zygmunt Krynicki (zyga)
Changed in snapd:
assignee: Zygmunt Krynicki (zyga) → nobody
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I'm demoting this to low. We don't have the time to focus on this now and having loads of "high priority" bugs means we cannot effectively prioritize fixes.

Changed in snapd:
importance: High → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.