Serial Port Plug/Interface issue with Ubuntu-core 16.04 (#2557)

Mritunjai Singh mrsingh at
Tue Jan 17 21:06:46 UTC 2017

Can anyone please guide me how to start writing gadget snap which gives me access to serial port interface on my Raspberry Pi board and x86_64 ubuntu machine.


From: Mritunjai Singh
Sent: Thursday, January 12, 2017 10:06 AM
To: 'Snapcraft' <snapcraft at>
Subject: RE: Serial Port Plug/Interface issue with Ubuntu-core 16.04 (#2557)

@Simon Fels, thanks for the pointer. It would be great if you can further guide me writing the gadget snap. I have a Ubuntu x86_64 machine(VM) to which I will be connecting our RF Mesh network card through USB. The network card connects over serial and exposes a /dev/ttys0 port to work with. So do I need to write gadget snap for my network card or for my Ubuntu machine on which I have already installed snapcraft.

Please guide and do let me know should you require any further information.


From: snapcraft-bounces at<mailto:snapcraft-bounces at> [mailto:snapcraft-bounces at] On Behalf Of Simon Fels
Sent: Thursday, January 12, 2017 12:58 AM
To: Snapcraft <snapcraft at<mailto:snapcraft at>>
Subject: Re: Serial Port Plug/Interface issue with Ubuntu-core 16.04 (#2557)

You can add a serial port slot to a gadget snap.yaml like this:

  interface: serial-port
  path: /dev/ttyS4

This only applies to static serial port nodes. If you have one provided by an USB device you have to user a slightly different slot definition which refers the USB product/vendor id of your USB device:

  interface: serial-port
  usb-product: 0x1111
  usb-vendor: 0x2222
  path: /dev/my-usb-serial-port

With the path attribute you can select a static path for the serial port node which your snap then gets access to once you connected the plug and the slot. The path needs to start with /dev/ and afterwards you're free to select a free node name. Internally the interface implementation will link the right /dev/ttyUSB* node to the specified path.

Please note that you can define such a slot only on a gadget snap! So if you don't have your own gadget snap today, you need to create one for your device in order to get access to the serial port.

I hope that helps.


On Wed, Jan 11, 2017 at 7:37 PM, Oliver Grawert <ogra at<mailto:ogra at>> wrote:
Am Mittwoch, den 11.01.2017, 17:59 +0000 schrieb Mritunjai Singh:
> Hi All,
> Kindly refer to:
> We are trying to get a head start on Core Snappy working with our RF
> Mesh network card. It connects over serial and needs to be available
> at boot. We first tried this using snap approach but due to missing
> hotplugging serial-interface in current(latest) version of snapcraft,
> serial i/o requests are being denied even if the snap has the
> permission to use serial port.
> We have been suggested the gadget snap approach in order to expose
> /dev/ttyS0 to the serial port interface for tunnccd snap to access
> it. It would be very helpful if someone can point me to the working
> example of a gadget snap with access to serial interface or any end
> to end gadget snap example and its build steps.

note that all our gadgets offer a console on serial by default, if you
drive some external device via serial you might want to drop this
console tty option.

all our official gadgets are under ..
namely the pi2-gadget, pi3-gadget, pc-gadget and dragonboard-gadget
sub-trees if you want to take a look ...

Snapcraft mailing list
Snapcraft at<mailto:Snapcraft at>
Modify settings or unsubscribe at:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Snapcraft mailing list