<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.EmailStyle18
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle20
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">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.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Mritunjai<o:p></o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></a></p>
<span style="mso-bookmark:_MailEndCompose"></span>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Mritunjai Singh
<br>
<b>Sent:</b> Thursday, January 12, 2017 10:06 AM<br>
<b>To:</b> 'Snapcraft' <snapcraft@lists.snapcraft.io><br>
<b>Subject:</b> RE: Serial Port Plug/Interface issue with Ubuntu-core 16.04 (#2557)<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">@Simon Fels</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">, 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.
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Please guide and do let me know should you require any further information.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Mritunjai <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">
<a href="mailto:snapcraft-bounces@lists.snapcraft.io">snapcraft-bounces@lists.snapcraft.io</a> [<a href="mailto:snapcraft-bounces@lists.snapcraft.io">mailto:snapcraft-bounces@lists.snapcraft.io</a>]
<b>On Behalf Of </b>Simon Fels<br>
<b>Sent:</b> Thursday, January 12, 2017 12:58 AM<br>
<b>To:</b> Snapcraft <<a href="mailto:snapcraft@lists.snapcraft.io">snapcraft@lists.snapcraft.io</a>><br>
<b>Subject:</b> Re: Serial Port Plug/Interface issue with Ubuntu-core 16.04 (#2557)<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">You can add a serial port slot to a gadget snap.yaml like this:<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">ttyS4:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> interface: serial-port<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> path: /dev/ttyS4<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">my-usb-serial:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> interface: serial-port<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> usb-product: 0x1111<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> usb-vendor: 0x2222<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> path: /dev/my-usb-serial-port<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">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.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I hope that helps.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">regards,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Simon<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Wed, Jan 11, 2017 at 7:37 PM, Oliver Grawert <<a href="mailto:ogra@ubuntu.com" target="_blank">ogra@ubuntu.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<p class="MsoNormal" style="margin-bottom:12.0pt">hi,<br>
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" target="_blank">
https://github.com/snapcore/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>
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/" target="_blank">https://github.com/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" target="_blank">
https://lists.ubuntu.com/mailman/listinfo/snapcraft</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>