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
#31
Yes, the serial attribute was replaced by the model attribute basically because the serial attribute is almost always empty or at least it is empty on all the devices I have tested. I could revert the serial attribute but I need you to send me the output of this command having the device with the serial AQ02Z... plugged in:

Code:
udevadm info -a -n /dev/ttyUSB0

These are the attributes of all my u-blox devices:
Code:
Bus 001 Device 005: ID 1546:01a7 U-Blox AG [u-blox 7]

  idVendor          0x1546 U-Blox AG
  idProduct          0x01a7 [u-blox 7]
  bcdDevice            1.00
  iManufacturer          1
  iProduct                2
  iSerial                0
Reply
#32
Sailoog

I agree that my Ublox 7 does not display a serial number, neither does my GlobalSat BU-353 nor any of my devices that use the Prolific chip set. FTDI however do offer serial numbers as you can see.

I would not want you to go to the effort just for me, I am perhaps one of only a handful of happy OpenPlotter uses who use multiple identical serial devices for which the serial number attribute is not blank. If in future it means I can't remember the devices by vendor, product, serial then I can live with it. It might be worth changing the panel option "Remember device (by vendor, product, serial)" to ..vendor, product, model so that it is clear that the serial number is not a factor.

Also the message shown in the image in post #29 is a little misleading - Device with duplicate vendor and product must be set to "Remember port". You can see in that picture that I already have two devices correctly set up with identical vendor and product ids (0403, 6001). If the message were to mention the third attribute then it would be accurate.

Thanks very much once again.

The output of the command you suggest does not render the information in the format shown in your post so here is the data for the three cables I use from the lsusb command:

Code:
Bus 001 Device 008: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC

  idVendor           0x0403 Future Technology Devices International, Ltd
  idProduct          0x6001 FT232 Serial (UART) IC
  bcdDevice            6.00
  iManufacturer           1 FTDI
  iProduct                2 USB-RS232 Cable
  iSerial                 3 FT2QNH5B

Bus 001 Device 004: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC

idVendor           0x0403 Future Technology Devices International, Ltd
  idProduct          0x6001 FT232 Serial (UART) IC
  bcdDevice            6.00
  iManufacturer           1 FTDI
  iProduct                2 FT232R USB UART
  iSerial                 3 AQ02Z7EX

Bus 001 Device 006: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC

  idVendor           0x0403 Future Technology Devices International, Ltd
  idProduct          0x6001 FT232 Serial (UART) IC
  bcdDevice            6.00
  iManufacturer           1 FTDI
  iProduct                2 FT232R USB UART
  iSerial                 3 A904NAOG


Output of the udevadm info -a -n /dev/ttyUSB0 command is very verbose:

