Skip to content

Instantly share code, notes, and snippets.

@avirup171
Created October 5, 2019 07:11
Show Gist options
  • Save avirup171/8abcbb0cc885471b959b000857c65c0e to your computer and use it in GitHub Desktop.
Save avirup171/8abcbb0cc885471b959b000857c65c0e to your computer and use it in GitHub Desktop.
<html>
<head>
<title>VAMS</title>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/socket.io/1.3.6/socket.io.min.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
var socket = io.connect('http://' + document.domain + ':' + location.port);
socket.on('mqtt_message', function(data) {
console.log(data);
var text = '(' + data['topic'] + ' qos: ' + data['qos'] + ') ' + data['payload'];
var tempjsdata=data['payload'].replace(/'/g,'"')
console.log(tempjsdata)
var jsondata=JSON.parse(tempjsdata)
$('#speed').html(jsondata.speed)
$('#rpm').html(jsondata.rpm)
})
});
</script>
</head>
<body>
<h1>VAMS - PoC V0.0.1</h1>
<img id="bg" src="{{ url_for('video_feed') }}">
<table style="width: 30%">
<tr>
<th>
Speed
</th>
<th>
RPM
</tr>
<tr>
</th>
<th id="speed">
0
</th>
<th id="rpm">
0
</th>
</tr>
</table>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment