Problem in mavlink_ulog_streaming

Hello all, I’m newbie with px4.

What I want to do is to plot the sensor data of on-board sensors in pixhawk4 with my notebook in real time.
I’ve been trying to stream the log data in real-time using mavlink_ulog_streaming.py with the pixhawk4 connected via usb port.

But every time I try, I come up with the error message of

[Errno 16] Could not open port /dev/serial/by-id/usb-3D_Robotics_PX4_FMUv5.x_0-if00:
[Errno 16] Device or resource busy: ‘/dev/serial/by-id/usb-3D_Robotics_PX4_FMUv5.x_0-if00’

can anyone help me with this problem?

Thanks a lot

Hi

Do you know that QGC already supports real-time plotting?
https://docs.qgroundcontrol.com/master/en/analyze_view/mavlink_inspector.html

Thanks for your reply.

Actually, I knew that QGC supports real-time plotting, but what I’m looking for is how to stream log data in real-time to the notebook with no QGC via cable.

Is there any way to do this?

Ok, for real-time you’re better off using MAVLink, and you could use MAVSDK or pymavlink.
But yes, you could also use mavlink_ulog_streaming.py, and then parse the log (there’s no real-time parsing library).

To answer your original question: the error means that another process already opened the serial port. You can check with lsof /dev/serial/by-id/usb-3D_Robotics_PX4_FMUv5.x_0-if00

Thanks a lot, I think I was trying to use USB cable for both QGC connection and log streaming.

With QGC turned off, it worked well.

I really appreciate your answers!!