Mavproxy server on Raspberry USB port disconnection

I am using mavporxy server on Raspberry to forward mavlink to remote.
on Raspberry, use USB0/USB1 to connect telemetry to communication with APM.
sometime it works, but most time the USB port gets no link.
Any idea for this issue?

Look, if we are going to help, you need to give more details, explain the steps you did

I installed mavproxy on Raspberry, plug telemetry on USB port,
run
mavproxy.py --master=/dev/ttyUSB0 --out=udp:10.20.30.22:14550

most time it shows error as

Waiting for heartbeat from /dev/ttyUSB0
MAV> link 1 down


python -m serial.tools.list_ports
/dev/ttyAMA0
/dev/ttyUSB0
2 ports found

just on few times it works.

now I can connect it and use mvproxy to forward.
new issue is it run about half or one hour, the link is cut off, shows no link.
Then I restart mavproxy command, it is back, but it will be NoLink again.

use same telemetry to connect to my laptop for MP, it is no any issue.

found discusses.
MavProxy.py “link 1 down” w/ RasPi - APSync / Companion Computers - ArduPilot Discourse

looks if you continue forward message via mavproxy by USB, it blocks the raspberry USB.

MAVLink routing with a Router software - Blog - ArduPilot Discourse

you probably have a disconnection on your usb over long time. As you are launching mavproxy with the symlink to /dev/ttyUSB0 then on disconnection, mavproxy will still hold this port. Whereas from the OS, it needs port to mount the usb device that disconnect and reconnect, it will be then /dev/ttyUSB1 as 0 is not free.
That is just a guess but probably what happens here.

To solve this connect your device by id :
/dev/serial/by-id/usb-XXXXXXXXXXXXXXXXXXXXXXXXX
You can use tabs completion to get the right path or use ls /dev/serial/by-id/ .
Using this path on mavproxy will garantee that it will reconnect on the same device even after some disconnection.

Another way it to use udev rule for your device to symlink it to a fixed name