Posts: 43
Threads: 9
Joined: May 2018
Reputation:
0
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
Posts: 327
Threads: 20
Joined: Apr 2016
Reputation:
10
(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.
Posts: 43
Threads: 9
Joined: May 2018
Reputation:
0
(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.
Posts: 799
Threads: 46
Joined: Jun 2017
Reputation:
25
2019-12-16, 02:43 PM
(This post was last modified: 2019-12-16, 02:47 PM by jim321.)
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
Posts: 2,885
Threads: 59
Joined: Mar 2016
Reputation:
277
(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 : 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...
Posts: 333
Threads: 5
Joined: Mar 2018
Reputation:
25
(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.
Posts: 2,885
Threads: 59
Joined: Mar 2016
Reputation:
277
2019-12-16, 09:06 PM
(This post was last modified: 2019-12-16, 09:10 PM by Sailoog.)
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.
Posts: 333
Threads: 5
Joined: Mar 2018
Reputation:
25
2019-12-16, 09:11 PM
(This post was last modified: 2019-12-16, 09:13 PM by tkurki.)
(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 : 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.
Posts: 2,885
Threads: 59
Joined: Mar 2016
Reputation:
277
(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?
Posts: 333
Threads: 5
Joined: Mar 2018
Reputation:
25
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
|