add temperature to log file
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 1 Mar 2017 13:50:17 +0000 (14:50 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 1 Mar 2017 13:50:17 +0000 (14:50 +0100)
serial.pl

index dd409e5..4f60390 100755 (executable)
--- a/serial.pl
+++ b/serial.pl
@@ -41,8 +41,12 @@ while (1) {
                                $chr++;
                        $ascii 
 =cut
+
+               my $temp = `curl localhost:3000/temp.txt`;
+               $temp =~ s/\s+/ /gs;
+
                #printf "%s %2d  %s\n", time(), $len, $hex;
-               printf "%8.4f %6.2f %2d  %s\n", $ts, $ts - $t, $len, $hex;
+               printf "%8.4f %6.2f %2d  %s | %s\n", $ts, $ts - $t, $len, $hex, $temp;
                $t = time();
        }
 }