HITL with VOXL 2 Serial Port Closed



  • Hey good afternoon,

    I'm following this user guide and Zach's YT tutorial to setup HITL. I modified iris_hitl.sdf serialDevice to /dev/ttyUSB0, but continue to receive "Serial port closed!" message instead of expected "Opened serial device /dev/ttyUSB0" after running 'gazebo Tools/sitl_gazebo/worlds/hitl_iris.world'

    I've included PX4 output on target and QGC output below. I think I have cabling correct because QGC reads mavlink messages (and doesn't when I switch TX/RX).

    I'm using VOXL 2 Flight Deck, Ubuntu 20.04, ROS Noetic, Gazebo 11, QGC daily build.

    How can I fix this?

    mdr@mdr:~$ adb shell
    voxl2:/$ voxl-px4-hitl -v
    Found DSP signature file
    Setting VIO Parameters for HITL
    INFO  [px4] mlockall() enabled. PX4's virtual address space is locked into RAM.
    INFO  [px4] assuming working directory is rootfs, no symlinks needed.
    
    ______  __   __    ___ 
    | ___ \ \ \ / /   /   |
    | |_/ /  \ V /   / /| |
    |  __/   /   \  / /_| |
    | |     / /^\ \ \___  |
    \_|     \/   \/     |_/
    
    px4 starting.
    
    INFO  [px4] Calling startup script: /bin/sh /etc/modalai/voxl-px4-hitl-vio-parameters.config 0
      CBRK_SUPPLY_CHK: curr: 0 -> new: 894281
    ERROR [parameters] Timeout waiting for parameter_client_set_value_response for CBRK_SUPPLY_CHK
      COM_DISARM_PRFLT: curr: 10.0000 -> new: -1.0000
    ERROR [parameters] Timeout waiting for parameter_client_set_value_response for COM_DISARM_PRFLT
      COM_RC_IN_MODE: curr: 0 -> new: 1
    ERROR [parameters] Timeout waiting for parameter_client_set_value_response for COM_RC_IN_MODE
      NAV_RCL_ACT: curr: 2 -> new: 0
    ERROR [parameters] Timeout waiting for parameter_client_set_value_response for NAV_RCL_ACT
      EKF2_AID_MASK: curr: 1 -> new: 280
    ERROR [parameters] Timeout waiting for parameter_client_set_value_response for EKF2_AID_MASK
      SYS_HAS_MAG: curr: 1 -> new: 0
    ERROR [parameters] Timeout waiting for parameter_client_set_value_response for SYS_HAS_MAG
      EKF2_MAG_TYPE: curr: 0 -> new: 5
    ERROR [parameters] Timeout waiting for parameter_client_set_value_response for EKF2_MAG_TYPE
      EKF2_HGT_MODE: curr: 0 -> new: 3
    ERROR [parameters] Timeout waiting for parameter_client_set_value_response for EKF2_HGT_MODE
    Exiting NOW.
    INFO  [px4] mlockall() enabled. PX4's virtual address space is locked into RAM.
    INFO  [px4] assuming working directory is rootfs, no symlinks needed.
    
    ______  __   __    ___ 
    | ___ \ \ \ / /   /   |
    | |_/ /  \ V /   / /| |
    |  __/   /   \  / /_| |
    | |     / /^\ \ \___  |
    \_|     \/   \/     |_/
    
    px4 starting.
    
    INFO  [px4] Calling startup script: /bin/sh /etc/modalai/voxl-px4-hitl.config 0
    INFO  [muorb] SLPI: Creating qurt thread hpwork
    
    INFO  [muorb] SLPI: Successfully created px4 task PX4_hpwork with tid 82
    INFO  [muorb] SLPI: Creating qurt thread lpwork
    
    INFO  [muorb] SLPI: Successfully created px4 task PX4_lpwork with tid 81
    INFO  [muorb] SLPI: Creating qurt thread wkr_hrt
    
    INFO  [muorb] SLPI: Successfully created px4 task PX4_wkr_hrt with tid 80
    INFO  [muorb] SLPI: Creating qurt thread client_sync_thread
    
    INFO  [muorb] SLPI: Successfully created px4 task PX4_client_sync_thread with tid 79
    INFO  [muorb] SLPI: Creating qurt thread wq_manager
    
    INFO  [muorb] SLPI: Successfully created px4 task PX4_wq_manager with tid 78
    INFO  [muorb] SLPI: Creating qurt thread qshell
    
    INFO  [muorb] SLPI: Successfully created px4 task PX4_qshell with tid 77
    INFO  [muorb] SLPI: muorb aggregator thread running
    INFO  [logger] logger started (mode=all)
    INFO  [logger] Start file log (type: full)
    INFO  [logger] [logger] /data/px4/log/sess011/log001.ulg
    INFO  [logger] Opened full log file: /data/px4/log/sess011/log001.ulg
    INFO  [muorb] SLPI: Advertising remote topic mavlink_log
    ERROR [logger] No subscriptions added
    INFO  [muorb] SLPI: Advertising remote topic logger_status
    INFO  [qshell] Send cmd: 'icm42688p start -s -h'
    INFO  [muorb] SLPI: Marking DeviceNode(qshell_req) as advertised in process_remote_topic
    INFO  [muorb] SLPI: qshell gotten: icm42688p start -s -h
    INFO  [muorb] SLPI: Creating qurt thread wq_SPI1
    
    INFO  [muorb] SLPI: Successfully created px4 task PX4_wq_SPI1 with tid 76
    INFO  [muorb] SLPI: *** SPI Device ID 0x26000a 2490378
    INFO  [muorb] SLPI: on SPI bus 1
    INFO  [muorb] SLPI: icm42688p #0 on SPI bus 1 (devid=0x0)
    INFO  [muorb] SLPI: 
    
    INFO  [muorb] SLPI: Ok executing command: icm42688p start -s -h
    INFO  [muorb] SLPI: Sending qshell retval with timestamp 388011943, current timestamp 388011944
    INFO  [uorb] Advertising remote topic qshell_retval
    INFO  [qshell] qshell return value timestamp: 388011943, local time: 388014777
    INFO  [muorb] SLPI: Marking DeviceNode(parameter_client_reset_request) as advertised in process_remote_topic
    ERROR [muorb] SLPI: Cannot reset all parameters on client side
    INFO  [uorb] Marking DeviceNode(parameter_client_reset_response) as advertised in process_remote_topic
    INFO  [muorb] SLPI: Advertising remote topic parameter_update
    INFO  [muorb] SLPI: Marking DeviceNode(parameter_client_set_value_request) as advertised in process_remote_to
    INFO  [uorb] Marking DeviceNode(parameter_server_set_used_request) as advertised in process_remote_topic
    INFO  [muorb] SLPI: Marking DeviceNode(parameter_server_set_used_response) as advertised in process_remote_to
    INFO  [uorb] Marking DeviceNode(parameter_client_set_value_response) as advertised in process_remote_topic
    INFO  [dataman] Unknown restart, data manager file '/data/px4/dataman' size is 11798680 bytes
    INFO  [qshell] Send cmd: 'sensors start -h'
    INFO  [muorb] SLPI: Marking DeviceNode(qshell_req) as advertised in process_remote_topic
    INFO  [muorb] SLPI: qshell gotten: sensors start -h
    INFO  [muorb] SLPI: Creating qurt thread wq_nav_and_controllers
    
    INFO  [muorb] SLPI: Successfully created px4 task PX4_wq_nav_and_controllers with tid 75
    INFO  [muorb] SLPI: Creating qurt thread wq_rate_ctrl
    
    INFO  [muorb] SLPI: Successfully created px4 task PX4_wq_rate_ctrl with tid 74
    INFO  [muorb] SLPI: Ok executing command: sensors start -h
    INFO  [muorb] SLPI: Sending qshell retval with timestamp 390387672, current timestamp 390387673
    INFO  [uorb] Advertising remote topic sensors_status_imu
    INFO  [qshell] qshell return value timestamp: 390387672, local time: 390391251
    INFO  [muorb] SLPI: Advertising remote topic mission
    INFO  [commander] LED: open /dev/led0 failed (22)
    INFO  [muorb] SLPI: Advertising remote topic led_control
    INFO  [muorb] SLPI: Advertising remote topic tune_control
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed EKF health preflight check while waiting for filter to settle
    INFO  [muorb] SLPI: Advertising remote topic vehicle_control_mode
    INFO  [muorb] SLPI: Advertising remote topic vehicle_status
    INFO  [muorb] SLPI: Advertising remote topic actuator_armed
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [muorb] SLPI: Advertising remote topic commander_state
    INFO  [muorb] SLPI: Advertising remote topic vehicle_status_flags
    INFO  [muorb] SLPI: Advertising remote topic vehicle_command
    INFO  [commander] Handling Commander command 176
    INFO  [muorb] SLPI: Advertising remote topic vehicle_command_ack
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [muorb] SLPI: Advertising remote topic position_setpoint_triplet
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [muorb] SLPI: Marking DeviceNode(qshell_req) as advertised in process_remote_topic
    INFO  [muorb] SLPI: qshell gotten: mc_pos_control start
    INFO  [qshell] Send cmd: 'mc_pos_control start'
    INFO  [muorb] SLPI: Ok executing command: mc_pos_control start
    INFO  [muorb] SLPI: Sending qshell retval with timestamp 391611165, current timestamp 391611166
    INFO  [qshell] qshell return value timestamp: 391611165, local time: 391614168
    INFO  [muorb] SLPI: Marking DeviceNode(qshell_req) as advertised in process_remote_topic
    INFO  [qshell] Send cmd: 'mc_att_control start'
    INFO  [muorb] SLPI: qshell gotten: mc_att_control start
    INFO  [muorb] SLPI: Ok executing command: mc_att_control start
    INFO  [muorb] SLPI: Sending qshell retval with timestamp 391695176, current timestamp 391695177
    INFO  [qshell] qshell return value timestamp: 391695176, local time: 391696851
    INFO  [qshell] Send cmd: 'mc_rate_control start'
    INFO  [muorb] SLPI: Marking DeviceNode(qshell_req) as advertised in process_remote_topic
    INFO  [muorb] SLPI: qshell gotten: mc_rate_control start
    INFO  [muorb] SLPI: Ok executing command: mc_rate_control start
    INFO  [muorb] SLPI: Sending qshell retval with timestamp 391819694, current timestamp 391819695
    INFO  [qshell] qshell return value timestamp: 391819694, local time: 391821826
    INFO  [qshell] Send cmd: 'mc_hover_thrust_estimator start'
    INFO  [muorb] SLPI: Marking DeviceNode(qshell_req) as advertised in process_remote_topic
    INFO  [muorb] SLPI: qshell gotten: mc_hover_thrust_estimator start
    INFO  [muorb] SLPI: Ok executing command: mc_hover_thrust_estimator start
    INFO  [muorb] SLPI: Sending qshell retval with timestamp 391884503, current timestamp 391884503
    INFO  [qshell] qshell return value timestamp: 391884503, local time: 391887045
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [qshell] Send cmd: 'land_detector start multicopter'
    INFO  [muorb] SLPI: Marking DeviceNode(qshell_req) as advertised in process_remote_topic
    INFO  [muorb] SLPI: qshell gotten: land_detector start multicopter
    INFO  [muorb] SLPI: Ok executing command: land_detector start multicopter
    INFO  [muorb] SLPI: Sending qshell retval with timestamp 391986368, current timestamp 391986369
    INFO  [qshell] qshell return value timestamp: 391986368, local time: 391987655
    INFO  [uorb] Advertising remote topic vehicle_land_detected
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [qshell] Send cmd: 'pwm_out_sim start -m hil'
    INFO  [muorb] SLPI: Marking DeviceNode(qshell_req) as advertised in process_remote_topic
    INFO  [muorb] SLPI: qshell gotten: pwm_out_sim start -m hil
    INFO  [muorb] SLPI: Creating qurt thread wq_hp_default
    
    INFO  [muorb] SLPI: Successfully created px4 task PX4_wq_hp_default with tid 73
    INFO  [uorb] Advertising remote topic test_motor
    INFO  [muorb] SLPI: Ok executing command: pwm_out_sim start -m hil
    INFO  [muorb] SLPI: Sending qshell retval with timestamp 393044419, current timestamp 393044420
    INFO  [qshell] qshell return value timestamp: 393044419, local time: 393045458
    INFO  [qshell] Send cmd: 'mixer load /dev/pwm_output0 quad_x.main.mix'
    INFO  [muorb] SLPI: Marking DeviceNode(qshell_req) as advertised in process_remote_topic
    INFO  [muorb] SLPI: qshell gotten: mixer load /dev/pwm_output0 quad_x.main.mix
    INFO  [muorb] SLPI: Ok executing command: mixer load /dev/pwm_output0 quad_x.main.mix
    INFO  [muorb] SLPI: Sending qshell retval with timestamp 393105036, current timestamp 393105037
    INFO  [qshell] qshell return value timestamp: 393105036, local time: 393107031
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [qshell] Send cmd: 'ekf2 start'
    INFO  [muorb] SLPI: Marking DeviceNode(qshell_req) as advertised in process_remote_topic
    INFO  [muorb] SLPI: qshell gotten: ekf2 start
    INFO  [muorb] SLPI: Creating qurt thread wq_INS0
    
    INFO  [muorb] SLPI: Successfully created px4 task PX4_wq_INS0 with tid 4169
    INFO  [muorb] SLPI: Ok executing command: ekf2 start
    INFO  [muorb] SLPI: Sending qshell retval with timestamp 394406195, current timestamp 394406196
    INFO  [qshell] qshell return value timestamp: 394406195, local time: 394407062
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [qshell] Send cmd: 'modalai_dsp start -v -p 2 -b 921600'
    INFO  [muorb] SLPI: Marking DeviceNode(qshell_req) as advertised in process_remote_topic
    INFO  [muorb] SLPI: qshell gotten: modalai_dsp start -v -p 2 -b 921600
    INFO  [muorb] SLPI: Creating qurt thread modalai_dsp__main
    
    INFO  [muorb] SLPI: Successfully created px4 task PX4_modalai_dsp__main with tid 72
    INFO  [muorb] SLPI: Ok executing command: modalai_dsp start -v -p 2 -b 921600
    INFO  [muorb] SLPI: Sending qshell retval with timestamp 395459398, current timestamp 395459399
    ERROR [muorb] SLPI: Port is open: 0
    INFO  [uorb] Advertising remote topic sensor_accel
    INFO  [uorb] Advertising remote topic sensor_gyro
    INFO  [muorb] SLPI: Got 5 from orb_subscribe
    INFO  [muorb] SLPI: Got 6 from orb_subscribe
    INFO  [muorb] SLPI: Got 7 from orb_subscribe
    INFO  [muorb] SLPI: Got 8 from orb_subscribe
    INFO  [qshell] qshell return value timestamp: 395459398, local time: 395467699
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [mavlink] mode: Onboard, data rate: 100000 B/s on udp port 14556 remote port 14557
    INFO  [muorb] SLPI: Marking DeviceNode(vehicle_command) as advertised in process_remote_topic
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [px4] Startup script returned successfully
    pxh> INFO  [muorb] SLPI: Advertising remote topic telemetry_status
    INFO  [mavlink] partner IP: 127.0.0.1
    INFO  [muorb] SLPI: Advertising remote topic timesync_status
    INFO  [muorb] SLPI: Advertising remote topic vehicle_visual_odometry
    INFO  [muorb] SLPI: Advertising remote topic obstacle_distance
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    INFO  [PreFlightCheck] Failed barometer preflight check
    pxh> parmaINFO  [PreFlightCheck] Failed barometer preflight check
    pxh> parINFO  [PreFlightCheck] Failed barometer preflight check
    pxh> param INFO  [PreFlightCheck] Failed barometer preflight check
    pxh> param setINFO  [PreFlightCheck] Failed barometer preflight check
    pxh> param set INFO  [PreFlightCheck] Failed barometer preflight check
    pxh> param set SYINFO  [PreFlightCheck] Failed barometer preflight check
    pxh> param set SYS_INFO  [PreFlightCheck] Failed barometer preflight check
    pxh> param set SYS_HAINFO  [PreFlightCheck] Failed barometer preflight check
    pxh> param set SYS_HAS_INFO  [PreFlightCheck] Failed barometer preflight check
    pxh> param set SYS_HAS_BAINFO  [PreFlightCheck] Failed barometer preflight check
    pxh> param set SYS_HAS_BAROINFO  [PreFlightCheck] Failed barometer preflight check
    pxh> param set SYS_HAS_BARO 0INFO  [PreFlightCheck] Failed barometer preflight check
    
      SYS_HAS_BARO: curr: 1 -> new: 0
    pxh> commander check
    ERROR [PreFlightCheck] Preflight Fail: no valid data from Accel 0
    INFO  [PreFlightCheck] Preflight Fail: no valid data from Accel 0
    ERROR [PreFlightCheck] Preflight Fail: Accel Range, hold still on arming
    ERROR [PreFlightCheck] Preflight Fail: no valid data from Gyro 0
    INFO  [PreFlightCheck] Preflight Fail: no valid data from Gyro 0
    INFO  [commander] Preflight check: FAILED
    INFO  [commander] Prearm check: OK
    INFO  [HealthFlags] DEVICE		STATUS
    INFO  [HealthFlags] ----------------------------------
    INFO  [HealthFlags] GYRO:		 	
    INFO  [HealthFlags] ACC:		 	
    INFO  [HealthFlags] MAG:		 	
    INFO  [HealthFlags] PRESS:		 	
    INFO  [HealthFlags] AIRSP:		 	
    INFO  [HealthFlags] GPS:		 	OK
    INFO  [HealthFlags] OPT:		 	
    INFO  [HealthFlags] VIO:		 	
    INFO  [HealthFlags] LASER:		 	
    INFO  [HealthFlags] GTRUTH:		 	
    INFO  [HealthFlags] RATES:		 	
    INFO  [HealthFlags] ATT:		 	
    INFO  [HealthFlags] YAW:		 	
    INFO  [HealthFlags] ALTCTL:		 	
    INFO  [HealthFlags] POS:		 	
    INFO  [HealthFlags] MOT:		 	
    INFO  [HealthFlags] RC  :		EN	OFF
    INFO  [HealthFlags] GYRO2:		 	
    INFO  [HealthFlags] ACC2:		 	
    INFO  [HealthFlags] MAG2:		 	
    INFO  [HealthFlags] GEOFENCE:		 	
    INFO  [HealthFlags] AHRS:		EN	ERR
    INFO  [HealthFlags] TERRAIN:		 	
    INFO  [HealthFlags] REVMOT:		 	
    INFO  [HealthFlags] LOGGIN:		 	
    INFO  [HealthFlags] BATT:		 	
    INFO  [HealthFlags] PROX:		 	
    INFO  [HealthFlags] SATCOM:		 	
    INFO  [HealthFlags] PREARM:		EN	ERR
    INFO  [HealthFlags] OBSAVD:
    
    mdr@mdr:~/Downloads$ ./QGroundControl.AppImage 
    Settings location "/home/mdr/.config/QGroundControl.org/QGroundControl Daily.ini" Is writable?: true
    Filter rules "*Log.debug=false\nGStreamerAPILog.debug=true\nqt.qml.connections=false"
    System reported locale: QLocale(English, Latin, United States) ; Name "en_US" ; Preffered (used in maps):  "en-US"
    serialnmea: No known GPS device found. Specify the COM port via QT_NMEA_SERIAL_PORT.
    MAVLinkLogManagerLog: MAVLink logs directory: "/home/mdr/Documents/QGroundControl Daily/Logs"
    Map Cache in: "/home/mdr/.cache/QGCMapCache300" / "qgcMapCache.db"
    setCurrentPlanViewSeqNum
    setCurrentPlanViewSeqNum
    Adding target QHostAddress("192.168.0.2") 14550
    setCurrentPlanViewSeqNum
    setCurrentPlanViewSeqNum
    ParameterManagerLog: Attemping load from cache
    ParameterManagerLog: Parameters cache match failed /home/mdr/.config/QGroundControl.org/ParamCache/1_1.v2
    FactPanelControllerLog: Missing parameter: "1:SYS_AUTOSTART"
    FactPanelControllerLog: Missing parameter: "1:SYS_AUTOCONFIG"
    FactPanelControllerLog: Missing parameter: "1:SYS_AUTOSTART"
    FactPanelControllerLog: Missing parameter: "1:BAT1_N_CELLS"
    FactPanelControllerLog: Missing parameter: "1:BAT1_V_EMPTY"
    FactPanelControllerLog: Missing parameter: "1:BAT1_V_CHARGED"
    setCurrentPlanViewSeqNum
    setCurrentPlanViewSeqNum
    


  • Hi @Taylor-Presley

    Does /dev/ttyUSB0 show up in your dev environment when you plug in your FTDI cable?

    Zach



  • Zach,

    Thanks for taking the time to look at this! Yes, see snippets below:

    mdr@mdr:~$ lsusb
    Bus 001 Device 002: ID 0403:6001 Future Technology Devices International, Ltd FT232 Serial (UART) IC
    
    
    mdr@mdr:~$ dmesg | grep ttyUSB
    [    3.219261] usb 1-2: FTDI USB Serial Device converter now attached to ttyUSB0
    


  • @Zachary-Lowell have you had a chance to investigate? Is there any additional information I could provide that would help?

    Thanks,
    Taylor



  • Try giving your usb device root permissions. Do the following:

    sudo chmod 777 /dev/ttyUSB0

    and then try rerunning all the same code. I think this might be a permissions issue. @Taylor-Presley



  • @Zachary-Lowell I have two instances setup, one for SITL with ROS, gazebo, and PX4 firmware, and another following the VOXL 2 PX4 HITL User Guide. I'm not sure why, but when I deleted the bashrc sources to the SITL catkin_ws and ROS package paths, and then followed the instructions, I was able to connect to gazebo with HITL and takeoff/land. Gazebo now prints 'Opened serial device /dev/ttyUSB0.' Thanks!



  • Hm thats super strange but I am glad you got it working! Keep us posted on how the project turns out 🙂


Log in to reply