This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Signalk serial ports and discovered connections
#1
I'm close to getting my system set up how I want it, but i'm having an issue with connections in Signalk.

Each time I restart the Pi the serial ports change. 

In one session my CAN-USB might be at /dev/ttyUSB0 and my GPS might be /dev/ttyUSB1

If I restart the Pi, these might switch, Or even move to completely new ports like /dev/ttyUSB2

Is this normal expected behaviour? Is it possible to bind them to specific physical ports?

Secondly, the signalk server shows 'Discovered connections' in this case my Simrad NSS8. 

I can't seem to do anything with this discovered connection though. Should it be that you could click on it and set it to 'Enabled' or that it becomes automatically enabled? Mine does neither. 

If I have to add it manually (which I can do) what is point in the 'Discovered connections' 

Thanks in advance
Reply
#2
(2019-12-15, 05:42 PM)mikedeflieslife Wrote: I'm close to getting my system set up how I want it, but i'm having an issue with connections in Signalk.

Each time I restart the Pi the serial ports change. 

In one session my CAN-USB might be at /dev/ttyUSB0 and my GPS might be /dev/ttyUSB1

If I restart the Pi, these might switch, Or even move to completely new ports like /dev/ttyUSB2

Is this normal expected behaviour? Is it possible to bind them to specific physical ports?

Secondly, the signalk server shows 'Discovered connections' in this case my Simrad NSS8. 

I can't seem to do anything with this discovered connection though. Should it be that you could click on it and set it to 'Enabled' or that it becomes automatically enabled? Mine does neither. 

If I have to add it manually (which I can do) what is point in the 'Discovered connections' 

Thanks in advance
What Can-usb do you have ?. Mine here is Can0. Most of the time the usb switches problem is due to two conections at the same port. It takes one or the other one.
Reply
#3
(2019-12-15, 11:18 PM)verkerkbr Wrote:
(2019-12-15, 05:42 PM)mikedeflieslife Wrote: I'm close to getting my system set up how I want it, but i'm having an issue with connections in Signalk.

Each time I restart the Pi the serial ports change. 

In one session my CAN-USB might be at /dev/ttyUSB0 and my GPS might be /dev/ttyUSB1

If I restart the Pi, these might switch, Or even move to completely new ports like /dev/ttyUSB2

Is this normal expected behaviour? Is it possible to bind them to specific physical ports?

Secondly, the signalk server shows 'Discovered connections' in this case my Simrad NSS8. 

I can't seem to do anything with this discovered connection though. Should it be that you could click on it and set it to 'Enabled' or that it becomes automatically enabled? Mine does neither. 

If I have to add it manually (which I can do) what is point in the 'Discovered connections' 

Thanks in advance
What Can-usb do you have ?. Mine here is Can0. Most of the time the usb switches problem is due to two conections at the same port. It takes one or the other one.

I have one sold from here:
https://shop.sailoog.com/converters/1-is...stick.html

It's same one I've always used.
Reply
#4
you will need to write udev rules for usb to get the same address every time, until the serial app is released.

https://www.domoticz.com/wiki/Assign_fix...o_USB_port
Reply
#5
(2019-12-15, 05:42 PM)mikedeflieslife Wrote: I'm close to getting my system set up how I want it, but i'm having an issue with connections in Signalk.

Each time I restart the Pi the serial ports change. 

In one session my CAN-USB might be at /dev/ttyUSB0 and my GPS might be /dev/ttyUSB1

If I restart the Pi, these might switch, Or even move to completely new ports like /dev/ttyUSB2

Is this normal expected behaviour? Is it possible to bind them to specific physical ports?

Secondly, the signalk server shows 'Discovered connections' in this case my Simrad NSS8. 

I can't seem to do anything with this discovered connection though. Should it be that you could click on it and set it to 'Enabled' or that it becomes automatically enabled? Mine does neither. 

If I have to add it manually (which I can do) what is point in the 'Discovered connections' 

Thanks in advance

Yes, that is the expected linux behaviour with serial devices. As Jim said, you need to set some udev rules to fix this but using udev is not easy.

The good news is that I have just released openplotter-serial app and it will do all the job for you :Smile you can set an alias to your device and you have to use that alias when you want to configure your device in any program. Your device will be remembered by its serial number or even by its position in the USB connector or hub. You will be able to crete connections with other apps or programs like SK, CAN, GPSD, pypilot...
Reply
#6
(2019-12-16, 02:43 PM)jim321 Wrote: you will need to write udev rules for usb to get the same address every time, until the serial app is released.

Udev rules are not really needed nowadays, as Linux creates symlinks with persistent naming at /dev/serial/by-id. Just use the names found there. It is also easier to recognise which device is which with the more verbose names.
Reply
#7
This is an example of the udev rules we use to remember 2 devices. the first one is remebered by its position in the usb interface: "1-1.3:1.0"
And the second one by its vendor, product and serial id.

Code:
KERNEL=="ttyACM0*", KERNELS=="1-1.3:1.0",SYMLINK+="ttyOP_gps"
SUBSYSTEM=="tty", ATTRS{idVendor}=="10c4",ATTRS{idProduct}=="ea60",ATTRS{serial}=="0001",SYMLINK+="ttyOP_can"


You should use "/dev/ttyOP_gps" and "/dev/ttyOP_can" in Signal K.

   
Reply
#8
(2019-12-16, 08:39 PM)Sailoog Wrote: Yes, that is the expected linux behaviour with serial devices. As Jim said, you need to set some udev rules to fix this but using udev is not easy.

The good news is that I have just released openplotter-serial app and it will do all the job for you :Smile you can set an alias to your device and you have to use that alias when you want to configure your device in any program. Your device will be remembered by its serial number or even by its position in the USB connector or hub. You will be able to crete connections with other apps or programs like SK, CAN, GPSD, pypilot...


Interesting. Do you plan to write Signal K settings directly from openplotter-serial? Could you document what kind of structures you are creating on disk, maybe it would be worthwhile to support named serial connections directly in Signal K admin application.

(2019-12-15, 05:42 PM)mikedeflieslife Wrote: Secondly, the signalk server shows 'Discovered connections' in this case my Simrad NSS8. 

I can't seem to do anything with this discovered connection though. Should it be that you could click on it and set it to 'Enabled' or that it becomes automatically enabled? Mine does neither. 

That's the way they are supposed to work, but apparently they don't. Sorry about that, I'll try to look into it when I have some time.
Reply
#9
(2019-12-16, 09:11 PM)tkurki Wrote: Interesting. Do you plan to write Signal K settings directly from openplotter-serial? Could you document what kind of structures you are creating on disk, maybe it would be worthwhile to support named serial connections directly in Signal K admin application.

This time we did not want to manage SK connections from OP and we wanted to "force" users to use the SK admin page. But lot of people reported problems using the SK interface. It seems that those 2 fields to define the serial device are confusing, do not ask me why...
Finally we have chose an intermediate solution. You can choose between creating an auto connection (OP does it all) or a manual connection (you are redirected to the SK connections page). When you want to edit that connection from OP interface you are always redirected to the SK admin page. Hopefully this make easier to familiarize with the SK interface.

We are using this structure: "/dev/ttyOP_" + <alias>, example: /dev/ttyOP_gps. User defines the alias. You can see an udev example and an screenshot of the OP interface in my previous post.

Currently SK is not showing these symlinks. Would there be a way to show them?
Reply
#10
Sorry about not fixing that particular ui glitch.

Sure we can list the symlinks, this is code we can change.


Sent from my iPhone using Tapatalk
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)