Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

a bash data logger that reads from many arduino's to csv
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

a bash data logger that reads from many arduino's to csv

by josheeg on Thu Apr 23, 2009 4:47 pm

a bash data logger that reads from many arduino's to csv would be great I got bits and pieces of information on this but am surprised nowone else did it yet. I wondering why my search can't find it.

Read from arduino 0
Read from arduino 1
Read from arduino 2
...

print to csv file...
josheeg
 
Posts: 213
Joined: Wed Jan 16, 2008 8:38 am

Re: a bash data logger that reads from many arduino's to csv

by franklin97355 on Thu Apr 23, 2009 11:52 pm

Sounds like a project you could do.

franklin97355
 
Posts: 21561
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: a bash data logger that reads from many arduino's to csv

by niksun on Fri Apr 24, 2009 9:30 am

That should be fairly easy.
Niksun

If you thought before that science was certain--well, that is just an error on your part. -- Richard Feynman
niksun
 
Posts: 202
Joined: Sun Jul 27, 2008 9:59 pm

Re: a bash data logger that reads from many arduino's to csv

by josheeg on Fri Apr 24, 2009 9:50 am

I do not have a problem writing to a text file with a script..
echo "hello world" >> test.txt
the >> makes it append if the file is their...
it also works if I tipe in a command....
ls >> test.txt
now I know /dev/ttl# is supposded to be com ports and the # is the number of them.
The virtual com port could be slightly different...

I am using ubuntu linux in root so I can talk on the com port without any privlages problems.

So it loops
counts numbers...
the numbers replace the # after tty... starting at 0
/dev/tty$comnumber

cat I herd might work I duno how to use it.
>> seems like it might work I need 3 bytes from eatch com port...
their will be 3 or more arduinos...
josheeg
 
Posts: 213
Joined: Wed Jan 16, 2008 8:38 am

Re: a bash data logger that reads from many arduino's to csv

by mtbf0 on Fri Apr 24, 2009 3:32 pm

ought to be pretty easy to code up using processing. while you're saving the data you could probably plot it, too.
"i want to lead a dissipate existence, play scratchy records and enjoy my decline" - iggy pop, i need more
User avatar
mtbf0
 
Posts: 1645
Joined: Sat Nov 10, 2007 12:59 am
Location: oakland ca

Re: a bash data logger that reads from many arduino's to csv

by josheeg on Fri Apr 24, 2009 3:46 pm

I agree it was quite easy in processing and allow plotting and going to a comma seperated list ...
But their is a problem I have a ads1256 analog to digital converter that outputs 30K of 24 bit conversions and I want to keep that speed...
I setup a prosessing program and the draw loop refreshes the screen or something lowering the number of writes a lot.
I threw a infinite loop inside the draw loop and then it went up a lot faster....

But then I had no way to exit the program...

If I forced a quit then that worked but proably is not a good practice.

this might take a single byte at a time and put it in a vareable

/dev/ttyS0 > $com1byte1
/dev/ttyS0 > $com1byte2
/dev/ttyS0 > $com1byte3

shift the larger byte
shift the other larg byte
add them together

then output it to the comma seperated value file

echo $com1word+','+>>test.csv
their proably is a print line one that is better...

so I could cycle through com ports and multiple arduino's dumping eatch to its own colum of the text file...
/dev/ttyS1 > $com2byte3

after this is done 6K times so it fits in a spread sheet...

load to mysql database for further processing and picture or svg or csv for processed graph output. Now it could be done on a monitor - less server for more processing...
josheeg
 
Posts: 213
Joined: Wed Jan 16, 2008 8:38 am

Re: a bash data logger that reads from many arduino's to csv

by niksun on Fri Apr 24, 2009 7:55 pm

You should always consider input as coming in from stdin and output going to stdout. This way anyone can use your bash script and determine the where with respect to I/O. Simple OS redirection of stdin and stdout at the command line the suffices. Your script just needs to get input from stdin a-la "while read x" or something like it.
Niksun

If you thought before that science was certain--well, that is just an error on your part. -- Richard Feynman
niksun
 
Posts: 202
Joined: Sun Jul 27, 2008 9:59 pm

Please be positive and constructive with your questions and comments.