# Connecting main GPS to Pixhawk 4’s UART & I2C B port

**URL:** <https://discuss.px4.io/t/connecting-main-gps-to-pixhawk-4-s-uart-i2c-b-port/19477>\
**Category:** Pixhawk\
**Created:** [November 6, 2020, 6:41pm UTC](https://discuss.px4.io/t/connecting-main-gps-to-pixhawk-4-s-uart-i2c-b-port/19477 "2020-11-06T18:41:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hs293Go](https://discuss.px4.io/user_avatar/discuss.px4.io/hs293go/32/7352_2.png) [@Hs293Go](https://discuss.px4.io/u/Hs293Go)\
**Post date:** [November 6, 2020, 6:41pm UTC](https://discuss.px4.io/t/connecting-main-gps-to-pixhawk-4-s-uart-i2c-b-port/19477/1 "2020-11-06T18:41:44Z")

</div>

I’ve posted this in the Support section but 6 days went by with no one replying so I resorted to reposting here.

I’m using a Pixhawk 4 and I’d like to connect my [main GPS](https://store.mrobotics.io/mRo-GPS-u-Blox-Neo-M8N-Dual-Compass-LIS3MDL-IST831-p/mro-gps003-mr.htm) to its _UART & I2C B_ port. I have set `GPS_1_CONFIG` to `TELEM/SERIAL 4` (`104`) but I then failed to get any GPS reading. Should I instead set the parameter to `GPS 2` (`202`)?

I’m attaching a link to my parameter file on Google drive.  
[https://drive.google.com/file/d/1Vs0RsPQWUvjrKT3msfiasgaQM8gcfOAJ/view?usp=sharing](https://drive.google.com/file/d/1Vs0RsPQWUvjrKT3msfiasgaQM8gcfOAJ/view?usp=sharing)

To be honest, the Pixhawk 4’s nonstandard 10-pin GPS port makes sourcing replacement parts extremely difficult. Is anyone else experiencing such problems? Is so, I’m considering reaching out to Holybro to let them know that such nonstandard design choices are not appreciated.

EDIT: It’s a 10-pin port

---

<div class="post-metadata">

**Author:** ![j\_p](https://discuss.px4.io/user_avatar/discuss.px4.io/j_p/32/4434_2.png) [@j\_p](https://discuss.px4.io/u/j_p)\
**Post date:** [November 6, 2020, 7:23pm UTC](https://discuss.px4.io/t/connecting-main-gps-to-pixhawk-4-s-uart-i2c-b-port/19477/2 "2020-11-06T19:23:16Z")

</div>

Pixhawk uses 10 pin JST-GH connector (not 9 pin). The connector type is standardized by Dronecode consortium. You can get shells, pins, and application pliers in all reputable electronic part suppliers (Mouser, rs-online, farnell/avnet, Digikey). You can also get knock-offs in Banggood for several tens of dollars.

---

<div class="post-metadata">

**Author:** ![Hs293Go](https://discuss.px4.io/user_avatar/discuss.px4.io/hs293go/32/7352_2.png) [@Hs293Go](https://discuss.px4.io/u/Hs293Go)\
**Post date:** [November 7, 2020, 11:02am UTC](https://discuss.px4.io/t/connecting-main-gps-to-pixhawk-4-s-uart-i2c-b-port/19477/3 "2020-11-07T11:02:37Z")

</div>

Yes, standardizing to JST-GH gives me some solace. But imo autopilots should stick to the 6-pin GPS port and it is harmful to use a 10-pin port. There are plenty of workarounds like splicing wires and crimping connectors. But these are only _workarounds_, or _hacks_, that should not be expected of a system marketed as [_suitable for academic and commercial developers_](https://docs.px4.io/master/en/flight_controller/pixhawk4.html)

I’d rather not start an argument on autopilot design choices, so please reply only if you have experience to share on running a 6-pin primary GPS on the Pixhawk 4’s UART & I2CB port. Feel free to reach me in person at hei.go@mail.utoronto.ca if you want to discuss.

---

<div class="post-metadata">

**Author:** ![j\_p](https://discuss.px4.io/user_avatar/discuss.px4.io/j_p/32/4434_2.png) [@j\_p](https://discuss.px4.io/u/j_p)\
**Post date:** [November 7, 2020, 11:17am UTC](https://discuss.px4.io/t/connecting-main-gps-to-pixhawk-4-s-uart-i2c-b-port/19477/4 "2020-11-07T11:17:19Z")

</div>

I’ll try to see the config on mine a bit later. By the way, Holybro does have a GPS module with 6pin JST-GH: [http://www.holybro.com/product/pixhawk4-2nd-gps-module/](http://www.holybro.com/product/pixhawk4-2nd-gps-module/)

---

<div class="post-metadata">

**Author:** ![Hs293Go](https://discuss.px4.io/user_avatar/discuss.px4.io/hs293go/32/7352_2.png) [@Hs293Go](https://discuss.px4.io/u/Hs293Go)\
**Post date:** [November 10, 2020, 6:02pm UTC](https://discuss.px4.io/t/connecting-main-gps-to-pixhawk-4-s-uart-i2c-b-port/19477/5 "2020-11-10T18:02:48Z")

</div>

I solved my own problem…

I had to set `GPS_1_CONFIG` to `TELEM/SERIAL 4` and set `SER_4_CONFIG` to `auto`. The latter option shows up after the former option is set.

Another thing to note is that as I tried to reproduce the problem on my other autopilot, a Pixracer, I could never get `SER_4_CONFIG` to appear. I suspect this is because the Pixracer’s Serial 4 port is actually the FrSky telemetry port, which is never supposed to be a GPS port.

---

<div class="post-metadata">

**Author:** ![Ranjeet](https://discuss.px4.io/user_avatar/discuss.px4.io/ranjeet/32/6514_2.png) [@Ranjeet](https://discuss.px4.io/u/Ranjeet)\
**Post date:** [April 15, 2021, 7:50am UTC](https://discuss.px4.io/t/connecting-main-gps-to-pixhawk-4-s-uart-i2c-b-port/19477/6 "2021-04-15T07:50:05Z")

</div>

Hello @Hs293Go , You have solved the problem to connect GPS to UART port. I would like to ask why did you want to do this if there is a dedicated port for GPS?

Were you not using the GPS module that comes with pixhawk 4 ?

I am facing issue of inconsistent GPS problem, sometimes it catches satellites and lock is there but sometime there is not satellite reading and no lock. This is quite random, I have tried to look it from different angle like powering GPS module not below volts , My gps is mounted on a the GPS mount that comes with pixhawk 4.

Please, tell me what all problems you were facing with 10 pin port and what issues were solved after you connected GPS to UART port?

I am facing issue with GPS for long, you feedback will be much appreciated.  
Ranjeet
