Closed as not planned
Description
Analysis
I have recently ordered an switchbot bot and tired to use it using an IOBroker module, which uses this library.
However, it does not seem to be found at all.
After testing with just the library and some code from the readme, expecting it to be found there.
It seems that the issue comes from this library.
The main difference we have found is a different firmware version of the bot. Maybe it is a new revision as well.
So my guess would be that the new revision and/or firmware version is different enough to not be found by this library.
Code I used for testing:
// Load the node-switchbot and get a `Switchbot` constructor object
import('node-switchbot').then(({ SwitchBot }) => { //Adjusted, as require() was not applicable for me
// Create a `Switchbot` object
const switchbot = new SwitchBot();
// Load the node-switchbot and get a `Switchbot` constructor object
// Start to monitor advertisement packets
switchbot
.startScan()
.then(() => {
// Set an event handler
switchbot.onadvertisement = (ad) => {
console.log(JSON.stringify(ad, null, " "));
};
// Wait 10 seconds
return switchbot.wait(10000);
})
.then(() => {
// Stop to monitor
switchbot.stopScan();
process.exit();
});
}).catch(err => {
console.error('Error importing node-switchbot:', err);
});
Expected Behavior
- Have a bot with firmware version 6.6
- Run some code from the Readme
- Get a result like this one from the readme
(sample)
{
"id": "c12e453e2008",
"address": "c1:2e:45:3e:20:08",
"rssi": -61,
"serviceData": {
"model": "H",
"modelName": "WoHand",
"mode": true,
"state": false,
"battery": 100
}
}
Steps To Reproduce
- Have a bot with firmware version 6.6
- Run some code from the Readme
- ...
- Get absolutely no result
Logs
pi@raspi:/opt/iobroker $ sudo hcitool dev
Devices:
hci0 E8:48:B8:C8:20:00
pi@raspi:/opt/iobroker $ node test.js
pi@raspi:/opt/iobroker $ node test.js
pi@raspi:/opt/iobroker $ node test.js
pi@raspi:/opt/iobroker $ sudo node test.js
pi@raspi:/opt/iobroker $ sudo node test.js
pi@raspi:/opt/iobroker $
Configuration
n/a
Environment
- OS: Raspbian 11 (bullseye)
- Software:
- [email protected]
- @abandonware/[email protected]
- @abandonware/[email protected]
- Node: 18.17.1
- npm: 10.2.5
Additional Context
Relevant issue (german): mrbungle64/ioBroker.switchbot-ble#431