Testing
With the wiring completed, we can try out our new GPS system.
Turn on the power and boot the Jetson. Once the Jetson is up and running, open a Terminal. Execute:
$ sudo cat /dev/TTHS1
You should see a stream of GPS information, which is in NMEA format. If not, you need to start trouble shooting. First make sure that you typed in the correct command. Next, it’s time to start checking the wiring. It doesn’t take much in the way of wiring error for things not to work. Check the connections. A good rule of thumb is to just connect it up right the first time so you don’t have to debug it. Just sayin’.
Software Installation
In order to use the GPS, we need to install some software:
$ sudo apt-get install gpsd gpsd-clients python-gps
which installs gpsd, a Linux daemon that interfaces with the GPS serial stream.
Once installed, we can turn on the gpsd daemon:
$ sudo gpsd /dev/ttyTHS1 -F /var/run/gpsd.sock
Once gpsd has been started, run:
$ xgps
After a while, the GPS will find the GPS satellites in your vicinity and triangulate your position. Xgps will show the satellites that it is using to calculate the position.
Note: It may take several minutes for the GPS to get a fix with the satellites. After the GPS synchs, the red light on the GPS board will flash about once every 15 seconds. If the GPS does not get a fix, it probably means that the signals from the satellites are not strong enough. The GPS device has an antenna built into it, but it may need an external antenna. The GPS board has a uFL connector, most external GPS antennas connect with SMA so you will need something like a SMA to uFL RF Adapter Cable
Conclusion
This is a very simple circuit to execute and have fun with, a good entry into breadboarding a prototype. It’s harder to describe than to actually build the circuit, it takes about 10 minutes all together to build the breadboard, wire it, and test it out. The project is actually useful after you have it finished, so it is definitely worth trying. Good luck!
4 Responses
I’m having issues on the “$ sudo cat /dev/TTHS1” step. There is no file like that in my system. I am working on the TX1. Is there an equivalent file that I should be looking at. Also I haven’t used a level shifter because the voltage I measure on the TX1’s UART port is 3.3V. Is my thinking correct here?
The TTHS1 device is determined by the UART port that the device is attached to. In this example, the TK1 is using UART 2, which maps to TTHS1. I haven’t tried this hardware combinations with the TX1, but I would guess that you’re ok with not having the level shifter.
On the TX1, the mapping to /dev/TTHSx is determined by the UART being used. From what I understand, the header J21 8/10 is /dev/TTS0 (the serial console, which may cause issues at times). The header J17 UART is mapped to /dev/TTYHS2.
You will still probably have to “cross the wires” so that TX->RX and vice versa.
You may want to search /dev for something with a similar filename. I am currently working on the TK1, with Tegra version 21.3 and the Grinch terminal, and instead of appearing as /dev/TTHS1 my GPS unit appeared on /dev/ttyTHS1.
Thanks for the advice. Still no luck though. I have ttyTHS1 ttyTHS2 and ttTHS3 in my dev folder. I’ve run the cat command on each of them. I’ve also tried hooking up to the UART on header J17. Then I tried changing the baud rate. No luck with any of it. I think part of the problem is that the UART on J21 is set up for serial console. There is a good tutorial on how to change that but it looks like it involves re-flashing the board which is something I want to avoid if possible.
Good References:
https://devtalk.nvidia.com/default/topic/936285/jetson-tx1/tx1-serial-port-configuration/
https://wiki.openwrt.org/doc/recipes/serialbaudratespeed