2 # logs the last line. usable via nohup on the server
4 # run this script as follows:
5 # $ nohup ./usb-wde1-log-last.sh &
7 # Use --dummy-data as parameter to log dummy data only
9 # License: http://www.gnu.org/licenses/agpl.html AGPL
10 # Author: Christian Weiske <cweiske@cweiske.de>
12 # FIXME: send RESET or INIT and M2
14 curdir="$(dirname "$0")"
15 if [ "$1" = "--dummy-data" ]; then
16 $curdir/../dummy-data-generator.php\
17 | $curdir/log-single-line.sh /tmp/usb-wde1-last
19 if [ ! -r /dev/ttyUSB0 ]; then
20 echo "Device /dev/ttyUSB0 is not readable"
24 #socat breaks something that leads to
25 # WRONG VAL, WRONG CMD and FullBuff->Reset
27 #socat /dev/ttyUSB0,b9600 STDOUT\
30 cu -l /dev/ttyUSB0 -s 9600\
31 | $curdir/log-single-line.sh /tmp/usb-wde1-last