diff --git a/mods/bambu/init.js b/mods/bambu/init.js index 4d4f42b2..4ba6c159 100644 --- a/mods/bambu/init.js +++ b/mods/bambu/init.js @@ -36,7 +36,7 @@ module.exports = async (server) => { let request = this.#topic_request = `device/${serial}/request`; // util.log({ report, request }); client.subscribe(report, (err) => { - util.log('mqtt_subd', this.#serial, err); + util.log('mqtt sub', this.#serial, err || "ok"); onready(this); this.keepalive(); }); @@ -61,7 +61,7 @@ module.exports = async (server) => { async send(msg) { if (this.#client) { - util.log('mqtt_send', this.#serial, msg); + util.log('mqtt send', this.#serial, msg); this.#client.publish(this.#topic_request, JSON.stringify(msg)); this.keepalive(); return true; @@ -146,7 +146,7 @@ module.exports = async (server) => { const list = []; try { list.push(...(await client.list())); - // list.push(...(await client.list("/cache"))); + list.push(...(await client.list("/cache"))); } finally { client.close(); } @@ -230,7 +230,7 @@ module.exports = async (server) => { server.ws.register("/bambu", function(ws, req) { wsopen.push(ws); - util.log('ws open', wsopen.length, req.url); + util.log('ws open', req.url, wsopen.length); ws.on('message', msg => { msg = JSON.parse(msg); let { cmd, host, code, serial } = msg; diff --git a/mods/package.json b/mods/package.json index 6f642263..4c555092 100644 --- a/mods/package.json +++ b/mods/package.json @@ -9,7 +9,7 @@ "url": "https://github.com/gridspace/apps.git" }, "dependencies": { - "basic-ftp": "^5.0.5", + "@gridspace/basic-ftp": "^5.0.5", "mqtt": "^5.10.3" } }