Code:
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/ttyUSB0/tty/ttyUSB0':
    KERNEL=="ttyUSB0"
    SUBSYSTEM=="tty"
    DRIVER==""
    ATTR{power/control}=="auto"
    ATTR{power/runtime_active_time}=="0"
    ATTR{power/runtime_status}=="unsupported"
    ATTR{power/runtime_suspended_time}=="0"

  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/ttyUSB0':
    KERNELS=="ttyUSB0"
    SUBSYSTEMS=="usb-serial"
    DRIVERS=="ftdi_sio"
    ATTRS{latency_timer}=="16"
    ATTRS{port_number}=="0"
    ATTRS{power/control}=="auto"
    ATTRS{power/runtime_active_time}=="0"
    ATTRS{power/runtime_status}=="unsupported"
    ATTRS{power/runtime_suspended_time}=="0"

  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1.0':
    KERNELS=="1-1.2:1.0"
    SUBSYSTEMS=="usb"
    DRIVERS=="ftdi_sio"
    ATTRS{authorized}=="1"
    ATTRS{bAlternateSetting}==" 0"
    ATTRS{bInterfaceClass}=="ff"
    ATTRS{bInterfaceNumber}=="00"
    ATTRS{bInterfaceProtocol}=="ff"
    ATTRS{bInterfaceSubClass}=="ff"
    ATTRS{bNumEndpoints}=="02"
    ATTRS{interface}=="FT232R USB UART"
    ATTRS{supports_autosuspend}=="1"

  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2':
    KERNELS=="1-1.2"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{authorized}=="1"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bDeviceClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bMaxPacketSize0}=="8"
    ATTRS{bMaxPower}=="90mA"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bcdDevice}=="0600"
    ATTRS{bmAttributes}=="a0"
    ATTRS{busnum}=="1"
    ATTRS{configuration}==""
    ATTRS{devnum}=="4"
    ATTRS{devpath}=="1.2"
    ATTRS{devspec}=="(null)"
    ATTRS{idProduct}=="6001"
    ATTRS{idVendor}=="0403"
    ATTRS{ltm_capable}=="no"
    ATTRS{manufacturer}=="FTDI"
    ATTRS{maxchild}=="0"
    ATTRS{power/active_duration}=="38448480"
    ATTRS{power/autosuspend}=="2"
    ATTRS{power/autosuspend_delay_ms}=="2000"
    ATTRS{power/connected_duration}=="38448480"
    ATTRS{power/control}=="on"
    ATTRS{power/level}=="on"
    ATTRS{power/persist}=="1"
    ATTRS{power/runtime_active_time}=="38448249"
    ATTRS{power/runtime_status}=="active"
    ATTRS{power/runtime_suspended_time}=="0"
    ATTRS{product}=="FT232R USB UART"
    ATTRS{quirks}=="0x0"
    ATTRS{removable}=="removable"
    ATTRS{rx_lanes}=="1"
    ATTRS{serial}=="AQ02Z7EX"
    ATTRS{speed}=="12"
    ATTRS{tx_lanes}=="1"
    ATTRS{urbnum}=="27"
    ATTRS{version}==" 2.00"

  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1':
    KERNELS=="1-1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{authorized}=="1"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceProtocol}=="02"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{bMaxPower}=="2mA"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bcdDevice}=="0bb3"
    ATTRS{bmAttributes}=="e0"
    ATTRS{busnum}=="1"
    ATTRS{configuration}==""
    ATTRS{devnum}=="2"
    ATTRS{devpath}=="1"
    ATTRS{idProduct}=="2514"
    ATTRS{idVendor}=="0424"
    ATTRS{ltm_capable}=="no"
    ATTRS{maxchild}=="4"
    ATTRS{power/active_duration}=="38449380"
    ATTRS{power/autosuspend}=="0"
    ATTRS{power/autosuspend_delay_ms}=="0"
    ATTRS{power/connected_duration}=="38449380"
    ATTRS{power/control}=="auto"
    ATTRS{power/level}=="auto"
    ATTRS{power/runtime_active_time}=="38448938"
    ATTRS{power/runtime_status}=="active"
    ATTRS{power/runtime_suspended_time}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{removable}=="unknown"
    ATTRS{rx_lanes}=="1"
    ATTRS{speed}=="480"
    ATTRS{tx_lanes}=="1"
    ATTRS{urbnum}=="73"
    ATTRS{version}==" 2.00"

  looking at parent device '/devices/platform/soc/3f980000.usb/usb1':
    KERNELS=="usb1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{authorized}=="1"
    ATTRS{authorized_default}=="1"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceProtocol}=="01"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{bMaxPower}=="0mA"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bcdDevice}=="0601"
    ATTRS{bmAttributes}=="e0"
    ATTRS{busnum}=="1"
    ATTRS{configuration}==""
    ATTRS{devnum}=="1"
    ATTRS{devpath}=="0"
    ATTRS{idProduct}=="0002"
    ATTRS{idVendor}=="1d6b"
    ATTRS{interface_authorized_default}=="1"
    ATTRS{ltm_capable}=="no"
    ATTRS{manufacturer}=="Linux 6.1.21-v7+ dwc_otg_hcd"
    ATTRS{maxchild}=="1"
    ATTRS{power/active_duration}=="38449520"
    ATTRS{power/autosuspend}=="0"
    ATTRS{power/autosuspend_delay_ms}=="0"
    ATTRS{power/connected_duration}=="38449520"
    ATTRS{power/control}=="auto"
    ATTRS{power/level}=="auto"
    ATTRS{power/runtime_active_time}=="38449523"
    ATTRS{power/runtime_status}=="active"
    ATTRS{power/runtime_suspended_time}=="0"
    ATTRS{product}=="DWC OTG Controller"
    ATTRS{quirks}=="0x0"
    ATTRS{removable}=="unknown"
    ATTRS{rx_lanes}=="1"
    ATTRS{serial}=="3f980000.usb"
    ATTRS{speed}=="480"
    ATTRS{tx_lanes}=="1"
    ATTRS{urbnum}=="26"
    ATTRS{version}==" 2.00"

  looking at parent device '/devices/platform/soc/3f980000.usb':
    KERNELS=="3f980000.usb"
    SUBSYSTEMS=="platform"
    DRIVERS=="dwc_otg"
    ATTRS{busconnected}=="Bus Connected = 0x1"
    ATTRS{buspower}=="Bus Power = 0x1"
    ATTRS{bussuspend}=="Bus Suspend = 0x0"
    ATTRS{devspeed}=="Device Speed = 0x0"
    ATTRS{driver_override}=="(null)"
    ATTRS{enumspeed}=="Device Enumeration Speed = 0x1"
    ATTRS{fr_interval}=="Frame Interval = 0x1d4b"
    ATTRS{ggpio}=="GGPIO = 0x00000000"
    ATTRS{gnptxfsiz}=="GNPTXFSIZ = 0x01000306"
    ATTRS{gotgctl}=="GOTGCTL = 0x001c0001"
    ATTRS{gpvndctl}=="GPVNDCTL = 0x00000000"
    ATTRS{grxfsiz}=="GRXFSIZ = 0x00000306"
    ATTRS{gsnpsid}=="GSNPSID = 0x4f54280a"
    ATTRS{guid}=="GUID = 0x2708a000"
    ATTRS{gusbcfg}=="GUSBCFG = 0x20001700"
    ATTRS{hcd_frrem}=="HCD Dump Frame Remaining"
    ATTRS{hcddump}=="HCD Dump"
    ATTRS{hnp}=="HstNegScs = 0x0"
    ATTRS{hnpcapable}=="HNPCapable = 0x1"
    ATTRS{hprt0}=="HPRT0 = 0x00001005"
    ATTRS{hptxfsiz}=="HPTXFSIZ = 0x02000406"
    ATTRS{hsic_connect}=="HSIC Connect = 0x1"
    ATTRS{inv_sel_hsic}=="Invert Select HSIC = 0x0"
    ATTRS{mode}=="Mode = 0x1"
    ATTRS{mode_ch_tim_en}=="Mode Change Ready Timer Enable = 0x0"
    ATTRS{power/control}=="auto"
    ATTRS{power/runtime_active_time}=="0"
    ATTRS{power/runtime_status}=="unsupported"
    ATTRS{power/runtime_suspended_time}=="0"
    ATTRS{rd_reg_test}=="Time to read GNPTXFSIZ reg 10000000 times: 710 msecs (71 jiffies)"
    ATTRS{regdump}=="Register Dump"
    ATTRS{regoffset}=="0xffffffff"
    ATTRS{regvalue}=="invalid offset"
    ATTRS{rem_wakeup_pwrdn}==""
    ATTRS{remote_wakeup}=="Remote Wakeup Sig = 0 Enabled = 0 LPM Remote Wakeup = 0"
    ATTRS{spramdump}=="SPRAM Dump"
    ATTRS{srp}=="SesReqScs = 0x1"
    ATTRS{srpcapable}=="SRPCapable = 0x1"
    ATTRS{wr_reg_test}=="Time to write GNPTXFSIZ reg 10000000 times: 690 msecs (69 jiffies)"

  looking at parent device '/devices/platform/soc':
    KERNELS=="soc"
    SUBSYSTEMS=="platform"
    DRIVERS=="simple-pm-bus"
    ATTRS{driver_override}=="(null)"
    ATTRS{power/control}=="auto"
    ATTRS{power/runtime_active_time}=="0"
    ATTRS{power/runtime_status}=="unsupported"
    ATTRS{power/runtime_suspended_time}=="0"

  looking at parent device '/devices/platform':
    KERNELS=="platform"
    SUBSYSTEMS==""
    DRIVERS==""
    ATTRS{power/control}=="auto"
    ATTRS{power/runtime_active_time}=="0"
    ATTRS{power/runtime_status}=="unsupported"
    ATTRS{power/runtime_suspended_time}=="0"
