From: Jan Michel Date: Thu, 2 Nov 2017 17:04:12 +0000 (+0100) Subject: add some stty settings, add delay to work on raspi X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=bb57392445762572730e1c683415b4e66db9e108;p=labtools.git add some stty settings, add delay to work on raspi --- diff --git a/powersupplies/web/htdocs/pwr.pl b/powersupplies/web/htdocs/pwr.pl index 561678d..06f2a6c 100755 --- a/powersupplies/web/htdocs/pwr.pl +++ b/powersupplies/web/htdocs/pwr.pl @@ -57,7 +57,8 @@ if($ser_dev =~ /^IP(.*)/) { # } else { if ($ser_speed != 0){ - my $command = "stty -F $ser_dev speed $ser_speed"; + my $command = "stty -F $ser_dev speed $ser_speed -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke"; + print stderr "$command\n"; $command .= " -ixoff " if $ser_type eq 'PSP'; my $res = qx($command); } @@ -173,7 +174,7 @@ sub HMP_serial { my $x = getValue($fh,$command,$cnt++); $x =~ s/\&//; print $x."&" if $command =~ /\?/; - usleep(40000) if $ser_type eq "PST"; + usleep(40000);# if $ser_type eq "PST"; } close $fh; return; @@ -221,7 +222,7 @@ sub serial_rw { sub getValue { my ($fh,$cmd,$cnt,$forceread) = @_; - if (0 && defined $db->{$cmd.$cnt}{tim} && $db->{$cmd.$cnt}{tim} > time()-2) { + if (0 && defined $db->{$cmd.$cnt}{tim} && $db->{$cmd.$cnt}{tim} > time()-10) { return $db->{$cmd.$cnt}{val}; } else {