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
  #6  
Old 06-21-2010, 05:54 PM
wayne wayne is offline
Member
 
Join Date: May 2008
Location: Santa Barbara, CA
Posts: 9
Thumbs up

I had a look at your code below. The problem is that you are opening up the serial port, reading a line, and then closing the port. Then it is reopened when you go through the while loop. You should not repeatedly open and close a serial port, it should just be opened once, and then you can call readline() within the while loop.

Also, the readSerial() code I included earlier was cut and pasted out of a class that I had written for myself. So it defined a method called readSerial(), but if you fix up your previous code with the suggestion I made then it should work well.


Quote:
Originally Posted by nige777 View Post
Ok, I am back in the office.


The code I have been using to connect to the GPS is as follows:
Code:
while 1:
	ser = serial.Serial(port=0, baudrate=4800, timeout=0)
	line = ser.readline()
	print line  #DEBUG
	ser.close()
"line" is then passed to a parser which has been developed with the aid of a text file of a GPS output (NMEA).
I've included two text files - GPS DUMP is what is received when the GPS is outputting NMEA sentences and the TXT file shows what is received when the GPS unit is outputting text only.

I really like your buffer method but am at a loss on how to implement it
I am off to pour over the documentation for PySerial again as I am sure I'm missing something obvious
Reply With Quote
 


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:31 AM.


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