Reply
#33
Thanks a lot, that was really useful. The udevadm is very verbose but it is what I need because I can get the right attribute where the serials are: ATTRS{serial}=="AQ02Z7EX" and this is also the attribute that the udev rule will use.

The extra problem here was that we were using pyudev to get attributes but tags are not the same as udev tags and they are also different between linux distributions (debian, ubuntu...). So, now we use the udevadm tags which are more consistent.

So, difficult decision to make. The standard says that a serial device must have id vendor, id product and serial but reality is different. Should we penalize those who do things well? If we keep model instead of serial it will not be perfect either because most of the identical devices will also share model. If we go back to serial, most of the GPS devices will have to use port to remember devices when identical devices are present, but more than one GPS is not a normal case.

Now I think that we should go back to serial. Your thoughts?
Reply
#34
Yes a difficult one indeed - which option introduces the fewest problems for users? If we were to identify based on all four of the attributes then those with serial numbers would always work. Those without would fall back to relying on the model and we would not be in a worse position than we are now I think? I don't think anyone would lose out but I have no idea on the effort involved in achieving that.
Reply
#35
Not sure if it helps at all, but my u-blox 7 GPS has no serial number, and my Teensy 4.0 (running MicronetToNMEA) has 
ATTRS{serial}=="12306220"

