Hello! I have an issue with connecting to the hub sometimes. Around every other time, I get the following error message below. Do you have any clue what could be the problem?
Thanks!
(Piece of code used to connect to hub)
poweredUP.scan(); // Start scanning for Hubs
console.log("Scanning for Hubs...");
poweredUP.on("discover", async (hub) => {
await hub.connect();
});
TypeError: Cannot read property 'on' of undefined
at NobleDevice.subscribeToCharacteristic (/home/apclinux/vcontr/node_modules/node-poweredup/dist/node/nobleabstraction.js:89:37)
at TechnicMediumHub.connect (/home/apclinux/vcontr/node_modules/node-poweredup/dist/node/hubs/lpf2hub.js:43:25)
at async TechnicMediumHub.connect (/home/apclinux/vcontr/node_modules/node-poweredup/dist/node/hubs/technicmediumhub.js:48:9)
at async PoweredUP. (/home/apclinux/vcontr/vcontr.js:141:17)
Hello! I have an issue with connecting to the hub sometimes. Around every other time, I get the following error message below. Do you have any clue what could be the problem?
Thanks!
(Piece of code used to connect to hub) poweredUP.scan(); // Start scanning for Hubs console.log("Scanning for Hubs..."); poweredUP.on("discover", async (hub) => { await hub.connect(); });
/home/apclinux/vcontr/node_modules/node-poweredup/dist/node/nobleabstraction.js:89 this._characteristics[uuid].on("data", (data) => { ^
TypeError: Cannot read property 'on' of undefined at NobleDevice.subscribeToCharacteristic (/home/apclinux/vcontr/node_modules/node-poweredup/dist/node/nobleabstraction.js:89:37) at TechnicMediumHub.connect (/home/apclinux/vcontr/node_modules/node-poweredup/dist/node/hubs/lpf2hub.js:43:25) at async TechnicMediumHub.connect (/home/apclinux/vcontr/node_modules/node-poweredup/dist/node/hubs/technicmediumhub.js:48:9) at async PoweredUP. (/home/apclinux/vcontr/vcontr.js:141:17)