Thanks you all, guys, for your suggestions and help. Everything now
works great :)
Regards
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
McBooCzech wrote:
> This (according to your suggestions) is my code which works for me
>
> import serial
> s = serial.Serial(port=0,baudrate=4800, timeout=20)
> while 1:
> line = s.readline()
> words = line.split(',')
> if words[0]=="$GPRMC":
> print words[1], words
On 2005-08-24, Sybren Stuvel <[EMAIL PROTECTED]> wrote:
>> import serial
>> s = serial.Serial(port=0,baudrate=4800, timeout=20)
>> while 1:
>> line = s.readline()
>> words = line.split(',')
>> if words[0]=="$GPRMC":
>> print words[1], words[3], words[5]
>>
>> I just won
McBooCzech enlightened us with:
> This (according to your suggestions) is my code which works for me
>
> import serial
> s = serial.Serial(port=0,baudrate=4800, timeout=20)
> while 1:
> line = s.readline()
> words = line.split(',')
> if words[0]=="$GPRMC":
> print wo
Sergei, I do not realy understand your comment??? Am I missing
something?
BTW, is there some possibility to address lists like:
print words [1; 3; 5]
instead of
print words[1], words[3], words[5]
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
Steve Holden <[EMAIL PROTECTED]> writes:
> McBooCzech wrote:
[...]
> > $GPRMC,174525.617,A,5026.1080,N,01521.6724,E,0.0,005.8,230805,,*0A
> > etc
> >
>
[...]
> > s = serial.Serial(port=0,baudrate=4800, timeout=20)
> > while 1:
> > line = s.readline()
> > words = line.split(',')
> >
McBooCzech wrote:
> Sorry, I did not mentioned the data flow from the serial port is
> permanent/continuous (as long as the GPS receiver is connected to the
> serial port). The input data are commning every second, they are comma
> separated and they are looking like:
>
> $GPGGA,174525.617,5026.10
Sorry, I did not mentioned the data flow from the serial port is
permanent/continuous (as long as the GPS receiver is connected to the
serial port). The input data are commning every second, they are comma
separated and they are looking like:
$GPGGA,174525.617,5026.1080,N,01521.6724,E,1,05,1.8,306
On 2005-08-23, McBooCzech <[EMAIL PROTECTED]> wrote:
import serial
s = serial.Serial(port=0,baudrate=4800, timeout=20)
s.readline()
> '$GPRMC,101236.331,A,5026.1018,N,01521.6653,E,0.0,328.1,230805,,*09\r\n'
>
> my next intention was to do something like this:
>
> import csv
> r = cs
McBooCzech wrote:
> So do I have to save to the file first and analyze later on?
Certainly not.
> Or there is an other way how to process it (read from the serial and
> analyze data) on the fly?
I've never used py-serial, so I was hoping someone else would jump in
with the best way to do this
So do I have to save to the file first and analyze later on?
Or there is an other way how to process it (read from the serial and
analyze data) on the fly?
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
McBooCzech wrote:
> r = csv.reader(s.readline())
csv.reader expects an iterable, not a str.
--
Michael Hoffman
--
http://mail.python.org/mailman/listinfo/python-list
Hi
I am just trying to analyze (parse) data from the serial port (I have
connected GPS receiver to the ttyS0, so I can read ASCII characters in
the CSV form on the serial port 1).
I am doing this just to understand how Python works (yes, you can call
me Python/Linux newbie :)
My environment is Fedo
13 matches
Mail list logo