USB Port Assignments keep changing

I have and Chinese android head unit using both USB ports to connect and Autronic and a custom Arduino CAN signal.

I can go in and manually connect each input and everything works for a while. Once there is any sort of interruption it loses connection and the USB port assignments change number and I have to go and reconnect them manually again. Is there a way to prevent them renumbering?

It doesn’t seem to be an issue if I just have one device connected alone, that always seems to just reconnect ok.

I’m not sure if it is Android assigning the USB port numbers or just within the app?

This is a known problem. The OS assigns port identifiers and those are the only way to connect to the devices. This problems is especially difficult if you try to connect multiple devices of same type. Currently, there is nothing we can do about this on app level, sorry :frowning:

I’m looking at whether there has ever been a solution to this problem when using 2 USB ports on Android 12V car audio tablet devices?

I notice there are a few github projects like this one linked below. They seem to work from the Android device without root access to manage the assignment of the USB ports to COM ports and set the required baud rate etc.

Is the realdash app already using something like this within the app? It seems to already find various different USB to serial adapters and set up the ports but still has no control over what Android choses to name the ports each time and I have to do that within the app garage every time. Windows laptop never had this problem back when I was testing it a couple of years ago.

I really wish I could just force them to stay assigned as COM3 and COM4.

Can I run something like this github link below to run on startup each time to detect my two connections and assign the COM ports and baud rate that Realdash sees?

Other that this issue my tablet dash has been working great on my old Cortina weekender.

The Arduino has has a power supply board with noise filtering, it uses and output to control its own power supply relay to delay shutdown until the odometer value is stored away in the eeprom and all it shut down properly. I have all of the analogue inputs conditioned with voltage dividers for 12V inputs like blinkers, high beam, battery voltage, fuel gauge, vehicle speed sensor

I have pressure and temperature sensors all working nicely via the constant 5V supply that also powers the Arduino.

The main engine parameters come in via the Autronic ECU serial to USB: RPM, Boost, TPS, Coolant Temp, Ignition advance etc.

There is no way to change how Android sees the names of the USB devices. And if you plug in two identical devices with identical serial numbers, they cannot be identified from each other in any manner and OS will assign internal port as it pleases.