summaryrefslogtreecommitdiff
path: root/robot.js
diff options
context:
space:
mode:
Diffstat (limited to 'robot.js')
-rw-r--r--robot.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/robot.js b/robot.js
index 5c259fe..f318441 100644
--- a/robot.js
+++ b/robot.js
@@ -1,5 +1,4 @@
-const mqtt = require("mqtt");
-const client = mqtt.connect("mqtt://marcelus.net");
+const client = mqtt.connect("ws://marcelus.net:9001");
function wait(ms)
{
@@ -47,18 +46,19 @@ async function moveTo(x,y)
}
-client.on('connect', function () {
+client.on('connect', () => {
+ console.log(client)
console.log('Connecté au courtier MQTT');
- client.subscribe('move');
- client.publish('move','ULT1')
+ client.subscribe('move')
+ moveTo(1000,1000)
});
+// client.publish('move','ULT1')
-client.on('message', function (topic, message) {
+/* client.on('message', function (topic, message) {
console.log('Received from ', topic, ' : ', message.toString());
-});
+}); */
-client.on('close', function () {
+/* client.on('close', function () {
console.log('Déconnecté du courtier MQTT');
-});
+});*/
-moveTo(1000,1000) \ No newline at end of file