# Getting data from qgc

**URL:** <https://discuss.bluerobotics.com/t/getting-data-from-qgc/10985>\
**Category:** QGroundControl\
**Tags:** ardusub\
**Created:** [November 10, 2021, 3:19pm UTC](https://discuss.bluerobotics.com/t/getting-data-from-qgc/10985 "2021-11-10T15:19:14Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ugurdemirezen](https://avatars.discourse-cdn.com/v4/letter/u/9de053/32.png) [@ugurdemirezen](https://discuss.bluerobotics.com/u/ugurdemirezen)\
**Post date:** [November 10, 2021, 3:19pm UTC](https://discuss.bluerobotics.com/t/getting-data-from-qgc/10985/1 "2021-11-10T15:19:14Z")

</div>

we want to get data from qgc. How can we do it? Like we want to get the value to be 1 when rov goes into armed mode. Thanks.

---

<div class="post-metadata">

**Author:** ![EliotBR](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/eliotbr/32/6937_2.png) [@EliotBR](https://discuss.bluerobotics.com/u/EliotBR)\
**Post date:** [November 11, 2021, 7:03am UTC](https://discuss.bluerobotics.com/t/getting-data-from-qgc/10985/2 "2021-11-11T07:03:01Z")

</div>

Hi @ugurdemirezen,

# Post Analysis

QGC saves telemetry logs, which you can configure a bit in the [Application Settings](https://www.ardusub.com/reference/qgroundcontrol/application-settings-view.html#telemetry-logs) page. By default they’re saved in your `/Documents/QGroundControl/Telemetry/` folder, assuming you haven’t changed the Application Load/Save Path setting.

QGC’s default CSV output option may be useful, but

> [@Surface GPS Trace](https://discuss.bluerobotics.com/t/surface-gps-trace/10823/13):
>
> You may also want to try the [Log Viewer](https://ardupilot.org/copter/docs/common-uavlogviewer.html), which lets you visualise tlog files directly.

> [@Surface GPS Trace](https://discuss.bluerobotics.com/t/surface-gps-trace/10823/16):
>
> If you want you can make your own `.csv` from the `.tlog` file, using the [mavlogdump](https://github.com/ArduPilot/pymavlink/blob/master/tools/mavlogdump.py) tool that comes with Pymavlink, or using my [mavlogparse.py](https://gist.github.com/ES-Alexander/1498c87ad6c07623f6776c552869c805).

# While Operating

If you’re interested in getting data in real-time (rather than analysing a telemetry log file afterwards) then you can either

- set up an extra MAVLink endpoint via the [Mavproxy page](https://www.ardusub.com/reference/companion/mavproxy.html) of the Companion web interface (e.g. add `--udpout 192.168.2.1:14560`), and connect to it (e.g. using [Pymavlink](https://www.ardusub.com/developers/pymavlink.html#run-pymavlink-on-the-surface-computer)), or
- connect to the [mavlink2rest](https://github.com/patrickelectric/mavlink2rest) output at [http://192.168.2.2:4777](http://192.168.2.2:4777) with a [websocket client connection](https://github.com/patrickelectric/mavlink2rest/blob/master/examples/websocket_client.py)

---

<div class="post-metadata">

**Author:** ![ugurdemirezen](https://avatars.discourse-cdn.com/v4/letter/u/9de053/32.png) [@ugurdemirezen](https://discuss.bluerobotics.com/u/ugurdemirezen)\
**Post date:** [November 11, 2021, 9:46pm UTC](https://discuss.bluerobotics.com/t/getting-data-from-qgc/10985/4 "2021-11-11T21:46:13Z")

</div>

I want to know which data is returning when rov goes armed mode on. I can get all of them but I don’t know which one is the armed one. (This data returns when I switch from armed mode to a disarmed mode :name: MOT\_THST\_HOVER value: 0. But there isn’t any data returning when I switch from disarmed to armed).

---

<div class="post-metadata">

**Author:** ![EliotBR](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/eliotbr/32/6937_2.png) [@EliotBR](https://discuss.bluerobotics.com/u/EliotBR)\
**Post date:** [November 11, 2021, 10:13pm UTC](https://discuss.bluerobotics.com/t/getting-data-from-qgc/10985/5 "2021-11-11T22:13:22Z")

</div>

> [@ugurdemirezen](#):
>
> This data returns when I switch from armed mode to a disarmed mode :name: MOT\_THST\_HOVER value: 0.

I’m not sure what you’re referring to here. [`MOT_THST_HOVER`](https://www.ardusub.com/developers/full-parameter-list.html#motthsthover-thrust-hover-value) is a parameter (so I’m not sure how it’s “returning” when you change modes). I’m also not sure if ArduSub actually uses it for anything - I expect it’s left over from when we initially split off from ArduCopter.

> [@ugurdemirezen](#):
>
> there isn’t any data returning when I switch from disarmed to armed

If you just want to know when the vehicle is armed, that information is included in the [`HEARTBEAT`](https://mavlink.io/en/messages/common.html#HEARTBEAT) message. If you’re using Pymavlink you can check the armed status with [`master.motors_armed()`](https://github.com/ArduPilot/pymavlink/blob/master/mavutil.py#L825), which is also [mentioned in our Pymavlink examples](https://www.ardusub.com/developers/pymavlink.html#:~:text=can%20manually%20check%20with%20master.motors_armed()) 🙂

---

<div class="post-metadata">

**Author:** ![ugurdemirezen](https://avatars.discourse-cdn.com/v4/letter/u/9de053/32.png) [@ugurdemirezen](https://discuss.bluerobotics.com/u/ugurdemirezen)\
**Post date:** [November 12, 2021, 9:36pm UTC](https://discuss.bluerobotics.com/t/getting-data-from-qgc/10985/6 "2021-11-12T21:36:41Z")

</div>

Thanks a lot Eliot 🙂 I have one more question. I want to get a temperature data and recording data but ı couldn’t find any Python code. How can i get them ? Thanks.

---

<div class="post-metadata">

**Author:** ![EliotBR](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/eliotbr/32/6937_2.png) [@EliotBR](https://discuss.bluerobotics.com/u/EliotBR)\
**Post date:** [November 14, 2021, 3:09am UTC](https://discuss.bluerobotics.com/t/getting-data-from-qgc/10985/7 "2021-11-14T03:09:51Z")

</div>

> [@ugurdemirezen](#):
>
> I want to get a temperature data

If you’re using a [Bar30](https://bluerobotics.com/store/sensors-sonars-cameras/sensors/bar30-sensor-r1/) or [Bar100](https://bluerobotics.com/store/sensors-sonars-cameras/sensors/bar100-sensor-r2-rp/) pressure sensor for your temperature readings, you can access that data using

```python
... # relevant setup/connection code

message = master.recv_match(type='SCALED_PRESSURE2', blocking=True)
print(message.to_dict()) # all the message data
print(f'{message.temperature / 100} degrees Celsius')

```

If you’re using a [Celsius Temperature Sensor](https://bluerobotics.com/store/sensors-sonars-cameras/sensors/celsius-sensor-r1/) you’ll need to use the [`SCALED_PRESSURE3`](https://mavlink.io/en/messages/common.html#SCALED_PRESSURE3) message instead of [`SCALED_PRESSURE2`](https://mavlink.io/en/messages/common.html#SCALED_PRESSURE2).

> [@ugurdemirezen](#):
>
> recording data

I’m not sure what you mean by this. The video recordings are in the `QGroundControl/Video` folder, if that’s what you’re asking about?

---

<div class="post-metadata">

**Author:** ![ugurdemirezen](https://avatars.discourse-cdn.com/v4/letter/u/9de053/32.png) [@ugurdemirezen](https://discuss.bluerobotics.com/u/ugurdemirezen)\
**Post date:** [November 14, 2021, 1:31pm UTC](https://discuss.bluerobotics.com/t/getting-data-from-qgc/10985/8 "2021-11-14T13:31:55Z")

</div>

Hi Eliot,

I mean I want to get a data probably with this ‘MAV\_CMD\_DO\_CONTROL\_VIDEO’. I want to know that camera is recording. But I am new at this I can’t implement it to my code. Thanks.

---

<div class="post-metadata">

**Author:** ![EliotBR](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.bluerobotics.com/eliotbr/32/6937_2.png) [@EliotBR](https://discuss.bluerobotics.com/u/EliotBR)\
**Post date:** [November 15, 2021, 3:32am UTC](https://discuss.bluerobotics.com/t/getting-data-from-qgc/10985/9 "2021-11-15T03:32:05Z")

</div>

> [@ugurdemirezen](#):
>
> I want to get a data probably with this ‘MAV\_CMD\_DO\_CONTROL\_VIDEO’. I want to know that camera is recording.

ArduSub doesn’t know about video functionality - video streaming is instead handled by Companion, which sends a UDP stream to the topside. There’s no MAVLink involved for the Companion 0 video stream, so [`MAV_CMD_DO_CONTROL_VIDEO`](https://mavlink.io/en/messages/common.html#MAV_CMD_DO_CONTROL_VIDEO) won’t work (I believe that command is intended for use-cases where recording happens on the camera itself, not locally on the ground station computer). As far as I’m aware QGC doesn’t send any information externally when it starts or stops recording.

What’s the use-case for this? You could conceivably write some code to monitor the video folder and detect when a new file appears (which could at least tell you when you start a new recording), but the videos are already saved by default with a timestamp of when they started.

If you need higher precision than the 1s provided by that timestamp then I expect that will be quite difficult to achieve. Even doing something like using code to detect when the circle video icon changes to a square (while recording) and back to a circle (when finished) could still have some timing issues because there’ll be some amount of delay between when the button is clicked to when the recording file is created and starts storing frames. There are also potential issues with setting up something like that robustly.
