<div dir="ltr">You can add a serial port slot to a gadget snap.yaml like this:<div><br></div><div>ttyS4:</div><div>  interface: serial-port</div><div>  path: /dev/ttyS4</div><div><br></div><div>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:</div><div><br></div><div>my-usb-serial:</div><div>  interface: serial-port</div><div>  usb-product: 0x1111</div><div>  usb-vendor: 0x2222</div><div>  path: /dev/my-usb-serial-port</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>I hope that helps.</div><div><br></div><div>regards,</div><div>Simon</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 11, 2017 at 7:37 PM, Oliver Grawert <span dir="ltr"><<a href="mailto:ogra@ubuntu.com" target="_blank">ogra@ubuntu.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">hi,<br>
<span class="">Am Mittwoch, den 11.01.2017, 17:59 +0000 schrieb Mritunjai Singh:<br>
> Hi All,<br>
>  <br>
> Kindly refer to: <a href="https://github.com/snapcore/snapd/issues/2557" rel="noreferrer" target="_blank">https://github.com/snapcore/<wbr>snapd/issues/2557</a><br>
>  <br>
> We are trying to get a head start on Core Snappy working with our RF<br>
> Mesh network card. It connects over serial and needs to be available<br>
> at boot. We first tried this using snap approach but due to missing<br>
> hotplugging serial-interface in current(latest) version of snapcraft,<br>
> serial i/o requests are being denied even if the snap has the<br>
> permission to use serial port.<br>
>  <br>
> We have been suggested the gadget snap approach in order to expose<br>
> /dev/ttyS0 to the serial port interface for tunnccd snap to access<br>
> it. It would be very helpful if someone can point me to the working<br>
> example of a gadget snap with access to serial interface or any end<br>
> to end gadget snap example and its build steps.<br>
<br>
</span>note that all our gadgets offer a console on serial by default, if you<br>
drive some external device via serial you might want to drop this<br>
console tty option. <br>
<br>
all our official gadgets are under <a href="https://github.com/snapcore/" rel="noreferrer" target="_blank">https://github.com/<wbr>snapcore/</a> ..<br>
namely the pi2-gadget, pi3-gadget, pc-gadget and dragonboard-gadget<br>
sub-trees if you want to take a look ...<br>
<br>
ciao<br>
        oli<br>--<br>
Snapcraft mailing list<br>
<a href="mailto:Snapcraft@lists.snapcraft.io">Snapcraft@lists.snapcraft.io</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/snapcraft" rel="noreferrer" target="_blank">https://lists.ubuntu.com/<wbr>mailman/listinfo/snapcraft</a><br>
<br></blockquote></div><br></div>