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
#51
All looks good to me, I can successfully remember devices by port and by serial.

I only have one device with no serial, so I've been unable to test what happens if you have 2 devices with the same ID and no serial, and try to remember them both by device ID.

Immediately after upgrade:
   

After deleting and reconfiguring the devices:
   

Device details (with serial number):
Code:
CURRENT_TAGS: :systemd:
DEVLINKS: /dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0 /dev/ttyOP_micronet
DEVNAME: /dev/ttyACM0
DEVPATH: /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.2/1-1.2:1.0/tty/ttyACM0
ID_BUS: pci
ID_MM_CANDIDATE: 1
ID_MODEL_FROM_DATABASE: VL805 USB 3.0 Host Controller
ID_MODEL_ID: 0x3483
ID_PATH: platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0
ID_PATH_TAG: platform-fd500000_pcie-pci-0000_01_00_0-usb-0_1_2_1_0
ID_PCI_CLASS_FROM_DATABASE: Serial bus controller
ID_PCI_INTERFACE_FROM_DATABASE: XHCI
ID_PCI_SUBCLASS_FROM_DATABASE: USB controller
ID_USB_DRIVER: cdc_acm
ID_USB_INTERFACES: :020201:0a0000:
ID_USB_INTERFACE_NUM: 00
ID_USB_MODEL: USB_Serial
ID_USB_MODEL_ENC: USB\x20Serial
ID_USB_MODEL_ID: 0483
ID_USB_REVISION: 0279
ID_USB_SERIAL: Teensyduino_USB_Serial_12306220
ID_USB_SERIAL_SHORT: 12306220
ID_USB_TYPE: generic
ID_USB_VENDOR: Teensyduino
ID_USB_VENDOR_ENC: Teensyduino
ID_USB_VENDOR_ID: 16c0
ID_VENDOR_FROM_DATABASE: VIA Technologies, Inc.
ID_VENDOR_ID: 0x1106
MAJOR: 166
MINOR: 0
SUBSYSTEM: tty
TAGS: :systemd:
USEC_INITIALIZED: 32047011045

Device details (without serial number):
Code:
CURRENT_TAGS: :systemd:
DEVLINKS: /dev/ttyOP_gmouse /dev/gps1 /dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.4:1.0
DEVNAME: /dev/ttyACM1
DEVPATH: /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.4/1-1.4:1.0/tty/ttyACM1
ID_BUS: pci
ID_MM_CANDIDATE: 1
ID_MM_DEVICE_IGNORE: 1
ID_MODEL_FROM_DATABASE: VL805 USB 3.0 Host Controller
ID_MODEL_ID: 0x3483
ID_PATH: platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.4:1.0
ID_PATH_TAG: platform-fd500000_pcie-pci-0000_01_00_0-usb-0_1_4_1_0
ID_PCI_CLASS_FROM_DATABASE: Serial bus controller
ID_PCI_INTERFACE_FROM_DATABASE: XHCI
ID_PCI_SUBCLASS_FROM_DATABASE: USB controller
ID_USB_DRIVER: cdc_acm
ID_USB_INTERFACES: :020201:0a00ff:
ID_USB_INTERFACE_NUM: 00
ID_USB_MODEL: u-blox_7_-_GPS_GNSS_Receiver
ID_USB_MODEL_ENC: u-blox\x207\x20-\x20GPS\x2fGNSS\x20Receiver
ID_USB_MODEL_ID: 01a7
ID_USB_REVISION: 0100
ID_USB_SERIAL: u-blox_AG_-_www.u-blox.com_u-blox_7_-_GPS_GNSS_Receiver
ID_USB_TYPE: generic
ID_USB_VENDOR: u-blox_AG_-_www.u-blox.com
ID_USB_VENDOR_ENC: u-blox\x20AG\x20-\x20www.u-blox.com
ID_USB_VENDOR_ID: 1546
ID_VENDOR_FROM_DATABASE: VIA Technologies, Inc.
ID_VENDOR_ID: 0x1106
MAJOR: 166
MINOR: 1
SUBSYSTEM: tty
SYSTEMD_WANTS: gpsdctl@ttyACM1.service
TAGS: :systemd:
USEC_INITIALIZED: 80569913216

