Error sending dronekit command while navigating in t265

Hello everyone, I encountered some problems while using T265 and Dronekit, I hope to get your help!
My configuration is as follows:

1.Pixhawk 2.4.8 with ArduCopter 3.6.12

2.Raspi 4B with ubuntu 20.04

3.T265 as navigation

The goal I want to achieve is to use T265 as navigation, while using another dronekit script to control the drone flight indoor。
A USB port of Raspi 4B connected to Telem 2 by CP2102 modues, baudrate 921600,ttyUSB0,send T265 data pose to Pixhawk;
Another USB port connected to telem1 by FTDI232 modus,baudrate 921600,ttyUSB1, send dronekit command to Pixhawk;

When I run the t265_to_mavlink.py and dronekit scripts respectively, they all run normally. But after running t265_to_mavlink.py and then running dronekit, the following error will appear:
Connecting to vehicle on: /dev/ttyUSB1
ERROR:dronekit:Exception in message handler for HEARTBEAT
Traceback (most recent call last):
File “/usr/local/lib/python2.7/dist-packages/dronekit/init.py”, line 1531, in notify_message_listeners
fn(self, name, msg)
File “/usr/local/lib/python2.7/dist-packages/dronekit/init.py”, line 1223, in listener
raise APIException(“mode (%s, %s) not available on mavlink definition” % (m.custom_mode, m.base_mode))
APIException: mode (0, 0) not available on mavlink definition
I don’t know how to deal with the problem, any suggestions are appreciated!

I don’t understand why you are communicating through 2 USB connections.
I would install APsync, and establish one serial connection between the Raspi and the Pixhawk. You open one mavlink connection and can then use mavlink_router to send mavlink commands from all your scripts running on the Raspberry. See also here: https://ardupilot.org/dev/docs/apsync-intro.html

Hey friend. Thank you very much for your reply and suggestions.
I simplified the connection. Only use a TTL to USB module, then install Rpanion-Server, use mavlink_router to assign ports: master is ttyUSB0, and then add 127.0.0.1:14541, which is used for t265_to_mavlink.py, and 127.0.0.1:14542, which is used for dronekit script .
There is still no problem running separately, but if I start the dronekit script after starting t265_to_mavlink.py, there will still be similar errors as before.

ERROR:dronekit:Exception in message handler for HEARTBEAT

Traceback (most recent call last):
File “/usr/local/lib/python2.7/dist-packages/dronekit/init.py”, line 1531, in notify_message_listeners
fn(self, name, msg)
File “/usr/local/lib/python2.7/dist-packages/dronekit/init.py”, line 1223, in listener
raise APIException(“mode (%s, %s) not available on mavlink definition” % (m.custom_mode, m.base_mode))
APIException: mode (0, 0) not available on mavlink definition

Is it because dronekit can’t be used like this?
thanks for your reply!