# Error in HITL "Tx queue overflow" in VOXL-CAM.

Source: https://forum.modalai.com/topic/1227/error-in-hitl-tx-queue-overflow-in-voxl-cam
Category: Flight Core and Legacy VOXL (https://forum.modalai.com/category/9/flight-core-and-legacy-voxl)
Tags: voxl-cam
Posted: 2022-08-22 10:40:03 UTC by Anubhav
Replies: 4 · Views: 1350

## Anubhav · 2022-08-22 10:40:03 UTC

Hi,

I was trying to run HITL in voxl-cam in VIO mode in gazebo using command from here https://forum.modalai.com/topic/1121/connecting-voxl-cam-and-pixhawk-cube?_=1661157872724 as told by @Zachary-Lowell. But I am getting message in terminal saying "**Tx queue overflow**" as soon as I am arming the vehicle through transmitter. 

can you tell me how to fix this problem?

```
anubhav@anubhav-GF63-Thin-9SC:~/Gazebo_N/gazebo$ make px4_sitl_default gazebo_iris_vision
-- PX4 version: v1.4.12-modalai-rb5-flight-alpha-6-gaf80dd159a
-- PX4 config file: /home/anubhav/Gazebo_N/gazebo/boards/px4/sitl/default.cmake
-- PX4 config: px4_sitl_default
-- PX4 platform: posix
-- PX4 lockstep: enabled
-- cmake build type: RelWithDebInfo
-- Building for code coverage
-- ccache enabled (export CCACHE_DISABLE=1 to disable)
-- build type is RelWithDebInfo
-- PX4 ECL: Very lightweight Estimation & Control Library v1.9.0-rc1-509-gb919f3d
-- ROMFS: px4fmu_common
-- Configuring done
-- Generating done
-- Build files have been written to: /home/anubhav/Gazebo_N/gazebo/build/px4_sitl_default
[0/4] Performing build step for 'sitl_gazebo'
ninja: no work to do.
[3/4] cd /home/anubhav/Gazebo_N/gazebo/build/px4_...me/anubhav/Gazebo_N/gazebo/build/px4_sitl_default
SITL ARGS
sitl_bin: /home/anubhav/Gazebo_N/gazebo/build/px4_sitl_default/bin/px4
debugger: none
program: gazebo
model: iris_vision
world: none
src_path: /home/anubhav/Gazebo_N/gazebo
build_path: /home/anubhav/Gazebo_N/gazebo/build/px4_sitl_default
GAZEBO_PLUGIN_PATH :/home/anubhav/firmware/build/px4_sitl_default/build_gazebo:/home/anubhav/firmware/build/px4_sitl_default/build_gazebo:/home/anubhav/Gazebo_N/gazebo/build/px4_sitl_default/build_gazebo
GAZEBO_MODEL_PATH :/home/anubhav/firmware/Tools/sitl_gazebo/models:/home/anubhav/firmware/Tools/sitl_gazebo/models:/home/anubhav/Gazebo_N/gazebo/Tools/sitl_gazebo/models
LD_LIBRARY_PATH /opt/ros/noetic/lib:/home/anubhav/firmware/build/px4_sitl_default/build_gazebo:/home/anubhav/firmware/build/px4_sitl_default/build_gazebo:/home/anubhav/Gazebo_N/gazebo/build/px4_sitl_default/build_gazebo
empty world, setting empty.world as default
Using: /home/anubhav/firmware/Tools/sitl_gazebo/models/iris_vision/iris_vision.sdf
Warning [parser.cc:833] XML Attribute[version] in element[sdf] not defined in SDF, ignoring.
Opened serial device /dev/ttyACM0
SITL COMMAND: "/home/anubhav/Gazebo_N/gazebo/build/px4_sitl_default/bin/px4" "/home/anubhav/Gazebo_N/gazebo/build/px4_sitl_default"/etc -s etc/init.d-posix/rcS -t "/home/anubhav/Gazebo_N/gazebo"/test_data
Creating symlink /home/anubhav/Gazebo_N/gazebo/build/px4_sitl_default/etc -> /home/anubhav/Gazebo_N/gazebo/build/px4_si

_____  __   __    ___ 
| ___ \ \ \ / /   /   |
| |_/ /  \ V /   / /| |
|  __/   /   \  / /_| |
| |     / /^\ \ \___  |
\_|     \/   \/     |_/

px4 starting.

INFO  [px4] Calling startup script: /bin/sh etc/init.d-posix/rcS 0
INFO  [init] found model autostart file as SYS_AUTOSTART=1013
INFO  [param] selected parameter default file eeprom/parameters_1013
INFO  [init] parameter file not found, creating eeprom/parameters_1013
  SYS_AUTOCONFIG: curr: 0 -> new: 1
  SYS_AUTOSTART: curr: 0 -> new: 1013
  BAT_N_CELLS: curr: 0 -> new: 4
  CAL_ACC0_ID: curr: 0 -> new: 1310988
  CAL_ACC1_ID: curr: 0 -> new: 1310996
  CAL_ACC2_ID: curr: 0 -> new: 1311004
  CAL_GYRO0_ID: curr: 0 -> new: 1310988
  CAL_GYRO1_ID: curr: 0 -> new: 1310996
  CAL_GYRO2_ID: curr: 0 -> new: 1311004
  CAL_MAG0_ID: curr: 0 -> new: 197388
  CAL_MAG1_ID: curr: 0 -> new: 197644
  CBRK_SUPPLY_CHK: curr: 0 -> new: 894281
  COM_RC_IN_MODE: curr: 0 -> new: 1
  EKF2_REQ_GPS_H: curr: 10.0000 -> new: 0.5000
  EKF2_MULTI_IMU: curr: 0 -> new: 3
  SENS_IMU_MODE: curr: 1 -> new: 0
  EKF2_MULTI_MAG: curr: 0 -> new: 2
  SENS_MAG_MODE: curr: 1 -> new: 0
  SDLOG_MODE: curr: 0 -> new: 1
  SDLOG_PROFILE: curr: 1 -> new: 131
  SDLOG_DIRS_MAX: curr: 0 -> new: 7
  SENS_BOARD_X_OFF: curr: 0.0000 -> new: 0.0000
  SENS_DPRES_OFF: curr: 0.0000 -> new: 0.0010
  TRIG_INTERFACE: curr: 4 -> new: 3
  COM_CPU_MAX: curr: 90.0000 -> new: -1.0000
  IMU_INTEG_RATE: curr: 200 -> new: 250
  NAV_ACC_RAD: curr: 10.0000 -> new: 2.0000
  RTL_RETURN_ALT: curr: 60.0000 -> new: 30.0000
  RTL_DESCEND_ALT: curr: 30.0000 -> new: 10.0000
ERROR [param] Parameter PWM_MAIN_MAX not found.
ERROR [param] Parameter PWM_MAIN_MIN not found.
ERROR [param] Parameter PWM_MAIN_RATE not found.
  GPS_UBX_DYNMODEL: curr: 7 -> new: 6
  EKF2_AID_MASK: curr: 1 -> new: 24
  EKF2_EV_DELAY: curr: 175.0000 -> new: 5.0000
  LPE_FUSION: curr: 145 -> new: 132
  ATT_EXT_HDG_M: curr: 0 -> new: 1
* SYS_AUTOCONFIG: curr: 1 -> new: 0
INFO  [dataman] Unknown restart, data manager file './dataman' size is 11798680 bytes
INFO  [simulator] Waiting for simulator to accept connection on TCP port 4560
Gazebo multi-robot simulator, version 11.11.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 192.168.199.33
[Wrn] [Event.cc:61] Warning: Deleting a connection right after creation. Make sure to save the ConnectionPtr from a Connect call
Tx queue overflow
Tx queue overflow
Tx queue overflow
```

## Reply by Zachary Lowell · 2022-08-22 16:56:51 UTC

Hi Anubhav - the reason why this is not working is because you are running your code in SITL mode and not HITL mode right now - the teller is that you ran `make XXX` in your executable. To run HITL, run the following: 

1. Change the line in hitl_iris.world:      `<uri>model://iris_hitl</uri>` --> `<uri>model://iris_vision</uri>`
2. Ensure that the iris_vision.sdf file is pointing to the iris_hitl model.
3. Proceed to run: 

`source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/px4_sitl_default`
`gazebo Tools/sitl_gazebo/worlds/hitl_iris.world

## Reply by Anubhav · 2022-09-28 13:08:08 UTC

Hi @Zachary-Lowell,

I have implemented the above changes and the drone was able to use vio in simulation. 
But the problem of "TX queue overflow" still persists. [Here](https://drive.google.com/file/d/1qCYyiZY3aCzNjWFzezFAGxVcu9KAKQ7T/view?usp=sharing) is the link of video showing HITL of MAVSDK example, where some times simulation works fine but some time it give error of "TX queue overflow". 
Same happens when HITL is done through QGC, [here](https://drive.google.com/file/d/1vp4LkF8KBCU0X1X7f9OJdpQNPWmJhPyZ/view?usp=sharing) is the link.

[Here](https://drive.google.com/file/d/1OKCbadmn3LkWOsnwl1zTIQUCf2vvuxHr/view?usp=sharing) is the link where it's working fine.
Note: QGC was opened after opening Gazebo simulator in all cases.

How can I solve this problem?

Thanks! 
Anubhav

## Reply by Zachary Lowell · 2022-09-28 16:08:11 UTC

@Anubhav looks like the links to your videos are private so I am unable to view. USUALLY TX queue overflow occurs when your autopilot is trying to communicate to both QGC and the simulation at the same time and the bandwidth going over the serial connection cannot be split. The solution although simple tends to work - just have gazebo open first - connect to the drone and run PX4 on the VOXL2. Once the serial connection between gazebo and the voxl2 have been established - THEN open QGC and that will connect over UDP and not leverage the serial connection.

## Reply by Anubhav · 2022-09-28 17:41:22 UTC

@Zachary-Lowell, I am sorry for video part. I have linked them respectively again below, 

[1](https://drive.google.com/file/d/1GfQzFESwgxgtx5_tK9p3FB6JUdbSRkkV/view?usp=sharing),  [2](https://drive.google.com/file/d/1vp4LkF8KBCU0X1X7f9OJdpQNPWmJhPyZ/view?usp=sharing), and [3](https://drive.google.com/file/d/1OKCbadmn3LkWOsnwl1zTIQUCf2vvuxHr/view?usp=sharing), I hope you can see them now. 

I am using voxl-cam, and the error still arises when I don't open QGC. As you can see in first case, I was not using QGC to implement the MAVSDK example but the error still came.