Maiana device details:
Code:
CURRENT_TAGS: :systemd:
DEVLINKS: /dev/ttyOP_maiana /dev/serial0
DEVNAME: /dev/ttyAMA0
DEVPATH: /devices/platform/soc/fe201000.serial/tty/ttyAMA0
ID_MM_CANDIDATE: 1
MAJOR: 204
MINOR: 64
SUBSYSTEM: tty
TAGS: :systemd:
USEC_INITIALIZED: 6986529
Reply
#52

(2023-06-29, 04:03 PM)TVR Wrote: I only have one device with no serial, so I've been unable to test what happens if you have 2 devices with the same ID and no serial, and try to remember them both by device ID.

I've tried that and as expected you can't do it.


Attached Files Image(s)
   
Reply
#53
That doesn't look quite right, if you have 3 x matching devices then it lets you remember the first one by device ID. Shouldn't it stop you assigning any of them by device ID?

Thinking about it some more, this might be something we can't guard against. There's nothing to stop a user plugging in one device, remembering it by ID, and then plugging in a duplicate...
Reply
#54
Exactly TVR. The second one will be always blocked, never the first one.
Reply
#55
[quote pid="26558" dateline="1688056054"]
That doesn't look quite right, if you have 3 x matching devices then it lets you remember the first one by device ID. Shouldn't it stop you assigning any of them by device ID?

Thinking about it some more, this might be something we can't guard against. There's nothing to stop a user plugging in one device, remembering it by ID, and then plugging in a duplicate...
[/quote]

It makes sense to me, the first device is saved with vendor id = X, product id=Y , serial = 0.

Just because the Serial appĀ can detect the other connected devices, Openplotter doesn't care unless I try to set them up. I might be using them in a different application. When I try to add the second one it says vendor id =X, product id = Y, serial = 0 - can't do that, I already have that one used. That way there will never be a conflict.
Reply
#56
Assume I have 2 identical devices - device A in USB port 1 "remember by device id", and Device B in USB port 2 "remember by port".

Obviously you could swap the devices around between ports 1 and 2, and OpenPlotter wouldn't know anything about it (since both devices are identical).

But what if I unplug both devices and then plug one device into port 3? OpenPlotter won't know which of the two devices has been plugged in. Will it ignore it (since Device B was set to "remember by port")? Or will it assume Device A was plugged in, and move it from port 1 to port 3?

Maybe I'm overthinking it - its an extreme edge case so probably nothing to worry about?
Reply
#57
Well you've added a device whose attributes match exactly those of a device that is known to OP and that is Device A. There is no further testing or validation; you've plugged Device A into a different port. I can't imagine a different outcome. Your'e matching against a (small) set of attributes, any device exhibiting those attributes passes the test. There is no actual correspondence between something presenting those credentials and any particular physical piece of hardware. I might try it out though!
Reply
#58
(2023-06-29, 06:49 PM)TVR Wrote: Assume I have 2 identical devices - device A in USB port 1 "remember by device id", and Device B in USB port 2 "remember by port".

Obviously you could swap the devices around between ports 1 and 2, and OpenPlotter wouldn't know anything about it (since both devices are identical).

But what if I unplug both devices and then plug one device into port 3? OpenPlotter won't know which of the two devices has been plugged in. Will it ignore it (since Device B was set to "remember by port")? Or will it assume Device A was plugged in, and move it from port 1 to port 3?

Maybe I'm overthinking it - its an extreme edge case so probably nothing to worry about?

Yes, I think you are right. The conclusion would be that if you have 2 identical devices it does not make sense remember one of them by device and the other one by port, you need to remember both of them by port. This way you know that on port 1 there will be always the GPS and in port 2 there will be always wind.

At this point you may think "OK then, if I can not move my devices why I need to remember them?". The answer is because even if your device A is in port 1 with the virtual port /dev/ttyUSB0 assigned by linux, maybe on the next reboot the system has assigned to the device A the virtual port /dev/USB1 and then you will have a problem because you could treat that device as wind but it is GPS. Virtual ports assignations are not fix in linux and they are often reassigned. With this system of alias and remembered devices/ports you will be sure that what you have in port 1 will be always the GPS even when the system reassign the virtual port. Actually this is the main goal of the openplotter-seriial app, not that you can move devices but that devices are always treated as what they are even when linux assigns them another virtual port.

funny right? Smile
Reply
#59
Published OpenPlotter Serial v3.3.0 in production server.

I did not want the version using "model" attribute to be online too much.

Thanks for your help, great teamwork!
Reply
#60
Thank you all Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)