Jeffery Hsu Posted March 26, 2017 Posted March 26, 2017 Hi guys, I have set my /etc/default /gpsd as following: Quote # Default settings for the gpsd init script and the hotplug wrapper. # Start the gpsd daemon automatically at boot time START_DAEMON="true" # Use USB hotplugging to add new USB devices automatically to the daemon USBAUTO="false" # Devices gpsd should collect to at boot time. # They need to be read/writeable, either by user gpsd or the group dialout. DEVICES="/dev/ttyS2" # Other options you want to pass to gpsd GPSD_OPTIONS="-n -b" It starts without any problem when I run "service gpsd start" but always fails to start at boot. The output of its status is as following after booting up: Quote ● gpsd.service - GPS (Global Positioning System) Daemon Loaded: loaded (/lib/systemd/system/gpsd.service; static) Active: inactive (dead) Does anyone know what I should change in order for gpsd to run properly at boot? Thanks!
Igor Posted March 26, 2017 Posted March 26, 2017 Did you enable this ttyS2 in board configuration? Which board do you use and which kernel do you use?
Jeffery Hsu Posted March 27, 2017 Author Posted March 27, 2017 Hi Igor, I am using Orange Pi plus with custom 3.4 kernel enabling PPS. I enabled ttyS2 by editing the FEX file. Thanks!
Jeffery Hsu Posted March 27, 2017 Author Posted March 27, 2017 Hi Tao, How can I check the permissions on /dev/ttyS2? Thanks!
tao Posted March 28, 2017 Posted March 28, 2017 To see permissions type 'ls -al /dev | grep ttyS2' in a term window. After thinking about this, I'm not sure if this is contributing to your problem, but I mentioned it since it caused me problems about 10 years ago with gpsd. In those days there were two things that frequently contributed to startup problems; permissions, and not fully defined paths for executables (scripts on boot don't benefit from your shell environment, so they have to be told the location of executables. don't assume it's location is obvious or automatic). Last time I looked, gpsd logged a lot of information, so look at the log files for clues. Reboot your system and then look at the gpsd entries in syslog and messages that have a timestamp associated with the reboot. grep -i gpsd /var/log/syslog and grep -i gpsd /var/log/messages -- there should be entries for gpsd that will help identify the problem.
Jeffery Hsu Posted March 28, 2017 Author Posted March 28, 2017 Hi Tao, Thanks for your reply. I check the permission type of my ttyS2 and it is "crw-rw---- " which I believe is fine. One interesting I found out was that there was no entries of gpsd in both syslog and messages. Does it indicate that there is problem with gpsd's startup script? Thank!
tao Posted March 28, 2017 Posted March 28, 2017 I suspect there might be issues with the startup configuration. I found this http://www.catb.org/gpsd/troubleshooting.html when googling; it has a good section on troubleshooting startup issues. You might need to create some startup files, but the link includes the required details.
Jeffery Hsu Posted March 29, 2017 Author Posted March 29, 2017 Thank you ,Tao. I got it to work after reading the link you provided by adding a gpsd.service file to /etc/systemd/system.
Recommended Posts