I thought if I was to have my server do one thing at a time...
Load values from the arduino into a .csv file a text file that can be loaded into a mysql database by a script from multiple arduinos.
I searched and found com ports or seiral ports show up in /dev/USB# in linux /dev/USB0 was my first because I didn't have any other serial port devices that showed up as USB... FTDI...
But I had the arduino start at 0 and count.. but I am missing values... when I select it to it seems to load the value in in time... but maby the arduino loads the com port register before the computer pulls it off...
Or the script does not take a single line it takes 24 lines and only prints the first one?
I was hoping I could have a arduino port /dev/ttyUSB# >> comma seperated list....
could it do this as a background process?
in this format
time stamp, sample1,sample2....
But to do that I would need the program to load the results from one line one sample then put it in a vareable get it from eatch then put them together & print.
If I just pointed it directly would I miss that much data?
#!/bin/bash
this is the arduino logger
#hook up 4 arduino's and 4 bash files
echo "the arduino logger v2"
#initilise ports from playground example & form post
stty -F /dev/ttyUSB0 cs8 115200 ignbrk -brkint -icrnl -imaxbel -opost
-onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke
noflsh -ixon -crtscts -clocal
#loop
number=0
sline=0
while [ $number -lt 10 ]; do
#get info from port from arduino playground & form post . form post
runs once... >> does not overwrite
#linuxcomand.org Assigning a command's result to a variable
com1=$(tail -f /dev/ttyUSB0|head -n 2|tail -n 1)
#format strings
sline="timestamp , $number, arduino 1, $com1"
echo $sline >> eeg_log.csv
echo $sline
number=$((number + 1))
done
timestamp 0 arduino 1 1825
timestamp 1 arduino 1 1845
timestamp 2 arduino 1 1865
timestamp 3 arduino 1 1884
timestamp 4 arduino 1 1904
timestamp 5 arduino 1 1924
timestamp 6 arduino 1 1944
timestamp 7 arduino 1 1964
timestamp 8 arduino 1 1984
timestamp 9 arduino 1 2004