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
Serial device not added correctly
#1
Is there a bug in the Serial app?

See threads:

https://forum.openmarine.net/showthread.php?tid=4645
https://forum.openmarine.net/showthread.php?tid=4640
https://forum.openmarine.net/showthread....9#pid26449

Pi 4
64 bit OS (also present in 32 bit systems)
Openplotter 3.2.0 all latest updates added
M.2 SSD storage device

I plug in a serial device to carry nmea data into SignalK, it is recognised as /dev/ttyUSB0 and I assign it the Alias /dev/ttyOP_nmeain and click apply in the Serial app.

I go to connections, select the device and click Auto to add.

SignalK shows the message .....cannot open/dev/ttyOP_nmeain

If I do a 

Code:
ls -ahl /dev/ | grep ttyOP

I see no output.

If I add a symlink

Code:
sudo ln -s /dev/ttyUSB0 /dev/ttyOP_nmeain


Then restart signalK there is no error message and I can see all my data.

The problem is that the symlink is not persistent but that should be fixable.

Although the symlink disappears over reboot and I can't use the device, my openplotter.conf still has the line:

Code:
[UDEV]
serialinst = {'ttyOP_nmeain': {'device': 'ttyUSB0', 'vendor': '0x1106', 'product': '0x3483', 'port': '1-1.4:1.0', 'serial': '', 'remember': 'dev', 'data': 'NMEA 0183', 'moreInfo': 'VL805 USB 3.0 Host Controller VIA Technologies, Inc.'}}


Attached Files Image(s)
                   
Reply
#2
Interestingly if when setting up the port I set it to "Remember port (position on the USB-hub)" it works fine even across a reboot. The symlink is created and the connection to signalk works perfectly.

It is only if I select "Remember device (by vendor, product, serial)" that it fails.


Attached Files Image(s)
   
Reply
#3
I think the problem is with the USB vendor/product data etc.

If i plug my nmea USB device into a Pi3 I in Serial, the Vendor and Product codes of 0403 and 6001 which matches what is shown with the lsusb command.

If I plug the same USB device into my Pi4 I see Vendor and Product codes of 0x1106 and 0x3483 BUT lsusb shows the correct codes of 0403 and 6001

Openplotter is picking up the attributes of the Pi's Via VL805 USB host controller instead of the USB device I am attaching.


Attached Files Image(s)
       
Reply
#4
In debug mode I ran openplotter-serial and went through the process of adding the USB device.

Code:
$ openplotter-serial
wrong external apps format: unexpected EOF while parsing (<string>, line 0)
No module named 'openplotterSdrVhf'
No module named 'openplotterAvnav'
No module named 'openplotterNotifications'
No module named 'openplotterMaiana'
No module named 'openplotterIob'
No module named 'openplotterGpio'
No module named 'openplotterI2c'
No module named 'openplotterPypilot'
No module named 'openplotterNetwork.serialPorts'
No module named 'openplotterDashboards.serialPorts'
wrong external apps format: unexpected EOF while parsing (<string>, line 0)
No module named 'openplotterSdrVhf'
No module named 'openplotterAvnav'
No module named 'openplotterNotifications'
No module named 'openplotterMaiana'
No module named 'openplotterIob'
No module named 'openplotterGpio'
No module named 'openplotterI2c'
No module named 'openplotterPypilot'
No module named 'openplotterNetwork.serialPorts'
No module named 'openplotterDashboards.serialPorts'
wrong external apps format: unexpected EOF while parsing (<string>, line 0)
No module named 'openplotterSdrVhf'
No module named 'openplotterAvnav'
No module named 'openplotterNotifications'
No module named 'openplotterMaiana'
No module named 'openplotterIob'
No module named 'openplotterGpio'
No module named 'openplotterI2c'
No module named 'openplotterPypilot'
No module named 'openplotterNetwork.serialPorts'
No module named 'openplotterDashboards.serialPorts'
Warning: Stopping signalk.service, but it can still be activated by:
  signalk.socket
wrong external apps format: unexpected EOF while parsing (<string>, line 0)
No module named 'openplotterSdrVhf'
No module named 'openplotterAvnav'
No module named 'openplotterNotifications'
No module named 'openplotterMaiana'
No module named 'openplotterIob'
No module named 'openplotterGpio'
No module named 'openplotterI2c'
No module named 'openplotterPypilot'
No module named 'openplotterNetwork.serialPorts'
No module named 'openplotterDashboards.serialPorts'
Reply
#5
I think the problem is due to the latest available version of udev.

