GPSD baudrate setting in gpsd file

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

GPSD baudrate setting in gpsd file

ソリューションへジャンプ
1,303件の閲覧回数
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,155件の閲覧回数
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,265件の閲覧回数
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hello,

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

Best Regards,
Zhiming

1,230件の閲覧回数
BrintoJames
Contributor II

Got error like

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

Regards,

Brinto

0 件の賞賛
返信
1,197件の閲覧回数
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,188件の閲覧回数
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,156件の閲覧回数
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 件の賞賛
返信