gpsd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-users] Right baud rate could not be detected "-n" flag is NOT


From: Jon Schlueter
Subject: Re: [gpsd-users] Right baud rate could not be detected "-n" flag is NOT used
Date: Fri, 12 Jun 2015 10:37:30 -0400


> I am facing this strange behavior with a Sirf IV based gps module configured in NMEA mode with baudrate 115200.
>
> When I run gpsd with -n flag, gpsd is usually able to detect the correct speed (115200), instead when no -n flag is provided, and the client connects, the detected speed is wrong (4800) and gpsd gets stuck.
>
>
> Using gdb I saw that the problem originates in serial.c: gpsd_serial_open function when it calls tcgetattr.
>
>  - When "-n" flag is NOT provided, tcgetattr returns a termios structure with c_ispeed and c_outspeed equal to B4800
>  - When the "-n" flag is provided, as soon as gpsd starts and connects with gps module tcgetattr returns a structure with c_ispeed and c_ospeed correctly set at B115200
>
> How is this even possible? The call chain is basically the same as far as I can see: gpsd_activate => gps_open =>
...snip...

Uninitialized data? Differences in permissions causing different behavior? Existing state of tty before gpsd opens port?

Just my thoughts from what you were describing

> I know that the error derives from a call to tcgetattr, so it should not be caused by gpsd, but it puzzles me that just changing how gpsd is called the speed is correctly detected.

have you captured debug logs for both senarios? Sometimes info there will tell more details.

Jon


reply via email to

[Prev in Thread] Current Thread [Next in Thread]