WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 06-16-2010, 11:13 AM
wayne wayne is offline
Member
 
Join Date: May 2008
Location: Santa Barbara, CA
Posts: 9
Hi there,

If you could give us a little more information then I think we can solve this problem for you, I have written a GPS parser myself using PySerial and it works fine for me.

You mention that there are a lot of weird characters. Can you give us a sample so we can see what you are getting?

Are you polling the serial port at a fast enough rate? Are you checking for cases where there is no data to be read in?

When you initialize pySerial, make sure you set the timeout to 0, and obviously the COM and Baud Rate to the correct values.

To read in data:

def readSerial(self):
buf = self.serial.read(4096)
if len(buf) > 0:
print "Read serial - %d bytes" % (len(buf), buf)
self.incoming += buf

Note that you should read in more than one byte at a time, to improve performance. You should call readSerial() every time Vizard refreshes the display. Also, you need to read everything into a buffer, and keep reading until you have a complete line terminated with a \r or \n character. Once you have this, process the string up to the line terminator. You may have other characters after the line terminator, so keep them because they will form part of the next NMEA sentence.

Please give the above suggestions a try, and if you are still stuck then please send us some code and data samples and we might be able to spot something in there.

regards,
Wayne
Reply With Quote
 

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
serial port with vizard Moh200jo Vizard 3 03-13-2009 04:21 PM
A simple Plug_in for reading data from serial port sled Plug-in development 0 08-12-2003 10:52 AM


All times are GMT -7. The time now is 06:28 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC