gpsd-users
[Top][All Lists]
Advanced

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

Re: Sending commands to device while gpsd is running


From: Filip Kubicz
Subject: Re: Sending commands to device while gpsd is running
Date: Fri, 15 Apr 2022 23:46:54 +0200
User-agent: Zoho Mail

Hi Gary,

Thank you for reply.

> I've already pointed you to tools, like zerk, ubxtool, gpsmon, that send
to the receiver. You just need to fix your code. The code I last saw
was not implelemnting the protocol properly, thus the null result you
are getting.

Do you mean gpsd wire protocol? So which is the format of command that client should send to gpsd to get it shuttled to device? https://gpsd.gitlab.io/gpsd/gpsd.html#_gps_device_management

!<device_name>=<text_control_string>\n
Example:
!/dev/ttyGPS0=$PQTMVEHMSG,2,0,0,1*3D\x0d\x0a

Correct?

Looking at ubxtool I think it directly sends the gps_send() data via serial, not via gpsd:
https://gitlab.com/gpsd/gpsd/-/blob/master/gps/ubx.py#L8028

Is my understanding correct?

Kind regards,
Filip

filip@kubicz.engineer
tel. (+48) 697 088 078


---- On Fri, 15 Apr 2022 20:17:12 +0200 gem@rellim.com wrote ----

Yo Filip!

On Fri, 15 Apr 2022 11:49:03 +0200
Filip Kubicz <filip@kubicz.engineer> wrote:

> No debugging of the receiver is needed. I know it works when I send a
> certain UART payload. I just want to achieve the same payload to be
> sent through gpsd, to avoid contending with gpsd for serial port
> access.

Already understood.

> gps_send() unfortunately only sends the buffer from client to gpsd,
> but gpsd doesn't forward the buffer to the device.

Yes, the way you do it. But it does work when properly coded.

> From inspecting gpsctl, I see that gpsctl "low-level mode" means
> "bypass gpsd". And it doesn't have a way to write to the device
> through gpsd. gpsctl uses session.device_type->control_send() to ship
> the control message. But it must be called from within gpsd session,
> not from a client using libgps. Similar thing (I think) could be
> achieved by modifying handle_gpsd_request() to actually ship the
> buffer to the device if it has a certain format.

No code changes needed, at least on the gpsd side.

People send data to their receiver through gpsd all the time.

> So I guess I have to write to the serial port outside gpsd and make
> sure I'm not doing it in the initial setup phase when gpsd might be
> sending some commands to the device.

This is common. Send your commands, your way, then start gpsd. Other
approaches also work.

> If there is another method to
> achieve sending a control message to a device from a client, please
> advise.

I've already pointed you to tools, like zerk, ubxtool, gpsmon, that send
to the receiver. You just need to fix your code. The code I last saw
was not implelemnting the protocol properly, thus the null result you
are getting.

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


reply via email to

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