# Getting the ulogs

Source: https://forum.modalai.com/topic/1981/getting-the-ulogs
Category: VOXL 2 and VOXL 2 Mini (https://forum.modalai.com/category/26/voxl-2-and-voxl-2-mini)
Tags: voxl-2
Posted: 2023-03-22 20:01:43 UTC by Noe Medrano
Replies: 12 · Views: 1549

## Noe Medrano · 2023-03-22 20:01:43 UTC

I have seen a few posts about using adb pull /data/... to get the ulogs. I have tried doing this and I get the error: 
```
bash adb: command not found
```

Q1: What could be causing this error? I am connected via usb and using the adb shell. 

Q2: If I am able to connect via wifi and ssh, is there a similar command that would pull the ulogs via wifi? 

Thanks.

## Reply by tom (ModalAI staff) · 2023-03-22 20:08:28 UTC

@Noe-Medrano ADB is a program that can be installed on your host PC:

https://docs.modalai.com/voxl2-system-image/#missing-adb

## Reply by tom (ModalAI staff) · 2023-03-22 20:09:38 UTC

@Noe-Medrano But if you're connected via. wifi you can use SCP 

https://linuxize.com/post/how-to-use-scp-command-to-securely-transfer-files/

## Reply by Noe Medrano · 2023-03-22 20:10:43 UTC

I am connected via USB. When I do the adb devices and adb shell all is fine and I can connect to the voxl. When I tried using it with pull is when I got that error.

## Reply by tom (ModalAI staff) · 2023-03-22 20:22:51 UTC

@Noe-Medrano Are you running that command outside of adb or inside?

## Reply by Noe Medrano · 2023-03-22 20:28:11 UTC (in reply to tom)

@tom I think inside. 
So I connect the VOXL2 via USB. Then I do the adb devices. When it shows up, then I do adb shell. At this point is where I tried the adb pull.  Is there something  else that I have to do in between those two steps? 
I also did the bash after the adb shell then tried the adb pull..

## Reply by tom (ModalAI staff) · 2023-03-22 20:30:03 UTC

@Noe-Medrano So you'll want to do `adb pull` before you do `adb shell`.

`adb shell` brings you onto the VOXL2 itself, whereas `adb pull` needs to be ran on your host PC.

## Reply by Noe Medrano · 2023-03-22 20:35:35 UTC (in reply to tom)

@tom THANKS!!!  Is there a way to get the list of ulogs before it downloads them. That way I can write a script that only pulls on the selected ones? Preferably using wifi. I am looking at SCP right now like you suggested for downloading them via wifi.

## Reply by tom (ModalAI staff) · 2023-03-22 20:43:38 UTC

@Noe-Medrano One option as seen in this post: https://forum.modalai.com/topic/1524/downloading-px4-ulog-files is to connect to QGC over WiFi and download the log files through there.

Otherwise you could see a list of all the log files on target with `ls /data/px4/log`

You could call this command via. adb in one line like `adb shell ls /data/px4/log` 

If you your VOXL2 is on the same WiFi network as your host PC you could use scp to pull all log files in one line with something like this:

`
scp -r root@VOXL2_IP:/data/px4/log HOST_PC_DIRECTORY`

where `VOXL2_IP` is the IP address of your VOXL2 and `HOST_PC_DIRECTORY` is the directory on your host pc that you'd like the folder to be copied to

## Reply by Noe Medrano · 2023-03-22 21:38:13 UTC (in reply to tom)

@tom 
Maybe you can help me find an explanation for this. I have been using the mavsdk (python) and the jmavsim. So fart I have been testing my scripts using the jmavsim and QGC. I am able to connect to the "drone" in the sim and view the same files that are listed in QGC. This is with no voxl connected to the computer. So as I was looking for away to connect to the voxl and download the ulogs. I did not change any code on python scripts. The voxl happened to be powered and the wifi antenna connected. So my scripts connected to the voxl instead of the simulator. 

When I was  working with the sim only i was using the following to connect to the "drone". 
```
drone = System()
await drone.connect(system_address="udp://:14550")
```
I have made no changes to my python scripts. Is there something in the voxl or the mavsdk that would connect it to the voxl's wifi instead of the sim? The IP of the voxl is nowhere in my code nor connected to the computer. Before I connect to the drone the following is code appears. 

```
async def launch_px4():
    # Launch the PX4 simulator
    px4_directory = '/home/nm/dev/PX4-Autopilot'
    run_px4 = f'cd {px4_directory} && HEADLESS = 1 make px4_sitl jmavsim'
    px4_process = subprocess.call(['gnome-terminal', '--', 'bash', '-c', run_px4])
    return px4_process
```

I am just trying to understand what is happening so I know how to edit and create what we need. 

Thanks.

btw, all your suggestions are working. Thank you.

## Reply by tom (ModalAI staff) · 2023-03-22 21:42:44 UTC

@Noe-Medrano I'd recommend starting a new thread for this topic, that way our entire dev team will get eyes on it

## Reply by Noe Medrano · 2023-03-24 19:08:13 UTC (in reply to tom)

@tom if I use scp to get the file from the drone, how an I specify a specific file?  Write now I have a script that will show me all the logs on the voxl. When I select one of those files I can download them. However, the download right now takes forever over wifi. But when I tested using the scp method it was much faster. Since I need file and destination, is there a way that I can use the index to get the file path on the voxl? I am using mavsdk and their download_log and python code to get the ulogs.

## Reply by tom (ModalAI staff) · 2023-03-24 20:23:06 UTC

@Noe-Medrano scp is a basic linux utility so you should be able to find solid documentation on it's usage, but you can do the following to download a single file:

```
scp root@VOXL2_IP:/data/px4/log/FILE_NAME HOST_PC_DIRECTORY
```
