Skip to content

Commit 0e1fccf

Browse files
committed
bug fixes
1 parent 8340a3d commit 0e1fccf

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

mqtt/pages/index.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>
5+
Index
6+
</title>
7+
</head>
8+
<body>
9+
<div id="example">
10+
<ul>
11+
<li><a href="sensors.html"><span>Sensors</span></a></li>
12+
<li><a href="mqtt.html"><span>MQTT</span></a></li>
13+
<li><a href="mqttstats.html"><span>MQTT Broker Stats</span></a></li>
14+
</ul>
15+
</div>
16+
<link type="text/css" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" rel="Stylesheet" />
17+
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
18+
<script type="text/javascript" src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
19+
<script>
20+
$(function() {
21+
$("#example").tabs();
22+
});
23+
</script>
24+
</body>
25+
</html>
26+

mqtt/server.js

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ var config = require('./config.json');
1616
app.use(express.logger());
1717
app.use(express.compress());
1818

19-
app.get('/stats', function(req, res, next){
20-
console.log('This process is pid ' + process.pid + " with an uptime of " + process.uptime());
21-
console.log('Running on ' + process.platform + ' (' + process.arch + ')');
22-
});
23-
2419
app.use(express.static(__dirname + '/pages'));
2520
app.use(express.static(__dirname + '/pages/js'));
2621

@@ -31,13 +26,11 @@ app.use(function(req, res, next){
3126

3227

3328

34-
3529
server.listen(8500);
3630
console.log('listening on port 8500');
3731

3832

3933

40-
4134
io.of('/sensors').on('connection', function (socket) {
4235
// subscribe to MQTT
4336
var mqtt = require('mqtt');
@@ -84,7 +77,7 @@ io.of('/mqttstats').on('connection', function (socket) {
8477

8578
mqttclient.on('connect', function() {
8679
mqttclient.subscribe('$SYS/#');
87-
// console.log('subscribing to everything on ' + config.mqtt.host + '(' + config.mqtt.port + ')');
80+
// console.log('subscribing to $SYS on ' + config.mqtt.host + '(' + config.mqtt.port + ')');
8881

8982
mqttclient.on('message', function(topic, message) {
9083
// console.log('emitting topic: ' + topic + ' payload: ' + message);

0 commit comments

Comments
 (0)