GPSD baudrate setting in gpsd file

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

GPSD baudrate setting in gpsd file

跳至解决方案
1,312 次查看
BrintoJames
Contributor II

Hi,

I just wanted to set baud rate of my GNSS port to 38400 in gpsd file if anyone knows please help me.

Below is the current content of the gpsd file content

START_DAEON="true"

GPSD_OPTIONS=""

DEVICES="/dev/ttyLP3"

USBAUTO="true"

GPSD_SOCKET="/var/run/gpsd.socket"

 

Regards,

Brinto

0 项奖励
回复
1 解答
1,164 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hello,

You can choose udev rule or systemd service to set baud rate before gpsd service.

Here is the udev rule:

ACTION=="add", SUBSYSTEM=="tty", KERNEL=="ttyLP3", RUN+="/bin/stty -F /dev/%k 38400"

Add rule:

udevadm control --reload
udevadm trigger --action=add --subsystem-match=tty

This should be called when ttyLP3 is detected in system.


Best Regards,
Zhiming

在原帖中查看解决方案

0 项奖励
回复
5 回复数
1,274 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hello,

Please try to add  GPSD_OPTIONS="-b -s 4800"

Best Regards,
Zhiming

1,239 次查看
BrintoJames
Contributor II

Got error like

Error connecting to gpsd: [Errno 104] Connection reset by peer

Regards,

Brinto

0 项奖励
回复
1,206 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hello,

Did you try to set 38400 baudrate and then get the log from system?

Referring the guidem,  you can get the log from syslog

 

LOGGING

When gpsd is running as a daemon (not in the foreground) is sends all of its logging to syslog(3). Logging is sent with ident "gpsd" using facility "LOG_USER".

If you are using syslog-ng, then you can send all gpsd logs to a file /var/log/gpsd. Put this at the end of your /etc/syslog-ng/syslog-ng.conf file:

destination gpsdf { file("/var/log/gpsd"); };
filter f_gpsd { program("gpsd"); };
log { source(src); filter(f_gpsd); destination(gpsdf); };



Best Regards,
Zhiming

0 项奖励
回复
1,197 次查看
BrintoJames
Contributor II
I checked my system logs and confirmed that gpsd is running

and I can receive GNSS data correctly.

However, gpsd does not seem to set the baud rate to 38400 automatically. I have to manually configure it using:

stty -F /dev/ttyLP3 38400

Only after running this command does gpsd work as expected. But after a board reboot, the baud rate resets to 9600, and I have to set it again manually.

Is there a way to make gpsdalways use 38400 baud on startup? Let me know if you have any suggestions.

Best regards,
Brinto
0 项奖励
回复
1,165 次查看
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hello,

You can choose udev rule or systemd service to set baud rate before gpsd service.

Here is the udev rule:

ACTION=="add", SUBSYSTEM=="tty", KERNEL=="ttyLP3", RUN+="/bin/stty -F /dev/%k 38400"

Add rule:

udevadm control --reload
udevadm trigger --action=add --subsystem-match=tty

This should be called when ttyLP3 is detected in system.


Best Regards,
Zhiming

0 项奖励
回复