<div dir="ltr"><div>We've just been polishing this process in the last couple of weeks.</div><div><br></div><div>You just need to ask for a serial-port plug in your snap.</div><div><br></div><div>There's a step missing for that to work well, but that's on our end. We need to expose serial-port slots in the gadget or core for serial-port-0 (S0) and serial-port-1 (S1) if those are available. In the near future, these slots will show up automatically based on hotplug support.</div><div><br></div><div>Then, you can run something like:</div><div><br></div><div>snap connect yoursnap:serial-port ubuntu-core:serial-port-1 </div><div><br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 7, 2016 at 8:29 PM, Enrique Hernández Bello <span dir="ltr"><<a href="mailto:ehbello@gmail.com" target="_blank">ehbello@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
taking advantage of this thread, what is the right way to grant access<br>
of a /dev/ttyS0 to our snap in Ubuntu Core 16?<br>
<br>
Regards.<br>
<div><div><br>
2016-09-07 15:26 GMT+01:00 Simon Fels <<a href="mailto:simon.fels@canonical.com" target="_blank">simon.fels@canonical.com</a>>:<br>
> On 07.09.2016 15:05, Loïc Minier wrote:<br>
>> Hi,<br>
>><br>
>> You need to use:<br>
>><br>
>> plugs: [serial-port]<br>
>><br>
>> In your snapcraft.yaml; then you also have to connect your snap to that<br>
>> interface manually as it's not autoconnected; check "snap interfaces" to<br>
>> see which plugs and slots are connected.<br>
><br>
> That doesn't work anymore. There is no implicit slot for serial-port.<br>
> Right now the only option to get access to serial ports is via defining<br>
> a slot on a gadget snap with either a USB product/vendor id pair or a<br>
> absolute path to the serial node which then the snap can connect to and<br>
> it will only get access to that particular serial port.<br>
><br>
> You can put something like<br>
><br>
> slots:<br>
> my-usb-serial-device:<br>
> interface: serial-port<br>
> product-id: 0x0<br>
> vendor-id: 0x0<br>
><br>
> into your gadget snap and then connect both the snap and gadget together<br>
> so your app gets access to that serial node.<br>
><br>
> In a system where no gadget exists you currently don't get access to<br>
> serial nodes. We need to implement hotplut support to make this slots<br>
> automatically exported for those devices. Not sure for when this is on<br>
> the list.<br>
><br>
> regards,<br>
> Simon<br>
><br>
>><br>
>><br>
>> On Wed, Sep 7, 2016 at 4:00 PM, Jenny Murphy <<a href="mailto:jenny.murphy@episensor.com" target="_blank">jenny.murphy@episensor.com</a><br>
>> <mailto:<a href="mailto:jenny.murphy@episensor.com" target="_blank">jenny.murphy@episensor<wbr>.com</a>>> wrote:<br>
>><br>
>> Hi,<br>
>> I solved the previous issue regarding the use of the RXTX java<br>
>> library and the application is loading and running without errors.<br>
>> However my java code isn't detecting the port, it should be able to<br>
>> see /dev/ttyUSB0.<br>
>><br>
>> In the dmesg log I see the following errors :<br>
>><br>
>> [101043.875139] usb 1-2: new full-speed USB device number 7 using<br>
>> xhci_hcd<br>
>> [101044.006418] usb 1-2: New USB device found, idVendor=10c4,<br>
>> idProduct=ea60<br>
>> [101044.006441] usb 1-2: New USB device strings: Mfr=1, Product=2,<br>
>> SerialNumber=3<br>
>> [101044.006456] usb 1-2: Product: CP2102 USB to UART Bridge Controller<br>
>> [101044.006470] usb 1-2: Manufacturer: Silicon Labs<br>
>> [101044.006482] usb 1-2: SerialNumber: 0001<br>
>> [101044.011589] cp210x 1-2:1.0: cp210x converter detected<br>
>> [101044.012037] usb 1-2: cp210x converter now attached to ttyUSB0<br>
>><br>
>> [101098.191960] audit_printk_skb: 258 callbacks suppressed<br>
>><br>
>> [101098.191979] audit: type=1400 audit(1473254849.416:69078):<br>
>> apparmor="DENIED" operation="open"<br>
>> profile="gateway.sideload_mai<wbr>n_IdNRFcRcGPGe" name="/dev/ttyUSB0"<br>
>> pid=4875 comm="java" requested_mask="wr" denied_mask="wr" fsuid=0 ouid=0<br>
>><br>
>><br>
>> Is there anyway to solve this. I am working on a Ubuntu 15.04 platform.<br>
>><br>
>> Thanks again.<br>
>><br>
>> --<br>
>> *Jenny Murphy*<br>
>> *EpiSensor, Georges Quay House, Georges Quay, Limerick, Ireland*<br>
>> <a href="mailto:jenny.murphy@episensor.com" target="_blank">jenny.murphy@episensor.com</a> <mailto:<a href="mailto:jenny.murphy@episensor.com" target="_blank">jenny.murphy@episensor<wbr>.com</a>> t |<br>
>> <a href="tel:%2B353%20%280%29%2061%20512%20511" value="+35361512511" target="_blank">+353 (0) 61 512 511</a> <tel:%2B353%20%280%29%2061%205<wbr>12%20511> w |<br>
>> <a href="http://www.episensor.com" rel="noreferrer" target="_blank">http://www.episensor.com</a> <<a href="http://www.episensor.com/" rel="noreferrer" target="_blank">http://www.episensor.com/</a>><br>
>><br>
>> --<br>
>> Snapcraft mailing list<br>
>> <a href="mailto:Snapcraft@lists.snapcraft.io" target="_blank">Snapcraft@lists.snapcraft.io</a> <mailto:<a href="mailto:Snapcraft@lists.snapcraft.io" target="_blank">Snapcraft@lists.snapcr<wbr>aft.io</a>><br>
>> Modify settings or unsubscribe at:<br>
>> <a href="https://lists.ubuntu.com/mailman/listinfo/snapcraft" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mail<wbr>man/listinfo/snapcraft</a><br>
>> <<a href="https://lists.ubuntu.com/mailman/listinfo/snapcraft" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mai<wbr>lman/listinfo/snapcraft</a>><br>
>><br>
>><br>
>><br>
>><br>
>> --<br>
>> - Loïc<br>
>><br>
>><br>
><br>
><br>
> --<br>
> Snapcraft mailing list<br>
> <a href="mailto:Snapcraft@lists.snapcraft.io" target="_blank">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/mailm<wbr>an/listinfo/snapcraft</a><br>
<br>
--<br>
Snapcraft mailing list<br>
<a href="mailto:Snapcraft@lists.snapcraft.io" target="_blank">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/mailm<wbr>an/listinfo/snapcraft</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">gustavo @ <a href="http://niemeyer.net" target="_blank">http://niemeyer.net</a></div>
</div></div>