Garmin USB gps for Jetson TX2

I’m connecting Garmin USB to the Jeston TX2. But when I load the module garmin_gps by “modprobe garmin_gps”, it says “modprobe: FATAL: Module garmin_gps not found in directory /lib/modules/4.4.15-tegra”. Does it mean Jetson still doesn’t support Garmin GPS?

I am also trying gpsd_client (http://wiki.ros.org/gpsd_client/Tutorials/Getting%20Started%20with%20gpsd_client) but I can’t get any data from /fix topic. Any ideas?

Thanks.

Is this a USB-serial-port GPS module? If so, you should be able to run it with gpsd without a specific module.

Thanks for your comment. Yes, it is a USB-serial-port GPS module. I used gpsd /Dec/ttyUSB0 and run the gpsd_client. But I can’t get any data in /fix topic. Is that because the GPS is in indoor environment?

If gpsd can talk to the device, then it’s almost certainly the problem that you’re indoors.
I’ve found the smaller Garmin type USB devices to not be that great indoors. A better antenna would help, as would moving closer to a window (or, best, use an USB extension cord to put the device outdoors.)

Also, if this is the first time in a while you’re running the device, it’s probably in “cold start” and can take a very long time to get the first fix (20-60 minutes.)

When you plug in the USB device, does /dev/ttyUSB0 appear (I’m assuming the /Dec above is a typo):

[plug in device]

ls -l /dev/ttyUSBO0

Also, what do these show for the device after it is plugged in?

lsusb
lsusb -v
usb-devices

Yes, it was a typo… I typed using my phone. sorry for that…

[plug in device]

ls -l /dev/ttyUSB0

I got as follows:
crw-rw---- 1 root dialout 188, 0 Apr 28 17:40 /dev/ttyUSB0

lsusb
Bus 003 Device 057: ID 091e:0003 Garmin International GPS (various models)
lsusb -v
Bus 003 Device 057: ID 091e:0003 Garmin International GPS (various models)
Couldn’t open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 255 Vendor Specific Class
bDeviceSubClass 255 Vendor Specific Subclass
bDeviceProtocol 255 Vendor Specific Protocol
bMaxPacketSize0 64
idVendor 0x091e Garmin International
idProduct 0x0003 GPS (various models)
bcdDevice 0.01
iManufacturer 0
iProduct 0
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 39
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 120mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 255 Vendor Specific Subclass
bInterfaceProtocol 255 Vendor Specific Protocol
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x03 EP 3 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0

usb-devices
T: Bus=03 Lev=01 Prnt=01 Port=13 Cnt=03 Dev#= 57 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=ff(vend.) Sub=ff Prot=ff MxPS=64 #Cfgs= 1
P: Vendor=091e ProdID=0003 Rev=00.01
C: #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=120mA
I: If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=garmin_gps

How do you know if gpsd can talk to the gps device?

I moved the GPS outside the window, but still can’t get data… Any ideas?

These are basic thoughts that you may have already tried (I have no experience with such device), but in case you didn’t:

Permission issues: try as root
Power issues: Check how is powered the device, or try with a powered USB hub.
disabling USB-core autosuspend (probably not the cause here, but better in your use case)

Further, the Rev version 00.01 seems very early. I don’t know if this is a hardware or firmware version, but in latter case you could check for an update.

This is my 2 cents proposal, but you’ve said “Any” :)

What does the system log say when you plug it in:

dmesg

I’m not familiar with gpsd_client myself but looking at that tutorial, they are testing using gpscat. Instead of testing by running the gpsd daemon and gpsd_client, it might be better to test with gpscat.

Update

Now I can see the gps data e.g., time, latitude, and longitude, from xgps. But there is still no data shown in cgps.

As instructed in http://wiki.ros.org/gpsd_client/Tutorials/Getting%20Started%20with%20gpsd_client

I have run roscore, “gpsd /dev/ttyUSB0” and “rosrun gpsd_client gpsd_client _host:=localhost _port:=2947”, but when I do “rostopic echo /fix” there is no data coming out. Is it because the data format issue? I am using Garmin USB GPS 18x.

That sounds like a ROS question, not a Jetson question …

I got the Garmin GPS running on my desktop with ROS, xgps etc. but it still doesn’t work with Jeston.

The problem seem to be with the module loading. When I load the module garmin_gps by “modprobe garmin_gps”, it says “modprobe: FATAL: Module garmin_gps not found in directory /lib/modules/4.4.15-tegra”. It seems that I need to build the garmin_gps module.

Any easy solutions?

If it needs the module, then there isn’t much possible other than building the module.

