gpsd-users
[Top][All Lists]
Advanced

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

Re: powering on gps device


From: Gary E. Miller
Subject: Re: powering on gps device
Date: Tue, 22 Jun 2021 11:05:42 -0700

Yo Nachiket!

On Tue, 22 Jun 2021 15:34:52 +0530
Nachiket Gokhale <gokhalen@gmail.com> wrote:

> I'd like to know how I can send the right commands to my gps device to
> power it up.

Most GPS receivers need nothing to start sending data.  Those that
do not follow no attern.  So we need to know what model of
receiver you have to help.

> Apologies if my question is simple or obvious. I'm very new to
> communicating with serial (or gps) devices. I'm trying to install
> gpsd on a Raspberry Pi. As per the instructions at
> 
> https://gpsd.io/installation.html

Good.  Are you installing a ackage, from a tar ball, or from git?

> I should first check if I can get data from my GPS using
> 
> stty -F /dev/ttyS0 ispeed 4800 && cat </dev/ttyS0

Few modern GPS acturally run at 4800.  And almost none ever ran
at slit seeds.

> This does not yield anything.

Which may just mean you set the wrong speed, or the input is
not confirged properly.

> So, I should fix this first. I think
> this is because the device is not powering up.

I would not expect that to power up a powered down device.  Few
GPS actually power down, looks like yours is one of the unlucky ones.

> However, I can send
> the right AT commands to power up the device attached to the serial
> port using the Python script given at the end of this message.

Notice your script sets the speed to 115,200?  Not close to 4,800.
The sends an AT command.

So  I fail to see you problem.  You know how to power up your device, 
do that, then run gpsd.

> I open
> two terminals, run the Python script in one of them and type
> 
> cat /dev/ttyS0
> 
> in the other terminal. The cat then gives me GPGGA sentences.

Good.

> However,
> 
> gpsmon /dev/ttyS0 gives
> 
> gpsmon:ERROR: SER: /dev/ttyS0 already opened by another process

You fail to mentio if you ran that as root?  gpsmon usually needs
root.  And, of course, the cat must be stopped first.

> Which makes me think that what I did is not good enough for gpsd,

It is.

> because doing gpsd -N -D3  /dev/ttyS0 gives:
> 
> gpsd:INFO: launching (Version 3.17)

3.17 is really old.

> gpsd:INFO: listening on port gpsd
> gpsd:INFO: stashing device /dev/ttyS0 at slot 0
> gpsd:INFO: running with effective group ID 20
> gpsd:INFO: running with effective user ID 115

And you forgot to run as root?

> gpsd:ERROR: SER: device open of /dev/ttyS0 failed: Device or resource
> busy

Yup, same error as before.  You forgot to run as root, or cat is
still running.

> So how can I wake up the device and make it available to gpsd?

You already know how to wake it up.  You prolly just forgot to run
gpsmon, and gpsd, as root.

> ser = serial.Serial(
>     port='/dev/ttyS0', #Replace ttyS0 with ttyAM0 for Pi1,Pi2,Pi0
>     baudrate = 115200,

Note: not 4,800!

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        gem@rellim.com  Tel:+1 541 382 8588

            Veritas liberabit vos. -- Quid est veritas?
    "If you can't measure it, you can't improve it." - Lord Kelvin

Attachment: pgpmrJ76PCNSZ.pgp
Description: OpenPGP digital signature


reply via email to

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