# Unable to access px4 with qgc in voxl 2 using usb-jst cable

Source: https://forum.modalai.com/topic/1214/unable-to-access-px4-with-qgc-in-voxl-2-using-usb-jst-cable
Category: General Questions (https://forum.modalai.com/category/2/general-questions)
Posted: 2022-08-17 10:28:33 UTC by Tamas Pal 0
Replies: 14 · Views: 2610

## Tamas Pal 0 · 2022-08-17 10:28:33 UTC

I am trying to access px4 with qgc using usb-jst cable using cable no 10 by connecting the jst to J18 port of voxl 2 ![IMG_20220817_154802.jpg](https://forum.modalai.com/assets/uploads/files/1660731926567-img_20220817_154802-resized.jpg). 

The host pc is not detecting anything. What should be done to solve the issue?

## Reply by modaltb (ModalAI staff) · 2022-08-17 13:08:38 UTC

Hi @Tamas-Pal-0 ,

On VOXL2 J18 is a UART that connects to the DSP that is used for ESCs --> https://docs.modalai.com/voxl2-connectors/#j18-uart-esc

At this time, you need to use an IP connection to get to QGC....  Here's some options that I use on my bench:

  https://docs.modalai.com/voxl2-hardware-setup/#wi-fi-connectivity
  https://docs.modalai.com/voxl2-hardware-setup/#ethernet-connectivity

That cable above works with the STM32 based flight controller (Flight Core and VOXL Flight) but not on J18 of VOXL2.

## Reply by Tamas Pal 0 · 2022-08-18 04:34:24 UTC

@MODALTB could you please share a dedicated manual for running hitl with voxl 2 only ?
https://docs.modalai.com/voxl2-PX4-hitl/
The docs webpage is a bit confusing

## Reply by Zachary Lowell · 2022-08-18 17:36:19 UTC

Hi Tamas, this video is how to get the voxl2 running with HITL: https://www.youtube.com/watch?v=ysvpJdXFWaM&ab_channel=AscendEngineering

Also - unless you are running the voxl-dev branch, then you will not be able to do a SERIAL connection from the voxl2 to QGC, you can only leverage a UDP connection. If you are running the voxl-dev branch and flashed the board, then you can leverage the `voxl-px4-hitl` executable and connect to QGC. However, you cannot have gazebo open simultaneously because the serial connection will then be interrupted.

If you wish to run HITL while running QGC, then run this using an FTDI cable and then turn on the required services (voxl-vision-px4, voxl-mavlink-server) and then connect to gazebo serially, and QGC via UDP signal.

Let me know if this makes sense.

## Reply by Tamas Pal 0 · 2022-08-19 11:21:33 UTC

I have flashed the voxl-dev branch files to the voxl 2's */etc/modalai/* folder. It seems like *voxl-dev* branch's *voxl-px4-hitl* is not an executable file. I am facing this issue.
***voxl2:~$ voxl-px4-hitl
bash: voxl-px4-hitl: command not found***
How to fix the problem?

## Reply by Eric Katzfey (ModalAI staff) · 2022-08-19 16:07:02 UTC (in reply to Tamas Pal 0)

@Tamas-Pal-0 You can get a voxl-dev branch package from here: http://voxl-packages.modalai.com/dists/qrb5165/dev/binary-arm64/voxl-px4_1.4.19-202208111710_arm64.deb. Install that package instead of trying to copy files over manually.

## Reply by Tamas Pal 0 · 2022-08-22 06:20:55 UTC (in reply to Eric Katzfey)

@Eric-Katzfey 
The voxl-px4-hitl is still missing in the package. I have installed it and tried to run voxl-px4-hitl command. It is not working. I have shared the terminal syntax below. How to fix it?

**voxl2:/$** sudo dpkg -i voxl-px4_1.4.19-202208111710_arm64.deb 
(Reading database ... 81777 files and directories currently installed.)
Preparing to unpack voxl-px4_1.4.19-202208111710_arm64.deb ...
Unpacking voxl-px4 (1.4.19-202208111710) over (1.4.19-202208111710) ...
Setting up voxl-px4 (1.4.19-202208111710) ...
Found DSP signature file
/
**voxl2:/$** sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
**voxl2:/$** voxl-px4-hitl
bash: /usr/bin/voxl-px4-hitl: Permission denied
**voxl2:/$** sudo voxl-px4-hitl
sudo: voxl-px4-hitl: command not found

## Reply by Zachary Lowell · 2022-08-22 16:47:09 UTC

Hi Tamas - please run a `chmod +x /usr/bin/voxl-px4-hitl` and that will enable permissions. After running that, you can run `voxl-px4-hitl` from any directory and it will work.

## Reply by Tamas Pal 0 · 2022-08-23 06:44:46 UTC (in reply to Zachary Lowell)

@Zachary-Lowell 
Aftert running the voxl-px4-hitl command I am still gettting an output like this. Is it fine? If not how to solve the problem?
```
voxl2:/usr/bin$ chmod +x /usr/bin/voxl-px4-hitl
voxl2:/usr/bin$ voxl-px4-hitl 
Found DSP signature file
Setting GPS Parameters for HITL
INFO  [px4] mlockall() enabled. PX4's virtual address space is locked into RAM.
INFO  [px4] PX4 daemon already running for instance 0 (Success)
INFO  [px4] mlockall() enabled. PX4's virtual address space is locked into RAM.
INFO  [px4] PX4 daemon already running for instance 0 (Success)
voxl2:/usr/bin$

```

## Reply by Eric Katzfey (ModalAI staff) · 2022-08-23 15:09:50 UTC (in reply to Tamas Pal 0)

@Tamas-Pal-0 Looks like px4 was already running. It was probably automatically started on system bootup using the systemd service. What is the output from ```voxl-inspect-services```?

## Reply by Tamas Pal 0 · 2022-08-24 11:05:25 UTC (in reply to Eric Katzfey)

@Eric-Katzfey 
```
voxl2:/$ voxl-inspect-services 
 Service Name         |  Enabled  |   Running   |  CPU Usage
---------------------------------------------------------------
 docker-autorun       | Disabled  | Not Running |  
 docker-daemon        | Disabled  | Not Running |  
 modallink-relink     |  Enabled  | Not Running |  
 voxl-camera-server   |  Enabled  | Not Running |  
 voxl-cpu-monitor     |  Enabled  |   Running   |     0.0
 voxl-dfs-server      |  Enabled  | Not Running |  
 voxl-imu-server      |  Enabled  |   Running   |     0.0
 voxl-mavlink-server  |  Enabled  |   Running   |     0.0
 voxl-modem           | Disabled  | Not Running |  
 voxl-portal          |  Enabled  |   Running   |     0.0
 voxl-px4-imu-server  |  Enabled  |   Running   |     0.0
 voxl-px4             |  Enabled  |   Running   |     0.0
 voxl-qvio-server     |  Enabled  | Not Running |  
 voxl-softap          | Disabled  | Not Running |  
 voxl-static-ip       |  Enabled  | Not Running |  
 voxl-streamer        |  Enabled  |   Running   |     0.0
 voxl-tag-detector    |  Enabled  | Not Running |  
 voxl-tflite-server   |  Enabled  |   Running   |     0.0
 voxl-time-sync       | Disabled  | Not Running |  
 voxl-vision-px4      |  Enabled  |   Running   |     0.0
 voxl-wait-for-fs     |  Enabled  |  Completed  |  
voxl2:/$ 
```
As mentioned by @Zachary-Lowell the voxl-px4-hitl file is not executable as shown in the youtube video https://www.youtube.com/watch?v=ysvpJdXFWaM&ab_channel=AscendEngineering 
how to get the *voxl-px4-hitl* executable file?

## Reply by Eric Katzfey (ModalAI staff) · 2022-08-24 15:21:24 UTC (in reply to Tamas Pal 0)

@Tamas-Pal-0 ```sudo chmod +x /usr/bin/voxl-px4-hitl```

## Reply by Tamas Pal 0 · 2022-08-25 10:17:47 UTC (in reply to Eric Katzfey)

@Eric-Katzfey  The voxl-px4-hitl is still missing. I followed all the steps but the executable file voxl-px4-hitl is still not there
```
voxl2:/$ wget  http://voxl-packages.modalai.com/dists/qrb5165/dev/binary-arm64/voxl-px4_1.4.19-202208111710_arm64.deb
--2022-08-25 10:05:37--  http://voxl-packages.modalai.com/dists/qrb5165/dev/binary-arm64/voxl-px4_1.4.19-202208111710_arm64.deb
Resolving voxl-packages.modalai.com (voxl-packages.modalai.com)... 35.215.116.197
Connecting to voxl-packages.modalai.com (voxl-packages.modalai.com)|35.215.116.197|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5093080 (4.9M) [application/octet-stream]
Saving to: 'voxl-px4_1.4.19-202208111710_arm64.deb'

voxl-px4_1.4.19-202 100%[===================>]   4.86M  1.86MB/s    in 2.6s    

2022-08-25 10:05:41 (1.86 MB/s) - 'voxl-px4_1.4.19-202208111710_arm64.deb' saved [5093080/5093080]

voxl2:/$ dpkg -i voxl-px4_1.4.19-202208111710_arm64.deb 
(Reading database ... 81777 files and directories currently installed.)
Preparing to unpack voxl-px4_1.4.19-202208111710_arm64.deb ...
Unpacking voxl-px4 (1.4.19-202208111710) over (1.4.19-202208111710) ...
Setting up voxl-px4 (1.4.19-202208111710) ...
Found DSP signature file
/
voxl2:/$ apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
voxl2:/$ sudo chmod +x /usr/bin/voxl-px4-hitl
voxl2:/$ voxl-px4-hitl 
Found DSP signature file
Setting GPS Parameters for HITL
INFO  [px4] mlockall() enabled. PX4's virtual address space is locked into RAM.
INFO  [px4] PX4 daemon already running for instance 0 (Success)
INFO  [px4] mlockall() enabled. PX4's virtual address space is locked into RAM.
INFO  [px4] PX4 daemon already running for instance 0 (Success)
voxl2:/$ 
```
how to fix this ?

## Reply by Eric Katzfey (ModalAI staff) · 2022-08-25 15:40:45 UTC (in reply to Tamas Pal 0)

@Tamas-Pal-0 ```voxl-px4-hitl``` isn't missing. Your screen shot shows you executing it. But as I said in the earlier response you already have px4 running and when you execute the command it won't allow you to run a second instance of px4.

## Reply by Eric Katzfey (ModalAI staff) · 2022-08-25 16:30:25 UTC (in reply to Tamas Pal 0)

@Tamas-Pal-0 In order to prevent px4 from running automatically in the background as a daemon on system startup use ```systemctl disable voxl-px4``` and then ```sync```. Reboot voxl 2 and then try ```voxl-px4-hitl``` again.