Thanks for the reply. How to build the module?

The module I need is here:


http://wiki.openstreetmap.org/wiki/USB_Garmin_on_GNU/Linux

If you get data from the unit, using /dev/ttyUSB0, and you can see a fix in xgps, then the problem is entirely on the ROS side, not on the kernel side or module side.
Approximately all GPS units with USB will spit out NMEA stanzas for fix (time, location) over a USB serial interface. Thus, GPS clients can read them from the serial port.
Some devices require/desire/work better with some configuration, which is done by sending serial data back to the module over the serial port. I believe gpsd contains some detection of specific devices and some control codes that match those devices – perhaps your Garmin is one of those.
Given that xgps already sees the data, the unit is clearly already emitting appropriate NMEA data, and you should now focus on how to get ROS to read the data from gpsd (which presumably knows how to configure the device to get the data out.)

Sorry, I didn’t make it clear. I got the data and ROS package working on my desktop (to test Garmin GPS is working), not on Jetson. In the desktop, it was easy to load the module by “modprobe garmin_gps”, but in Jetson I got “modprobe: FATAL: Module garmin_gps not found in directory /lib/modules/4.4.15-tegra”. That is why I think it is the module / kernel problem

Let’s ignore the module for now. It may, in fact, be necessary, but let’s try without it first.
Does the unit show up as /dev/ttyUSB0 on the Jetson?
Does gpsd see the unit on the Jetson?
If you run “sudo udevadm monitor” and then plug in the module, what does the udev print out about the device?

I think the question people are having is, is the garmin_gps module required for your gps to operate or can the Garmin utilize a generic serial driver that exists on the TX2? That isn’t clear and since I don’t have a garmin gps device, I can’t test it. But I do know that if you did get the garmin_gps module running on the TX2, you should be able to use that and it may be that is all it operates with.

The TX2 doesn’t come with the garmin_gps module built so you would need to add it to get it working. It looks like the kernel option is USB_SERIAL_GARMIN.

You can get the module as part of a kernel rebuild on the Ubuntu system that you used to flash the TX2 (recommended) or you can get it by building the module on the TX2 itself. I do my builds on the TX2 directly to add modules and initially, I followed this to rebuild the whole kernel w/chosen modules:

You’ll either find the kernel option in the kernel options menu when it comes up or you’ll need to edit the .config file by hand, fixing the USB_SERIAL_GARMIN line where it is commented out to say USB_SERIAL_GARMIN=Y

Source for the module is here but you probably won’t need it:

Thanks for your reply snarky.

On the Jetson:

/dev/ttyUSB0 doesn’t show on the Jetson. When I type dmesg | grep ttyUSB0 in the terminal, it outputs nothing.

How do I know gpsd can see the unit on the Jetson? When I run “gpsd -S 19200 /dev/ttyUSB0” and “gpscat -s 19200 /dev/ttyUSB0”, it says “OSError: [Errno 2] No such file or directory: ‘/dev/ttyUSB0’”.

When I run “sudo udevadm monitor” and then plug Garmin GPS in the Jetson, it shows
“KERNEL[174500.139814] add /devices/3530000.xhci/usb1/1-2/1-2.3 (usb)
KERNEL[174500.147706] add /devices/3530000.xhci/usb1/1-2/1-2.3/1-2.3:1.0 (usb)
UDEV [174500.167734] add /devices/3530000.xhci/usb1/1-2/1-2.3 (usb)
UDEV [174501.185433] add /devices/3530000.xhci/usb1/1-2/1-2.3/1-2.3:1.0 (usb)”

Based on these facts, I think Jetson can’t read the Garmin USB as a serial port due to the missing Garmin GPS module / kernel.

Thanks for your instructions, it is really helpful.

I finally got it working! Thanks to you all so much. I have learned a lot. Here is how I made it.

To make Jetson identify the Garmin GPS USB as a serial device. The USB_SERIAL_GARMIN module needs to be added (maybe also CH341, I added both). As suggested by ESJS, I followed this link to rebuild the chosen modules on Jetson TX2 itself:
http://www.jetsonhacks.com/2017/03/25/build-kernel-and-modules-nvidia-jetson-tx2/

After restarting the Jetson TX2, type “sudo modprobe garmin_gps” in terminal. In this way, Jetson can recognize Garmin GPS.

For Garmin GPS (not very related to Jetson issues, just for who may use Garmin GPS, it is also applied to other desktop/laptop systems), to use gpsd_client, nmea_navsat_driver is needed.
http://wiki.ros.org/nmea_navsat_driver