Code Monkey home page Code Monkey logo

Comments (10)

SSutherland94 avatar SSutherland94 commented on July 19, 2024 2

Worked like a charm! Used delay: 5000. I can go back to nightly reboots and easy-open shades now. Thanks!

from homebridge-switchbot-for-mac.

zizi4n5 avatar zizi4n5 commented on July 19, 2024

If BLE initialization is not completed when Homebridge starts up, Mac and SwitchBot connection seems to be failing.

from homebridge-switchbot-for-mac.

SSutherland94 avatar SSutherland94 commented on July 19, 2024

Do you happen to know of any way I can modify that? Or is this out of our hands

from homebridge-switchbot-for-mac.

zizi4n5 avatar zizi4n5 commented on July 19, 2024
[5/31/2020, 6:10:49 AM] Homebridge is running on port 51745. (node:467)
  UnhandledPromiseRejectionWarning: Error: send ENETUNREACH 255.255.255.255:987
    at doSend (dgram.js:697:16)
    at defaultTriggerAsyncIdScope (internal/async_hooks.js:296:12) 
    at afterDns (dgram.js:643:5) 
    at processTicksAndRejections (internal/process/task_queues.js:85:21) (node:467) 

  UnhandledPromiseRejectionWarning: Unhandled promise rejection. 
                                    This error originated either by throwing inside of an async function without a catch block, 
                                    or by rejecting a promise which was not handled with .catch(). 
                                    To terminate the node process on unhandled promise rejection, 
                                    use the CLI flag --unhandled-rejections=strict(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). 
                                    (rejection id: 1) (node:467) 

  [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. 
                                In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. (node:467) 

  UnhandledPromiseRejectionWarning: Error: Failed to initialize the Noble object: unknown at Noble.<anonymous> (/usr/local/lib/node_modules/homebridge-switchbot-for-mac/node_modules/node-switchbot/lib/switchbot.js:172:23) 
    at Object.onceWrapper (events.js:417:26) 
    at Noble.emit (events.js:322:22) 
    at Noble.onStateChange (/usr/local/lib/node_modules/homebridge-switchbot-for-mac/node_modules/@abandonware/noble/lib/noble.js:87:8) 
    at NobleMac.emit (events.js:310:20) (node:467) 

  UnhandledPromiseRejectionWarning: Unhandled promise rejection. 
                                    This error originated either by throwing inside of an async function without a catch block, 
                                    or by rejecting a promise which was not handled with .catch(). 
                                    To terminate the node process on unhandled promise rejection, 
                                    use the CLI flag--unhandled-rejections=strict(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). 
                                    (rejection id: 2) (node:467) 
  UnhandledPromiseRejectionWarning: Error: Failed to initialize the Noble object: unknown at Noble.<anonymous> (/usr/local/lib/node_modules/homebridge-switchbot-for-mac/node_modules/node-switchbot/lib/switchbot.js:172:23) 
    at Object.onceWrapper (events.js:417:26) at Noble.emit (events.js:322:22) 
    at Noble.onStateChange (/usr/local/lib/node_modules/homebridge-switchbot-for-mac/node_modules/@abandonware/noble/lib/noble.js:87:8) 
    at NobleMac.emit (events.js:310:20) (node:467) 
  
  UnhandledPromiseRejectionWarning: Unhandled promise rejection. 
                                    This error originated either by throwing inside of an async function without a catch block, 
                                    or by rejecting a promise which was not handled with .catch(). 
                                    To terminate the node process on unhandled promise rejection, 
                                    use the CLI flag--unhandled-rejections=strict(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). 
                                    (rejection id: 3) 

[5/31/2020, 6:10:49 AM] [Config]Homebridge Config UI X v4.21.0 is listening on :: port 8581 (node:467) 

  UnhandledPromiseRejectionWarning: Error: send ENETUNREACH 255.255.255.255:987 
    at doSend (dgram.js:697:16) 
    at defaultTriggerAsyncIdScope (internal/async_hooks.js:296:12) 
    at afterDns (dgram.js:643:5) 
    at processTicksAndRejections (internal/process/task_queues.js:85:21) (node:467) 
 
  UnhandledPromiseRejectionWarning: Unhandled promise rejection. 
                                    This error originated either by throwing inside of an async function without a catch block, 
                                    or by rejecting a promise which was not handled with .catch(). 
                                    To terminate the node process on unhandled promise rejection, 
                                    use the CLI flag--unhandled-rejections=strict(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4) 
                                  
[5/31/2020, 6:10:51 AM] [Spidey PS4] Found device [Spidey PS4] 
[5/31/2020, 6:10:51 AM] [Spidey PS4] Finish searching accessories 
[5/31/2020, 7:56:07 PM] [Blinds] Turning on... 
[5/31/2020, 7:56:07 PM] [Blinds] WoHand (cf:a4:99:de:b5:88) was failed turning on

Error: Failed to initialize the Noble object

This error is the same error as the following Issue, so it seems to be caused by the fact that it is still running before Bluetooth initialization.

futomi/node-beacon-scanner#1

For this reason, I'm looking into how to wait out the Bluetooth initialization process.

from homebridge-switchbot-for-mac.

SSutherland94 avatar SSutherland94 commented on July 19, 2024

Thanks for looking into this! Hope a resolution can be found eventually!

from homebridge-switchbot-for-mac.

zizi4n5 avatar zizi4n5 commented on July 19, 2024

@SSutherland94
I added a delay option to wait for Bluetooth initialization.
Can you check if this can be worked around?
https://github.com/zizi4n5/homebridge-switchbot-for-mac#how-to-use

from homebridge-switchbot-for-mac.

SSutherland94 avatar SSutherland94 commented on July 19, 2024

Didn’t want to leave you hanging, but I’ll gladly test this out once I’m home. Should hear back from me around 8 hours from now

from homebridge-switchbot-for-mac.

zizi4n5 avatar zizi4n5 commented on July 19, 2024

Using version 0.0.12, delay is set to a value between 0 and 30,000 milliseconds. Please try.
It is possible to specify more than 30000ms, but in my tests of operation, it was not possible to start up correctly.

from homebridge-switchbot-for-mac.

zizi4n5 avatar zizi4n5 commented on July 19, 2024

If this doesn't improve the situation, I'm going to try the Bluetooth connection again when operating the Switch.

from homebridge-switchbot-for-mac.

zizi4n5 avatar zizi4n5 commented on July 19, 2024

I'm glad it worked properly!
Then this Issue is closed.

from homebridge-switchbot-for-mac.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.