# Using a GPS through SPI

Source: https://forum.modalai.com/topic/4936/using-a-gps-through-spi
Category: General Questions (https://forum.modalai.com/category/2/general-questions)
Posted: 2025-12-17 19:30:18 UTC by alan123
Replies: 7 · Views: 677

## alan123 · 2025-12-17 19:30:18 UTC

Hi, 

I'm currently attempting to use a GPS through the J10 SPI port on the VOXL 2. I plugged it in and ran voxl-inspect-gps but it doesn't seem to be connected. Do I have to change some software settings to get this to work?

Thanks.

## Reply by Zachary Lowell 0 · 2025-12-17 22:21:03 UTC

@alan123 said in [Using a GPS through SPI](/post/24690):
> I'm currently attempting to use a GPS through the J10 SPI port on the VOXL 2. I plugged it in and ran voxl-inspect-gps but it doesn't seem to be connected. Do I have to change some software settings to get this to work?
> 
> 

@alan123 yes you need to change the port that the driver is pointed to. Currently on the voxl2 inside of /usr/bin/voxl-px4-start there is a line that is somewhere along the lines of `qshell gps start XYZ` and in there one of those args is the literaly bus on the voxl2 that the driver should be probing - if you wish to change to J10, you need to change one of those arguments to point to that endpoint.

## Reply by alan123 · 2025-12-18 18:33:48 UTC (in reply to Zachary Lowell 0)

@Zachary-Lowell-0 It seems like PX4 is configured to find the GPS on UART even though I give it the "dev/spidev14.0" port. Is there a way to force PX4 to listen through SPI protocol? Below is the error I'm receiving:

ERROR [muorb] [gps] failed to open /dev/spidev14.0 err: 22
ERROR [muorb] [drivers__device] Could not convert /dev/spidev14.0 into a valid uart port number

## Reply by Eric Katzfey (ModalAI staff) · 2025-12-18 19:09:27 UTC (in reply to alan123)

@alan123 If you are starting it on apps side the you use `gps start -d <device port>`. If you start it on DSP side then you use `qshell gps start -d <device port>`. For `/dev/spidev14.0` you have to start on the apps side. Also it defaults to UART so if you want SPI then you will need to add `-i spi` to your start command.

## Reply by alan123 · 2025-12-18 20:41:26 UTC (in reply to Eric Katzfey)

@Eric-Katzfey Still getting an error but its a different error code number. I've made the changes that you recommended as well. Any other thoughts on what could be wrong?

ERROR [muorb] [gps] failed to open /dev/spidev14.0 err: 34
ERROR [muorb] [drivers__device] Could not convert /dev/spidev14.0 into a valid uart port number

![Screenshot from 2025-12-18 13-55-09.png](https://forum.modalai.com/assets/uploads/files/1766090483131-screenshot-from-2025-12-18-13-55-09.png)

## Reply by Eric Katzfey (ModalAI staff) · 2025-12-18 21:07:15 UTC (in reply to alan123)

@alan123 Well, is PLATFORM = M0052? Seems like you are still executing the qshell one. And the command isn't setup correctly, should be `gps start -i spi -d /dev/spidev14.0`

## Reply by alan123 · 2025-12-18 21:29:54 UTC (in reply to Eric Katzfey)

@Eric-Katzfey PLATFORM=M0054. I changed the command to gps start and now when I run "voxl-px4" the gps commands don't print to the shell. QGS and "voxl-inspect-gps" also show that there is no GPS connection. Thoughts?

![Screenshot from 2025-12-18 15-21-46.png](https://forum.modalai.com/assets/uploads/files/1766093368881-screenshot-from-2025-12-18-15-21-46.png)

## Reply by Eric Katzfey (ModalAI staff) · 2025-12-18 22:22:52 UTC (in reply to alan123)

@alan123 Are you starting voxl-px4 from the command line (e.g. `voxl-px4 -d`) or is it starting automatically from a systemd service file on startup. If you have started it from the command line you can enter commands from the px4 shell. So, after the script is done, you can enter `gps status` to see that the driver is doing. If the driver hasn't been started, try starting it directly from the command line.
