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

Simon Fels simon.fels at canonical.com
Thu Jan 12 08:57:50 UTC 2017


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

ttyS4:
  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:

my-usb-serial:
  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.

regards,
Simon


On Wed, Jan 11, 2017 at 7:37 PM, Oliver Grawert <ogra at ubuntu.com> wrote:

> hi,
> Am Mittwoch, den 11.01.2017, 17:59 +0000 schrieb Mritunjai Singh:
> > Hi All,
> >
> > Kindly refer to: https://github.com/snapcore/snapd/issues/2557
> >
> > 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 https://github.com/snapcore/ ..
> namely the pi2-gadget, pi3-gadget, pc-gadget and dragonboard-gadget
> sub-trees if you want to take a look ...
>
> ciao
>         oli
> --
> Snapcraft mailing list
> Snapcraft at lists.snapcraft.io
> Modify settings or unsubscribe at: https://lists.ubuntu.com/
> mailman/listinfo/snapcraft
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/snapcraft/attachments/20170112/4e57f0b6/attachment.html>


More information about the Snapcraft mailing list