-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsensor.php
71 lines (53 loc) · 1.72 KB
/
sensor.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script src="main.js"></script>
<script src="key.js"></script>
<script type="text/javascript" src="webcam.js"></script>
<script>
function isko_bolo(line){
console.log("check");
var msg = new SpeechSynthesisUtterance(line);
window.speechSynthesis.speak(msg);
}
function test(msg){
document.write(msg);
}
</script>
</head>
<body>
<?php
$page = $_SERVER['PHP_SELF'];
$sec = "3";
//header("Refresh: $sec; url=$page");
//$output = shell_exec('sudo chmod a+rw /dev/ttyACM1');
//$output = shell_exec('sudo -u root -S chmod a+rw /dev/ttyACM1 < ~/.sudopass/sudopass.secret');
//echo "<pre>$output</pre>";
$output = shell_exec('cat -v < /dev/ttyACM0 | tr "\n" " "');
echo $output;
echo "<script>isko_bolo('". $output ."');";
echo "</script>";
//echo '<script> console.log("'.$output.'"); </script>';
//$output = shell_exec('sudo chmod a+rw /dev/ttyACM0');
//$output = shell_exec('sudo -u root -S chmod a+rw /dev/ttyACM0 < ~/.sudopass/sudopass.secret');
//echo "<pre>$output</pre>";
//$output = str_replace(array("\r", "\n"), '', $output);
$output = shell_exec('cat -v < /dev/ttyACM0 | tr "\n" " "');
echo $output;
//$output = mysql_real_escape_string($output);
echo "<script>isko_bolo('". $output ."');";
echo "</script>";
echo $output;
//isko_bolo($output);
//echo $output;
//$hh = $output;
//echo '<script> console.log("'.$output.'"); </script>';
//echo '<script> test("txtUsername"); </script>';
//echo '<script> isko_bolo('. $output . '); </script>';
$h = "hello";
//echo '<script> console.log("'.$h.'"); </script>';
?>
</body>
</html>