openwrt / openwrt

This repository is a mirror of https://git.openwrt.org/openwrt/openwrt.git It is for reference only and is not active for check-ins. We will continue to accept Pull Requests here. They will be merged via staging trees then into openwrt.git.
Other
20.22k stars 10.47k forks source link

FS#783 - gpsd doesn't work with "Garmin USB binary" (nor NMEA2000) #5752

Open openwrt-bot opened 7 years ago

openwrt-bot commented 7 years ago

marconi:

Supply the following if possible:

I tried it on GL-AR150, but it should reproduce on any device w/ USB

LEDE 17.01.1 gpsd 3.16-1

If you have a device with "Garmin USB binary" (eg : eTrex), then

gpsd -n -N -G -D 4 /dev/ttyUSB0

... should show data once a second.

From my reading of the code, even without a Garmin device, "-D 4" debug level should show a message of "Probing Garmin USB binary driver...\n"

From my reading of the code, it looks a a build problem. 2 "defines" need to be made :

NON_NMEA0183_ENABLE

HAVE_LIBUSB

FYI, there is a similiar bug for "NMEA2000" : If you do "gpsd -h", you should see "NMEA2000" on the list of "drivers". I can file a separate bug for this if you want.

Thanks !

openwrt-bot commented 7 years ago

marconi:

FYI, I noticed that the gpsd source has a NMEA2000 test script : test_nmea2000 (that uses "canplayer" to replay some data).

The gist of the script :

install

opkg install ip-full kmod-can-vcan canutils-canplayer

create a "virtual canbus interface" :

ip link add type vcan ip link set vcan0 up

start gpsd reading from the "virtual canbus interface" :

gpsd -G -n -N -D 4 nmea2000://vcan0

copy candump data file from gpsd source to OpenWRT :

scp gpsd-3.16/test/nmea2000/logfile_20140914_365495765_can.log root@openwrt:/tmp

log into OpenWRT in a separate window and "play" the log file :

canplayer -I /tmp/logfile_20140914_365495765_can.log vcan0=can0

openwrt-bot commented 7 years ago

marconi:

Also, I noticed that "libgps" installs "libncurses" (and terminfo) as a dependency , but I don't think that's needed (it is needed by gpsd-clients).

openwrt-bot commented 6 years ago

marconi:

Attached is patch to enable the "NMEA 2000" interface in gpsd.

Technically, this bug is for the "Garmin USB binary" interface, so let me know if you want me to open a separate bug for "NMEA 2000" interface.