[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Streaming Serial Octave
From: |
inertialwave |
Subject: |
Re: Streaming Serial Octave |
Date: |
Sat, 2 Aug 2014 16:54:45 -0700 (PDT) |
Thanks for the answers; I am still investigating but Instrument-Control
within Octave on cygwin is certainly convenient to use; your native Windows
version would be even more convenient :) Wish I could help.
For the record here is a quick cygwin result using the 500 Hz BT serial data
source.
The 15 byte binary data sample protocol is
[$(36) | count(0-199) | followed by 12 bytes of data | \n (10) ]
octave:349> sp = serial("/dev/ttyS23",115200,timeout=3)
sp = 3
octave:350> N=30*500;tic; data = srl_read(sp,N*15);toc
Elapsed time is 28.7106 seconds. %should be >30 sec.??
...
octave:382> disp(data(1:15))
214 0 58 0 3 10 36 92 252 160 0 8 58 24 255
octave:385> for
n=[0:10,30:50],disp([n,data(7+n*15),data(8+n*15),data(9+n*15)]),end
0 36 92 252
1 36 93 252
2 36 94 252
3 36 95 252
4 36 96 252
5 36 97 253
6 36 98 253
7 36 99 252
8 36 100 252
9 36 101 253
10 36 102 252
30 36 122 253
31 36 123 252
32 36 124 253
33 36 125 253
34 36 126 252
35 36 127 252
36 36 72 252 %144 samples gap
37 36 73 252
38 36 74 252
39 36 75 252
40 10 36 89 %14 sample gap + 1 byte shift
41 10 36 90
42 10 36 91
43 10 36 92
44 10 36 93
45 10 36 94
46 10 36 95
47 10 36 96
48 10 36 97
49 10 36 98
50 10 36 99
As you can see, there still appear to be drop outs in the received data and
tic:toc shows <30 sec. (I can't explain this.) I am experimenting with a
line by line reader with a pause inserted to net ~2 ms line total.
Similar Python reading of the same BT device shows no drop outs over 30 sec
and tic:toc is a fraction over 30 sec. Python's ability to read what is in
receive buffer (serial.Serial.inWaiting) seems to provide the best
reliability with this source, although, native Octave (e.g. fgets(sp) in a
loop to read line by line) is just about as good with wired serial devices.
--
View this message in context:
http://octave.1599824.n4.nabble.com/Streaming-Serial-Octave-tp4665537p4665897.html
Sent from the Octave - General mailing list archive at Nabble.com.
- Re: Aw: Re: Streaming Serial Octave, (continued)
- Re: Aw: Re: Streaming Serial Octave, inertialwave, 2014/08/01
- Re: Aw: Re: Streaming Serial Octave, inertialwave, 2014/08/01
- Re: Aw: Re: Streaming Serial Octave, Marco Atzeri, 2014/08/01
- Re: Aw: Re: Streaming Serial Octave, inertialwave, 2014/08/01
- Re: Aw: Re: Streaming Serial Octave, inertialwave, 2014/08/01
- Re: Aw: Re: Streaming Serial Octave, Marco Atzeri, 2014/08/01
- Re: Aw: Re: Streaming Serial Octave, inertialwave, 2014/08/01
- Pkg uninstalled all packages, can't reinstall, Allen.Windhorn, 2014/08/01
Re: Aw: Re: Streaming Serial Octave, inertialwave, 2014/08/01