bug: multiple spurious Ping360 ethernet detections/registrations
Bug description
Sometimes there are many ethernet-connected Ping360s being reported by the ping service (and accordingly shown in the Vehicle Setup page), even when only one is connected.
Aaron (CUIS):
G / Tony (BR internal):
Seemingly relevant part of Aaron's ping service logs:
...
2024-04-21 01:40:57.530 | INFO | __main__:get_sensors:42 - Sensors available:
[PingDeviceDescriptor(ping_type=<PingType.PING1D: 1>, device_id=1, device_model=0, device_revision=1, firmware_version_major=3, firmware_version_minor=28, firmware_version_patch=0, port=<serial.tools.list_ports_linux.SysFS object at 0xb54902b0>, ethernet_discovery_info=None, driver=<ping1d_driver.Ping1DDriver object at 0xb54435b0>),
PingDeviceDescriptor(ping_type=<PingType.PING360: 2>, device_id=0, device_model=0, device_revision=0, firmware_version_major=0, firmware_version_minor=0, firmware_version_patch=0, port=None, ethernet_discovery_info='192.168.2.4:12345', driver=<ping360_ethernet_driver.Ping360EthernetDriver object at 0xb53eaff0>),
PingDeviceDescriptor(ping_type=<PingType.PING360: 2>, device_id=0, device_model=0, device_revision=0, firmware_version_major=0, firmware_version_minor=0, firmware_version_patch=0, port=None, ethernet_discovery_info='192.168.2.4:12345', driver=<ping360_ethernet_driver.Ping360EthernetDriver object at 0xb4ba7a30>),
PingDeviceDescriptor(ping_type=<PingType.PING360: 2>, device_id=0, device_model=0, device_revision=0, firmware_version_major=0, firmware_version_minor=0, firmware_version_patch=0, port=None, ethernet_discovery_info='192.168.2.4:12345', driver=<ping360_ethernet_driver.Ping360EthernetDriver object at 0xb53f55d0>),
PingDeviceDescriptor(ping_type=<PingType.PING360: 2>, device_id=0, device_model=0, device_revision=0, firmware_version_major=0, firmware_version_minor=0, firmware_version_patch=0, port=None, ethernet_discovery_info='192.168.2.4:12345', driver=<ping360_ethernet_driver.Ping360EthernetDriver object at 0xb4bae590>),
PingDeviceDescriptor(ping_type=<PingType.PING360: 2>, device_id=0, device_model=0, device_revision=0, firmware_version_major=0, firmware_version_minor=0, firmware_version_patch=0, port=None, ethernet_discovery_info='192.168.2.4:12345', driver=<ping360_ethernet_driver.Ping360EthernetDriver object at 0xb4baec50>),
PingDeviceDescriptor(ping_type=<PingType.PING360: 2>, device_id=0, device_model=0, device_revision=0, firmware_version_major=0, firmware_version_minor=0, firmware_version_patch=0, port=None, ethernet_discovery_info='192.168.2.4:12345', driver=<ping360_ethernet_driver.Ping360EthernetDriver object at 0xb5403b10>),
PingDeviceDescriptor(ping_type=<PingType.PING360: 2>, device_id=0, device_model=0, device_revision=0, firmware_version_major=0, firmware_version_minor=0, firmware_version_patch=0, port=None, ethernet_discovery_info='192.168.2.4:12345', driver=<ping360_ethernet_driver.Ping360EthernetDriver object at 0xb4b73bb0>),
PingDeviceDescriptor(ping_type=<PingType.PING360: 2>, device_id=0, device_model=0, device_revision=0, firmware_version_major=0, firmware_version_minor=0, firmware_version_patch=0, port=None, ethernet_discovery_info='192.168.2.4:12345', driver=<ping360_ethernet_driver.Ping360EthernetDriver object at 0xb4b77cb0>),
PingDeviceDescriptor(ping_type=<PingType.PING360: 2>, device_id=0, device_model=0, device_revision=0, firmware_version_major=0, firmware_version_minor=0, firmware_version_patch=0, port=None, ethernet_discovery_info='192.168.2.4:12345', driver=<ping360_ethernet_driver.Ping360EthernetDriver object at 0xb4b44250>),
PingDeviceDescriptor(ping_type=<PingType.PING360: 2>, device_id=0, device_model=0, device_revision=0, firmware_version_major=0, firmware_version_minor=0, firmware_version_patch=0, port=None, ethernet_discovery_info='192.168.2.4:12345', driver=<ping360_ethernet_driver.Ping360EthernetDriver object at 0xb4ba06f0>),
PingDeviceDescriptor(ping_type=<PingType.PING360: 2>, device_id=0, device_model=0, device_revision=0, firmware_version_major=0, firmware_version_minor=0, firmware_version_patch=0, port=None, ethernet_discovery_info='192.168.2.4:12345', driver=<ping360_ethernet_driver.Ping360EthernetDriver object at 0xb4b51190>),
PingDeviceDescriptor(ping_type=<PingType.PING360: 2>, device_id=0, device_model=0, device_revision=0, firmware_version_major=0, firmware_version_minor=0, firmware_version_patch=0, port=None, ethernet_discovery_info='192.168.2.4:12345', driver=<ping360_ethernet_driver.Ping360EthernetDriver object at 0xb4ba0eb0>)]
...
2024-04-21 01:41:40.596 | INFO | ping360_ethernet_prober:find_ping360_ethernet:65 - Data received: SONAR DVL+0+1+1+0+0
Cerulean Sonar
MAC Address:-00-80-E1-3E-24-25
IP Address:-192.168.2.3
Port:-50000
- We should probably check whether the Cerulean DVL reports itself as a Ping360 type (2) instead of Unknown (0) or something custom (>2)
Steps to reproduce
From some brief initial investigation, this seems to correspond to when a Cerulean DVL is connected. Unconfirmed, but it may be replicable by
- Connect a Cerulean DVL to a BlueOS device
- Turn on the system
- See whether multiple Ping360s are reported in the ethernet page
- It may be relevant to try refreshing the page or something to get more copies - not sure
Primary pain point(s)
The connected devices are incorrectly reported, and some interfaces look broken and becomes harder to use.
Additional context
Relevant forum thread (including logs). Most relevant log: logfile_04-21-2024_00:12:00.log
G provided some more logs internally.
Prerequisites
- [X] I have checked to make sure that a similar request has not already been filed or fixed.
From some more looking at the logs and the code, it seems the Cerulean DVL has slightly malformed messages compared to what's being looked for, so it's currently just causing an error to parse its response (which probably means the issue lies elsewhere).
In particular, it skips the space after the field names (e.g. IP Address:-192... instead of IP Address:- 192...), and includes an extra field for the port (which Ping360 does not). It would be good if we could update the parser (and adder) to support those, along with perhaps the device name and manufacturer.
It might hide an underlying issue, but we could potentially resolve the symptoms of this by removing the driver attribute from inclusion in the __eq__ method of PingDeviceDescriptor (so a ping device can only be included once in the drivers dictionary, instead of once per assigned driver).
If possible it would be better to avoid the same device being detected multiple times in the first place though.