<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Python gpsd bindings</title>
	<link>http://www.perrygeo.net/wordpress/?p=13</link>
	<description>Matt Perry's random adventures with geospatial technology and other tangentially related topics</description>
	<pubDate>Thu, 09 Sep 2010 15:58:26 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
		<item>
		<title>By: Cédric</title>
		<link>http://www.perrygeo.net/wordpress/?p=13#comment-48067</link>
		<dc:creator>Cédric</dc:creator>
		<pubDate>Wed, 01 Sep 2010 06:35:41 +0000</pubDate>
		<guid>http://www.perrygeo.net/wordpress/?p=13#comment-48067</guid>
		<description>This code solved my problem:


#! /usr/local/bin/python
#-*- coding: utf-8 -*-
import gps, os, time
g = gps.gps(mode=gps.WATCH_NEWSTYLE)
while 1:
    os.system('clear')
    g.poll()
    if gps.PACKET_SET:
        g.stream()

    print
    print ' GPS reading'
    print '----------------------------------------'
    print 'latitude    ' , g.fix.latitude
    print 'longitude   ' , g.fix.longitude
    print 'time utc    ' , g.utc,' + ', g.fix.time
    print 'altitude    ' , g.fix.altitude
    print 'epc         ' , g.fix.epc
    print 'epd         ' , g.fix.epd
    print 'eps         ' , g.fix.eps
    print 'epx         ' , g.fix.epx
    print 'epv         ' , g.fix.epv
    print 'ept         ' , g.fix.ept
    print 'speed       ' , g.fix.speed
    print 'climb       ' , g.fix.climb
    print 'track       ' , g.fix.track
    print 'mode        ' , g.fix.mode
    print
    print 'sats        ' , g.satellites

    time.sleep(1)


