I have a USB GPS dongle using this for getting  position information. I installed gpsd daemon so that any clients can read data from that. It is working fine<div>used xgps, cgps as clients. </div><div><br></div><div><b>gpsd -n -N -D2 /dev/ttyUSB0 </b></div>
<div><br></div><div><div>import gps, os, time</div><div>g = gps.gps(mode=gps.WATCH_NEWSTYLE)</div><div>while 1:</div><div><span class="Apple-tab-span" style="white-space:pre">     </span>os.system('clear')</div><div><span class="Apple-tab-span" style="white-space:pre">   </span>g.poll()</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>#if gps.PACKET_SET:</div><div><span class="Apple-tab-span" style="white-space:pre">  </span>g.stream()</div><div><span class="Apple-tab-span" style="white-space:pre">   </span>print 'latitude ' , g.fix.latitude</div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>print 'longitude ' , g.fix.longitude</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>print 'time utc ' , g.utc,' + ', g.fix.time</div>
</div><div><br></div><div><br class="Apple-interchange-newline">Used the following program to read gps data but it is not giving accurate readings as cgps,xgps clients. I tried to read directly from the serial port using the following program but its giving non printable characters as output as it should return something like </div>
<div><br></div><div><span class="Apple-style-span" style="color:rgb(128,0,0);font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;font-size:14px;line-height:18px;white-space:pre;background-color:rgb(238,238,238)">$GPRMC,199304.973,3248.7780,N,11355.7832,W,1,06,02.2,25722.5,M,,,*00"</span><br>
</div><div><br></div><div><div><i><b>import serial</b></i></div><div><i><b>ser = serial.Serial( port='/dev/ttyUSB0', baudrate=4800,timeout=1)<span class="Apple-tab-span" style="white-space:pre">        </span></b></i></div>
<div><i><b>while True:</b></i></div><div><i><b><span class="Apple-tab-span" style="white-space:pre">    </span>line=ser.read()</b></i></div><div><i><b><span class="Apple-tab-span" style="white-space:pre">        </span>print line,</b></i></div>
<div><i><b>f.close()</b></i></div></div><div><br></div>