If I download the latest OPv3 image and make a brand new build, then before updating it further I do this:

Code:
sudo apt update
Code:
sudo apt list --upgradeable | grep udev

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libudev1/stable 247.3-7+deb11u2 arm64 [upgradable from: 247.3-7]
udev/stable 247.3-7+deb11u2 arm64 [upgradable from: 247.3-7]

I prevent the update from happening by doing:

Code:
sudo apt-mark hold udev libudev1
udev set on hold.
libudev1 set on hold.

Note above the numeral 1 at the end of libudev1

Then go through a couple of cycles of sudo apt upgrade to bring all packages up to date and everything works as it should. I was able to add the serial cable exactly as it should work. so it looks like the +deb11u2 updates to udev and libudev1 are a problem.

As a test I have downgraded udev/libudev1 to version 247.3-7 and it works perfectly, correct operation is restored.
Reply
#6
I've seen a similar issue. Previously all my USB devices had separate Vendor and Product ID's, but it changed some time recently. Now they are all given the same ID's, and I have to use "remember port" in order to distinguish them.
Reply
#7
(2023-06-06, 06:48 PM)TVR Wrote: I've seen a similar issue. Previously all my USB devices had separate Vendor and Product ID's, but it changed some time recently. Now they are all given the same ID's, and I have to use "remember port" in order to distinguish them.

Clearly a problem then.

What is your setup? Pi 3/4? OPv2/3? 64/32bit?

If you enter the following into a terminal window what do you see?

Code:
apt list udev


I am sure the version of udev/libudev1 messed this up.
Reply
#8
Hi
just a great debug !

I faced the same issue. rpi4 and a gps hat that i have to connect with usb
I did a setup with openplotter 3 headless before upgrade, all was ok
I did a fresh install of OP3 , did the full upgrade (OS , applications etc) and I was not able to see gps data.

just changed to "remember port" and it worked.

notice tthat when i did in this order
headless fresh install - configure gps usb - upgrade all. I had a message about a lib not upgradable (sorry lost the message) during upgrade/update but it was working
Reply
#9
(2023-06-14, 08:50 PM)gildas declercq Wrote: Hi
just a great debug !

I faced the same issue. rpi4 and a gps hat that i have to connect with usb
I did a setup with openplotter 3 headless before upgrade, all was ok
I did a fresh install of OP3 , did the full upgrade (OS , applications etc) and I was not able to see gps data.

just changed to "remember port" and it worked.

notice tthat when i did in this order
headless fresh install -  configure gps usb -  upgrade all.  I had a message about a lib not upgradable (sorry lost the message) during upgrade/update but it was working

Glad it works for you!
Reply
#10
(2023-06-15, 06:05 AM)baltika_no_9 Wrote:
(2023-06-14, 08:50 PM)gildas declercq Wrote: Hi
just a great debug !

I faced the same issue. rpi4 and a gps hat that i have to connect with usb
I did a setup with openplotter 3 headless before upgrade, all was ok
I did a fresh install of OP3 , did the full upgrade (OS , applications etc) and I was not able to see gps data.

just changed to "remember port" and it worked.

notice tthat when i did in this order
headless fresh install -  configure gps usb -  upgrade all.  I had a message about a lib not upgradable (sorry lost the message) during upgrade/update but it was working

Glad it works for you!

Hello Baltica, Hello all
We had exchanges on that subject a few months ago.
I still have the same problem, no alias created, and remake the conf  with "remember port" is not sufficient.
Maybe it's due to my GPS. I add below some infos
About udev:
pi@openplotter:~ $ apt list udev
En train de lister... Fait
udev/oldstable,now 241-7~deb10u9+rpi1 armhf  [installé]
pi@openplotter:~ $
About GPS
pi@openplotter:~ $ lsusb
Bus 001 Device 006: ID 1546:01a8 U-Blox AG [u-blox 8]

with dmesg
[    4.656784] usb 1-1.3: New USB device found, idVendor=1546, idProduct=01a8, bcdDevice= 3.01
[    4.656811] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    4.656826] usb 1-1.3: Product: u-blox GNSS receiver
[    4.656841] usb 1-1.3: Manufacturer: u-blox AG - www.u-blox.com

Note that the GPS is seen ad device ttyACM0

Regards

Oups, forget to say RPI3B+, OP3, OCPN 5.8.2
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)