@mwittig would be interesting what’s different on @Heizelmann 's machine. I guess you are using your plugin, too? But maybe we should follow this topic on a new forum thread. EDIT: Forked new topic on the matter
-
amazing-dash-button causes pimatic to hang
pimatic-hap - pimatic HomeKit bridge
pimatic-echo - Amazon echo integration
pimatic-dash-button - Amazon dash button support
pimatic-alarm - pimatic alarm system
Like my work? Then consider a donation
Follow me: https://twitter.com/michaelkotten -
@michbeck100 said in amazing-dash-button causes pimatic to hang:
@mwittig would be interesting what’s different on @Heizelmann 's machine
Yes, indeed.
@heizelmann Can pls report which libpcap bersion and which kernel version you have installed?"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig said in amazing-dash-button causes pimatic to hang:
@heizelmann Can pls report which libpcap bersion and which kernel version you have installed?
libpcap 1.6.2-2
Linux raspberrypi 4.9.35-v7+ -
@Heizelmann Did you check for other system errors? Maybe the system is running out of file desicriptors
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig No, I went back to an older system backup with pimatic 0.9.42 made an update from there an leave out amazing dash button. Currently I am happy with this.
-
@heizelmann I am currently investigating this further. Among other things I have created a fork of the cap package which replaces the status assertion with an output of the status. If you have some time to do also some testing you can
npm install mwittig/pimatic-amazing-dash-button
.Expected behaviour: Pimatic should no longer hang or abort. The log file may contain some messages containing “Error: Libuv status code”. If you see this, please let me know about the status code(s) you get. Besides this I do not expect the operation of the plugin or the rest of pimatic is impacted by the error. However, it needs to check if the error is just temporary and the plugin still detects button push events or capturing runs into permanent failure.
I am also trying to create an isolated test case for the development, but for this I need more information about the nature of the error.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig said in amazing-dash-button causes pimatic to hang:
npm install mwittig/pimatic-amazing-dash-button.
I did this and then activated the plugin in my pimatic . After restart I see the following error:
23:26:04.652 [pimatic] error: Could not initialize the plugin "amazing-dash-button": Buffer.alloc is not a function 23:26:04.678 [pimatic] debug: TypeError: Buffer.alloc is not a function 23:26:04.678 [pimatic] debug:> at AmazingDashButtonPlugin.init (/home/pi/pimatic-app/node_modules/pimatic-amazing-dash-button/amazing-dash-button.coffee:26:24) 23:26:04.678 [pimatic] debug:> at AmazingDashButtonPlugin.init (/home/pi/pimatic-app/node_modules/pimatic-amazing-dash-button/amazing-dash-button.coffee:2:1) 23:26:04.678 [pimatic] debug:> at PluginManager.initPlugins (/home/pi/pimatic-app/node_modules/pimatic/lib/plugins.coffee:535:25) 23:26:04.678 [pimatic] debug:> at /home/pi/pimatic-app/node_modules/pimatic/lib/framework.coffee:937:34 23:26:04.678 [pimatic] debug:> at tryCatcher (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/util.js:16:23) 23:26:04.678 [pimatic] debug:> at Promise._settlePromiseFromHandler (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:512:31) 23:26:04.678 [pimatic] debug:> at Promise._settlePromise (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:569:18) 23:26:04.678 [pimatic] debug:> at Promise._settlePromise0 (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:614:10) 23:26:04.678 [pimatic] debug:> at Promise._settlePromises (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/promise.js:694:18) 23:26:04.678 [pimatic] debug:> at _drainQueueStep (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/async.js:138:12) 23:26:04.678 [pimatic] debug:> at _drainQueue (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/async.js:131:9) 23:26:04.678 [pimatic] debug:> at Async._drainQueues (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/async.js:147:5) 23:26:04.678 [pimatic] debug:> at Immediate.Async.drainQueues [as _onImmediate] (/home/pi/pimatic-app/node_modules/pimatic/node_modules/bluebird/js/release/async.js:17:14) 23:26:04.678 [pimatic] debug:> at processImmediate [as _immediateCallback] (timers.js:383:17)
pimatic version 0.9.46
Node.js version 4.4.6 -
@heizelmann said in amazing-dash-button causes pimatic to hang:
Node.js version 4.4.6
Your Node.js version is too old, I am afraid. You need to update to v4.6 at least (v4.9.1 recommended).
If you don’t want to this for some reason I can add a polyfill for Buffer.alloc, though. Just let me know"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig Thanks for the hint. I installed node v4.9.1 (using the tool “n”) and then installed amazing-dash-button by
npm install mwittig/pimatic-amazing-dash-button. I am not sure if I did this from the right location, I was on home/pi/pimatic-app. There were some warnings/retries seen in the log, but finally it looks OK. I installed my dashbutton with device auto-discovery. Works like a charm. Let’s see what will happen. -
@mwittig Until now no hang and no specific error messages.
As far so good. However, I am not very satisfied with Amazon Dash Button. It has a very long reaction time and is very unreliable. It was a nice experiment, but I won’t use this device anymore. Anyway, thank you very much for your efforts. -
@heizelmann said in amazing-dash-button causes pimatic to hang:
Until now no hang and no specific error messages.
Thanks for the feedback and your effort in testing this.
It has a very long reaction time and is very unreliable.
Regarding the long reaction times (2-5 seconds in my case) I agree and users in other communities also complained about this. The newer dash button no longer send ARP requests, but they send DHCP broadcasts. For the latter it is possible to create a lightweight detection device which basically is a simple DHCP Listener (using a raw socket). I have implemented a prototype a few weeks ago and the results are very promising (detection times was always below 2 seconds!). So, detection is a lot faster than the package capturing and filtering machinery. I planning to provide this either as an option for amazing-dash-button or a new light-weight plugin with zero dependencies.
Regarding unreliable behavior I cannot confirm this. My dash-buttons are 100% reliable. Possibly it is a range problem in your case. Or you have one of the older makes performing ARP probes.
I won’t use this device anymore
No worries. I guess Amazon will shutdown the Dash-button service anyway sooner or later. When this happens the buttons are still usable for pimatic but it will be very difficult to re-configure the buttons, e.g. if the Wifi-Network configuration changes.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law