It works quite well when I enable the new style mode.</description>
		<content:encoded><![CDATA[<p>This code solved my problem:</p>
<p>#! /usr/local/bin/python<br />
#-*- coding: utf-8 -*-<br />
import gps, os, time<br />
g = gps.gps(mode=gps.WATCH_NEWSTYLE)<br />
while 1:<br />
    os.system(&#8217;clear&#8217;)<br />
    g.poll()<br />
    if gps.PACKET_SET:<br />
        g.stream()</p>
<p>    print<br />
    print &#8216; GPS reading&#8217;<br />
    print &#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#8217;<br />
    print &#8216;latitude    &#8216; , g.fix.latitude<br />
    print &#8216;longitude   &#8216; , g.fix.longitude<br />
    print &#8216;time utc    &#8216; , g.utc,&#8217; + &#8216;, g.fix.time<br />
    print &#8216;altitude    &#8216; , g.fix.altitude<br />
    print &#8216;epc         &#8216; , g.fix.epc<br />
    print &#8216;epd         &#8216; , g.fix.epd<br />
    print &#8216;eps         &#8216; , g.fix.eps<br />
    print &#8216;epx         &#8216; , g.fix.epx<br />
    print &#8216;epv         &#8216; , g.fix.epv<br />
    print &#8216;ept         &#8216; , g.fix.ept<br />
    print &#8217;speed       &#8216; , g.fix.speed<br />
    print &#8216;climb       &#8216; , g.fix.climb<br />
    print &#8216;track       &#8216; , g.fix.track<br />
    print &#8216;mode        &#8216; , g.fix.mode<br />
    print<br />
    print &#8217;sats        &#8216; , g.satellites</p>
<p>    time.sleep(1)</p>
<p>It works quite well when I enable the new style mode.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anonymous</title>
		<link>http://www.perrygeo.net/wordpress/?p=13#comment-48055</link>
		<dc:creator>anonymous</dc:creator>
		<pubDate>Sun, 25 Jul 2010 00:31:37 +0000</pubDate>
		<guid>http://www.perrygeo.net/wordpress/?p=13#comment-48055</guid>
		<description>It appears that the session object has to have streaming turned on, and that it must be polled in order for it to obtain the GPS data:

#!/usr/bin/python

import gps, os, time

session = gps.gps()
session.poll()
session.stream()

while 1:
    os.system('clear')
    session.poll()
    # a = altitude, d = date/time, m=mode,
    # o=postion/fix, s=status, y=satellites

    print
    print ' GPS reading'
    print '----------------------------------------'
    print 'latitude    ' , session.fix.latitude
    print 'longitude   ' , session.fix.longitude
    print 'time utc    ' , session.utc, session.fix.time
    print 'altitude    ' , session.fix.altitude
    print 'epx         ' , session.fix.epx
    print 'epv         ' , session.fix.epv
    print 'ept         ' , session.fix.ept
    print 'speed       ' , session.fix.speed
    print 'climb       ' , session.fix.climb

    print
    print ' Satellites (total of', len(session.satellites) , ' in view)'
    for i in session.satellites:
        print '\t', i

    time.sleep(3)</description>
		<content:encoded><![CDATA[<p>It appears that the session object has to have streaming turned on, and that it must be polled in order for it to obtain the GPS data:</p>
<p>#!/usr/bin/python</p>
<p>import gps, os, time</p>
<p>session = gps.gps()<br />
session.poll()<br />
session.stream()</p>
<p>while 1:<br />
    os.system(&#8217;clear&#8217;)<br />
    session.poll()<br />
    # a = altitude, d = date/time, m=mode,<br />
    # o=postion/fix, s=status, y=satellites</p>
<p>    print<br />
    print &#8216; GPS reading&#8217;<br />
    print &#8216;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#8217;<br />
    print &#8216;latitude    &#8216; , session.fix.latitude<br />
    print &#8216;longitude   &#8216; , session.fix.longitude<br />
    print &#8216;time utc    &#8216; , session.utc, session.fix.time<br />
    print &#8216;altitude    &#8216; , session.fix.altitude<br />
    print &#8216;epx         &#8216; , session.fix.epx<br />
    print &#8216;epv         &#8216; , session.fix.epv<br />
    print &#8216;ept         &#8216; , session.fix.ept<br />
    print &#8217;speed       &#8216; , session.fix.speed<br />
    print &#8216;climb       &#8216; , session.fix.climb</p>
<p>    print<br />
    print &#8216; Satellites (total of&#8217;, len(session.satellites) , &#8216; in view)&#8217;<br />
    for i in session.satellites:<br />
        print &#8216;\t&#8217;, i</p>
<p>    time.sleep(3)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gausie</title>
		<link>http://www.perrygeo.net/wordpress/?p=13#comment-48012</link>
		<dc:creator>Gausie</dc:creator>
		<pubDate>Thu, 10 Jun 2010 15:52:31 +0000</pubDate>
		<guid>http://www.perrygeo.net/wordpress/?p=13#comment-48012</guid>
		<description>For some reason all my data comes out empty (i.e. longitude is 0, latitude is 0, no satellites) even though xgps tells me i'm connected perfectly.

is there something i'm missing?</description>
		<content:encoded><![CDATA[<p>For some reason all my data comes out empty (i.e. longitude is 0, latitude is 0, no satellites) even though xgps tells me i&#8217;m connected perfectly.</p>
<p>is there something i&#8217;m missing?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Clement</title>
		<link>http://www.perrygeo.net/wordpress/?p=13#comment-48007</link>
		<dc:creator>Steve Clement</dc:creator>
		<pubDate>Tue, 08 Jun 2010 22:06:42 +0000</pubDate>
		<guid>http://www.perrygeo.net/wordpress/?p=13#comment-48007</guid>
		<description>Dear all,

In case you arrived in the year 2010, things have indeed changed!

For the good:

&lt;code&gt;eep ;
import gps

session = gps.gps()

print session
&lt;/code&gt;

I leave it to you to "implement" the while loop and the sleep ;)

Also I had to check some terminology on the original script:

eph == Precision horizontal
epv == Precision vertical
ept == Precision total

in case you want to use the above script, it IS possible just delete the query line:

    session.query('admosy')

and amend eph to epx:

    print 'epx         ' , session.fix.epx

In full:

&lt;code&gt;
import gps, os, time

session = gps.gps()

while 1:
    os.system('clear')
    # a = altitude, d = date/time, m=mode,
    # o=postion/fix, s=status, y=satellites

    print
    print ' GPS reading'
    print '----------------------------------------'
    print 'latitude    ' , session.fix.latitude
    print 'longitude   ' , session.fix.longitude
    print 'time utc    ' , session.utc, session.fix.time
    print 'altitude    ' , session.fix.altitude
    print 'epx         ' , session.fix.epx
    print 'epv         ' , session.fix.epv
    print 'ept         ' , session.fix.ept
    print 'speed       ' , session.fix.speed
    print 'climb       ' , session.fix.climb

    print
    print ' Satellites (total of', len(session.satellites) , ' in view)'
    for i in session.satellites:
        print '\t', i

    time.sleep(3)
&lt;/code&gt;

Hack on!

Steve Clemenet</description>
		<content:encoded><![CDATA[<p>Dear all,</p>
<p>In case you arrived in the year 2010, things have indeed changed!</p>
<p>For the good:</p>
<p><code>eep ;<br />
import gps</p>
<p>session = gps.gps()</p>
<p>print session<br />
</code></p>
<p>I leave it to you to &#8220;implement&#8221; the while loop and the sleep <img src='http://www.perrygeo.net/wordpress/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Also I had to check some terminology on the original script:</p>
<p>eph == Precision horizontal<br />
epv == Precision vertical<br />
ept == Precision total</p>
<p>in case you want to use the above script, it IS possible just delete the query line:</p>
<p>    session.query(&#8217;admosy&#8217;)</p>
<p>and amend eph to epx:</p>
<p>    print &#8216;epx         &#8216; , session.fix.epx</p>
<p>In full:</p>
<p><code><br />
import gps, os, time</p>
<p>session = gps.gps()</p>
<p>while 1:<br />
    os.system('clear')<br />
    # a = altitude, d = date/time, m=mode,<br />
    # o=postion/fix, s=status, y=satellites</p>
<p>    print<br />
    print ' GPS reading'<br />
    print '----------------------------------------'<br />
    print 'latitude    ' , session.fix.latitude<br />
    print 'longitude   ' , session.fix.longitude<br />
    print 'time utc    ' , session.utc, session.fix.time<br />
    print 'altitude    ' , session.fix.altitude<br />
    print 'epx         ' , session.fix.epx<br />
    print 'epv         ' , session.fix.epv<br />
    print 'ept         ' , session.fix.ept<br />
    print 'speed       ' , session.fix.speed<br />
    print 'climb       ' , session.fix.climb</p>
<p>    print<br />
    print ' Satellites (total of', len(session.satellites) , ' in view)'<br />
    for i in session.satellites:<br />
        print '\t', i</p>
<p>    time.sleep(3)<br />
</code></p>
<p>Hack on!</p>
<p>Steve Clemenet</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: perrygeo</title>
		<link>http://www.perrygeo.net/wordpress/?p=13#comment-47963</link>
		<dc:creator>perrygeo</dc:creator>
		<pubDate>Fri, 30 Apr 2010 18:19:59 +0000</pubDate>
		<guid>http://www.perrygeo.net/wordpress/?p=13#comment-47963</guid>
		<description>Mamoru,

 You should contact the gpsd developers list for more information .. I am not personally involved in the project so I cant answer your questions about how the interface may change.</description>
		<content:encoded><![CDATA[<p>Mamoru,</p>
<p> You should contact the gpsd developers list for more information .. I am not personally involved in the project so I cant answer your questions about how the interface may change.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mamoru Yamamoto</title>
		<link>http://www.perrygeo.net/wordpress/?p=13#comment-47962</link>
		<dc:creator>Mamoru Yamamoto</dc:creator>
		<pubDate>Fri, 30 Apr 2010 18:04:24 +0000</pubDate>
		<guid>http://www.perrygeo.net/wordpress/?p=13#comment-47962</guid>
		<description>Hi,

Thank you for all information of gps.py.

Though you may know very well, I found how to connect 
to the other gpsd server over network.  It is just to start 
an application program by 

import gps
session = gps.gps(host=hostname, port='2947')

hostname should be text of the hostname or of the IP address.
To connect to the local server, hostname='localhost'.

By copying the gps.py to my WINDOWS PC, my PC can read 
data from the LINUX gpsd server over network.
Thanks for very easy programming with gps.py

I have one question.  Now it is announced that the gpsd 
command interface will be changed soon.  What will be 
the change of the gps.py interface?  Explanation of the JASON 
command interface is not very clear to me.  I am sorry.
Even some suggestions are useful.  Thanks for your help.

Mamoru Yamamoto
Kyoto University, JAPAN</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Thank you for all information of gps.py.</p>
<p>Though you may know very well, I found how to connect<br />
to the other gpsd server over network.  It is just to start<br />
an application program by </p>
<p>import gps<br />
session = gps.gps(host=hostname, port=&#8217;2947&#8242;)</p>
<p>hostname should be text of the hostname or of the IP address.<br />
To connect to the local server, hostname=&#8217;localhost&#8217;.</p>
<p>By copying the gps.py to my WINDOWS PC, my PC can read<br />
data from the LINUX gpsd server over network.<br />
Thanks for very easy programming with gps.py</p>
<p>I have one question.  Now it is announced that the gpsd<br />
command interface will be changed soon.  What will be<br />
the change of the gps.py interface?  Explanation of the JASON<br />
command interface is not very clear to me.  I am sorry.<br />
Even some suggestions are useful.  Thanks for your help.</p>
<p>Mamoru Yamamoto<br />
Kyoto University, JAPAN</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://www.perrygeo.net/wordpress/?p=13#comment-47906</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Mon, 05 Apr 2010 07:20:19 +0000</pubDate>
		<guid>http://www.perrygeo.net/wordpress/?p=13#comment-47906</guid>
		<description>Thanks for the prompt reply :) Appreciated.</description>
		<content:encoded><![CDATA[<p>Thanks for the prompt reply <img src='http://www.perrygeo.net/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> Appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: perrygeo</title>
		<link>http://www.perrygeo.net/wordpress/?p=13#comment-47905</link>
		<dc:creator>perrygeo</dc:creator>
		<pubDate>Mon, 05 Apr 2010 04:34:01 +0000</pubDate>
		<guid>http://www.perrygeo.net/wordpress/?p=13#comment-47905</guid>
		<description>Micheal, 
The gpsd python bindings appear to have changed significantly. The best bet would be to introspect/experiment with the gps object with python, consult the gpsd python source or contact the gpsd developers.</description>
		<content:encoded><![CDATA[<p>Micheal,<br />
The gpsd python bindings appear to have changed significantly. The best bet would be to introspect/experiment with the gps object with python, consult the gpsd python source or contact the gpsd developers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://www.perrygeo.net/wordpress/?p=13#comment-47904</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Mon, 05 Apr 2010 04:25:49 +0000</pubDate>
		<guid>http://www.perrygeo.net/wordpress/?p=13#comment-47904</guid>
		<description>Hi there,

I get an error when running this:

Traceback (most recent call last):
  File "", line 7, in 
AttributeError: gps instance has no attribute 'query'

Has query() been removed from gps.py?
What needs to be done to fix the above script so it works?

Thanks</description>
		<content:encoded><![CDATA[<p>Hi there,</p>
<p>I get an error when running this:</p>
<p>Traceback (most recent call last):<br />
  File &#8220;&#8221;, line 7, in<br />
AttributeError: gps instance has no attribute &#8216;query&#8217;</p>
<p>Has query() been removed from gps.py?<br />
What needs to be done to fix the above script so it works?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jens</title>
		<link>http://www.perrygeo.net/wordpress/?p=13#comment-47773</link>
		<dc:creator>Jens</dc:creator>
		<pubDate>Mon, 01 Feb 2010 14:50:19 +0000</pubDate>
		<guid>http://www.perrygeo.net/wordpress/?p=13#comment-47773</guid>
		<description>ROFL !
I just found it out all by myself...

It just has to be

s = str(session.satellites[i])

and then

print s[-1]

works as intended and gives me either "y" or "n".

I did not expect it to be THAT simple !
Now I feel a little bit ashamed...  *smile*</description>
		<content:encoded><![CDATA[<p>ROFL !<br />
I just found it out all by myself&#8230;</p>
<p>It just has to be</p>
<p>s = str(session.satellites[i])</p>
<p>and then</p>
<p>print s[-1]</p>
<p>works as intended and gives me either &#8220;y&#8221; or &#8220;n&#8221;.</p>
<p>I did not expect it to be THAT simple !<br />
Now I feel a little bit ashamed&#8230;  *smile*</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 1.833 seconds -->
