Not able to use serial-port interfaces

Last time I did this, snapd silently enforced a specific pattern on the path parameter there, and you’re not matching it. Perhaps that’s related? More details in this post.

1 Like

well, the serial port in that other post is a usb dongle which will actually generate a udev rule and a new device node … using an existing serial device from the gadget like above should work via /dev/ttyS1 …

@ogra: Thanks for your response. Please find my responses for your queries.

I added the new slot in gadget snap. Yeah it was added in snapcraft.yaml.
Please find below snippet of added text:

slots:
olimex-serial:
interface: serial-port
path: /dev/ttyS1

Yes I am able to see olimex-serial in snap interfaces and I have connected [serial-port] plug to it using “snap connect” command.

===================================================
:tpm -
:uhid -
olimex-a20-olinuxino-lime2:olimex-serial ssniotr:serial-port

From syslog output I am again getting below messages. I am curious to know whether this error is acceptable or I have made mistake somewhere.

===================================================================================
2017-08-08T06:11:28Z ERROR cannot deliver device serial request: Cannot process serial request for device with brand “JBnNNIwM0UkIctEoX5NQZYvef4rFeUc2”, store can sign serial only for brand "canonical"

This error is from snapd trying to generate a serial number for your device (which it only does for canonical-blessed images), the text should probably say something like:

“Cannot process serial number request…”

…to make the message more clear, it is not related to your interface at all.

@niemeyer or @pedronis could we change this string a little, this is not the first time this confusion happens.

@ogra: Thanks for clarification.

we plan to make it go away actually, you will always get a serial, although for a full commercial setup with a brand store will recommend a vault anyway

2 Likes

Is this problem is solved? ,I also have same problem on connecting serial port? If solved advise me to solve this…

if you read the thread above carefully, it was obviously working (the OP did mis-take the serial number generation as being related to the serial interface, which it is not).

does your gadget snap have the proper interface definition and did you connect your application snap interface to the gadget snap interface ?

@ ogra
I don’t know about the gadget.yaml. can you please tell me how to create the gadget for serial-port interface.
I create the snapcraft.yaml file with the serial-port interface and slots with 4 serial port.
Now what I need to do for create gadget. Can you please explaine this?

serial interfaces are not provided by the core snap but need to be defined in a gadget snap for your UbuntuCore installation (i do not know how you would do it on a classic install but i think there is a way to create a “fake gadget” for classic, perhaps @kyrofa can point something out here) gadget snaps are described in the doc section of this forum:

@ogra
I will try this and let you know the result…

@ogra
Hi ogra,
I am using Ubuntu 16.04 LTS System. Is it possible to use serial-port interface in my Ubuntu 16.04 LTS System??.

I am not aware of “fake gadgets” for classic. As far as I am aware, serial ports cannot be used on classic Ubuntu from strict confinement.

2 Likes

oh, right, i think i mixed up model assertions and gadgets (iirc there was some kind of “fake assertion” used for seeding snaps in classic images in 18.04)

@kyrofa

Is there any way to use serial port in classic System?
can i use confinement devmode for serial-port?

@Siva you cannot use the serial-port interface on a classic system yet. Your entire snap must be in devmode for this to work.

@zyga-snapd

Okay, thanks…

@kyrofa @ogra we support gadgets on classic as such, but they cannot be added after the fact, you need your own full image with model and everything (also there is no generally available tooling to make one those ATM, it is manual)

1 Like

AIUI, the work for dynamic slots (part of what is needed for this) is now towards the top of roadmap list. I’m not working on this (though I suspect I’ll be asked to review :slight_smile: ) and don’t think it is in 2.33. But perhaps within the next couple releases after that (@niemeyer and/or @mvo could comment on the exact timelines).

Hi Guys,

I have the java application to list the serial ports in the system. it’s work fine in Ubuntu 16.04 System. Then I created the snap of the same project as per the snapcraft instruction, after install the snap in my Ubuntu 16.4 LTS system , its not list the serial ports. throwing the below error.

“check_group_uucp(): error testing lock file creation Error details:Permission deniedcheck_lock_status: No permission to create lock file.”

Note : We are using RXTXcomm.jar and librxtxSerial.so to run the java application.
Please help me to solve this… I tried lot but didn’t get the result…