I don't have any devices with identical vendor and product, so Baltika's issue doesn't affect me.
Reply
#36
(2023-06-29, 11:14 AM)TVR Wrote: Not sure if it helps at all, but my u-blox 7 GPS has no serial number, and my Teensy 4.0 (running MicronetToNMEA) has 
ATTRS{serial}=="12306220"

I don't have any devices with identical vendor and product, so Baltika's issue doesn't affect me.

What chipset does the teensy use? (idVendor/idProduct)
Reply
#37
Just to clarify, any of the both options "model" or "serial" will work perfect when the devices are not identical.

Using the 4 attributes is a good point but it would add extra complexity to the code for small rewards because I have just checked all my non-serial devices and all of them have the same model.

I'm getting closer to going back to serial Smile
Reply
#38
(2023-06-29, 11:27 AM)Sailoog Wrote: Just to clarify, any of the both options "model" or "serial" will work perfect when the devices are not identical.

Using the 4 attributes is a good point but it would add extra complexity to the code for small rewards because I have just checked all my non-serial devices and all of them have the same model.

I'm getting closer to going back to serial Smile

Fair enough!

Just to clarify, any of the both options "model" or "serial" will work perfect when the devices are not identical. That's true but if we stick with model as a selective attribute then two identical devices will not work even if they have different serials. Actually I guess that's sort of what you meant.
Reply
#39
(2023-06-29, 11:27 AM)baltika_no_9 Wrote: What chipset does the teensy use? (idVendor/idProduct)

Code:
    ATTRS{manufacturer}=="Teensyduino"
    ATTRS{idProduct}=="0483"
    ATTRS{idVendor}=="16c0"
Reply
#40
(2023-06-29, 11:35 AM)baltika_no_9 Wrote:
(2023-06-29, 11:27 AM)Sailoog Wrote: Just to clarify, any of the both options "model" or "serial" will work perfect when the devices are not identical.

Using the 4 attributes is a good point but it would add extra complexity to the code for small rewards because I have just checked all my non-serial devices and all of them have the same model.

I'm getting closer to going back to serial Smile

Fair enough!

Just to clarify, any of the both options "model" or "serial" will work perfect when the devices are not identical. That's true but if we stick with model as a selective attribute then two identical devices will not work even if they have different serials. Actually I guess that's sort of what you meant.

Correct, well, they both will work OK sendig/receiving data but you will not be able to remember them as "device", only as "port" because they are presented as identical but actually they are not because they have different serials.

If no more arguments are exposed I will go back to serial this afternoon.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)