Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switchbot Bot FW v6.6 not being found #237

Closed
ErdbeerbaerLP opened this issue Apr 4, 2024 · 2 comments
Closed

Switchbot Bot FW v6.6 not being found #237

ErdbeerbaerLP opened this issue Apr 4, 2024 · 2 comments
Assignees
Labels
bug Something isn't working stale

Comments

@ErdbeerbaerLP
Copy link

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

  1. Have a bot with firmware version 6.6
  2. Run some code from the Readme
  3. 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

  1. Have a bot with firmware version 6.6
  2. Run some code from the Readme
  3. ...
  4. 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:
    • node-switchbot@2.0.3
    • @abandonware/noble@1.9.2-24
    • @abandonware/bluetooth-hci-socket@0.5.3-11
  • Node: 18.17.1
  • npm: 10.2.5

Additional Context

Relevant issue (german): mrbungle64/ioBroker.switchbot-ble#431

Copy link

github-actions bot commented May 4, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label May 4, 2024
Copy link

github-actions bot commented May 9, 2024

This issue has been closed as no further activity has occurred.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

6 participants