Skip to content

Gpsd can't open the tcp connection with str2str_tcp #474

@Stefal

Description

@Stefal

Describe the bug

During my tests to repro #414, sometime gpsd service failed and doesn't try to restart.
It occurs only from time to time, and when str2str_tcp doesn't open the serial connection successfuly (it stays on waiting even though the Gnss receiver is ok. Maybe related to rtklibexplorer/RTKLIB#622)

Jun 02 14:55:40 basegnss systemd[1]: Starting gpsd.service - GPS (Global Positioning System) Daemon...
Jun 02 14:55:41 basegnss systemctl[542]: active
Jun 02 14:55:41 basegnss systemd[1]: Started gpsd.service - GPS (Global Positioning System) Daemon.
Jun 02 15:06:45 basegnss gpsd[620]: gpsd:ERROR: TCP device open error can't connect to host/port pair.
Jun 02 15:06:45 basegnss gpsd[620]: gpsd:ERROR: tcp://localhost:5015: device activation failed, freeing device.
Jun 02 15:34:58 basegnss systemd[1]: Stopping gpsd.service - GPS (Global Positioning System) Daemon...
Jun 02 15:34:58 basegnss systemd[1]: gpsd.service: Deactivated successfully.
Jun 02 15:34:58 basegnss systemd[1]: Stopped gpsd.service - GPS (Global Positioning System) Daemon.

Expected behavior
Gpsd should not start, or should try to restart

Software/Hardware (please complete the following information):

  • RTKBase release number 2.6.3
  • OS: Armbian Bookworm
  • SBC: Orange Pi Zero
  • GNSS Device: F9P
  • Connection type: uart

** Solution **
One way is to test is the tcp connection is available before starting gpsd.
I did a quick test with this script named check_tcp.sh:

#!/bin/bash
timeout 1 bash -c 'cat < /dev/null > /dev/tcp/localhost/5015'

which is launched with a new line in the gpsd service:
ExecStartPre=/home/basegnss/rtkbase/tools/check_tcp.sh

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions