i have the same issue.
The Frontend looks horrible.
https://www.dropbox.com/s/m7vk3dcfyycno4f/IMG_9463.PNG?dl=0
-
Amazon dash button plugin available
-
@slimmy Did you add the dash button as a device to your frontend? The dash button is not intended to be added to the frontend as there is nothing to show. It has no state or anything else. I’ll have a look into this error, though. Please use the dash button with rules only for now. If you have any ideas for a use case, where showing the button on the frontend makes sense, then please let me know.
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 -
I use a RasPi USB-WLAN adapter, but I’m not connected to any WLAN network (should that work with the dash button?).ok that is the Information I need to know (now it works):
First Time Dash Setup
Follow Amazon’s instructions to configure your button to send messages when you push them but not actually order anything. When you get a Dash button, Amazon gives you a list of setup instructions to get going. Just follow this list of instructions, but don’t complete the final step (#3 I think) Do not select a product, just exit the app.
-
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 Amazon dash button plugin available:
Sorry, can’t reproduce this error. Anyone else having problems? @mwittig maybe?
Sorry, I am not able to install the plugin
08:46:30.741 [pimatic, ppm] info: > pcap@2.0.0 install /home/pi/pimatic-dev/node_modules/pimatic-dash-button/node_modules/pcap 08:46:30.743 [pimatic, ppm] info: > node-gyp rebuild 08:46:33.127 [pimatic, ppm] info: make: Entering directory '/home/pi/pimatic-dev/node_modules/pimatic-dash-button/node_modules/pcap/build' 08:46:33.133 [pimatic, ppm] info: CXX(target) Release/obj.target/pcap_binding/pcap_binding.o 08:46:33.198 [pimatic, ppm] info: ../pcap_binding.cc:2:23: fatal error: pcap/pcap.h: Datei oder Verzeichnis nicht gefunden 08:46:33.200 [pimatic, ppm] info: #include <pcap/pcap.h> 08:46:33.202 [pimatic, ppm] info: ^ 08:46:33.204 [pimatic, ppm] info: compilation terminated. 08:46:33.342 [pimatic, ppm] info: pcap_binding.target.mk:89: recipe for target 'Release/obj.target/pcap_binding/pcap_binding.o' failed 08:46:33.345 [pimatic, ppm] info: make: *** [Release/obj.target/pcap_binding/pcap_binding.o] Error 1 08:46:33.353 [pimatic, ppm] info: make: Leaving directory '/home/pi/pimatic-dev/node_modules/pimatic-dash-button/node_modules/pcap/build' 08:46:33.357 [pimatic, ppm] info: gyp ERR! build error 08:46:33.366 [pimatic, ppm] info: gyp ERR! stack Error: `make` failed with exit code: 2 08:46:33.375 [pimatic, ppm] info: gyp ERR! stack at ChildProcess.onExit (/home/pi/pimatic-dev/node_modules/pimatic/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23) 08:46:33.377 [pimatic, ppm] info: gyp ERR! stack at emitTwo (events.js:87:13) 08:46:33.379 [pimatic, ppm] info: gyp ERR! stack at ChildProcess.emit (events.js:172:7) 08:46:33.381 [pimatic, ppm] info: gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12) 08:46:33.382 [pimatic, ppm] info: gyp ERR! System Linux 4.4.14-v7+ 08:46:33.386 [pimatic, ppm] info: gyp ERR! command "/usr/local/bin/node" "/home/pi/pimatic-dev/node_modules/pimatic/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" 08:46:33.388 [pimatic, ppm] info: gyp ERR! cwd /home/pi/pimatic-dev/node_modules/pimatic-dash-button/node_modules/pcap 08:46:33.402 [pimatic, ppm] info: gyp ERR! node -v v4.4.5 08:46:33.404 [pimatic, ppm] info: gyp ERR! node-gyp -v v3.3.1 08:46:33.406 [pimatic, ppm] info: gyp ERR! not ok 08:46:33.417 [pimatic, ppm] info: ERR! Linux 4.4.14-v7+ 08:46:33.419 [pimatic, ppm] info: ERR! argv "/usr/local/bin/node" "/home/pi/pimatic-dev/node_modules/pimatic/ppm.js" "install" "pimatic-dash-button@0.0.2" "--unsafe-perm" 08:46:33.421 [pimatic, ppm] info: ERR! node v4.4.5 08:46:33.422 [pimatic, ppm] info: ERR! npm v2.15.6 08:46:33.424 [pimatic, ppm] info: ERR! code ELIFECYCLE 08:46:33.427 [pimatic, ppm] info: ERR! pcap@2.0.0 install: `node-gyp rebuild` 08:46:33.450 [pimatic, ppm] info: ERR! Exit status 1 08:46:33.452 [pimatic, ppm] info: ERR! 08:46:33.454 [pimatic, ppm] info: ERR! Failed at the pcap@2.0.0 install script 'node-gyp rebuild'. 08:46:33.456 [pimatic, ppm] info: ERR! This is most likely a problem with the pcap package, 08:46:33.459 [pimatic, ppm] info: ERR! not with npm itself. 08:46:33.461 [pimatic, ppm] info: ERR! Tell the author that this fails on your system: 08:46:33.462 [pimatic, ppm] info: ERR! node-gyp rebuild 08:46:33.464 [pimatic, ppm] info: ERR! You can get information on how to open an issue for this project with: 08:46:33.466 [pimatic, ppm] info: ERR! npm bugs pcap 08:46:33.468 [pimatic, ppm] info: ERR! Or if that isn't available, you can get their info via: 08:46:33.471 [pimatic, ppm] info: ERR! 08:46:33.473 [pimatic, ppm] info: ERR! npm owner ls pcap 08:46:33.474 [pimatic, ppm] info: ERR! There is likely additional logging output above. 08:46:33.705 [pimatic, ppm] info: ERR! Please include the following file with any support request: 08:46:33.711 [pimatic, ppm] info: ERR! /home/pi/pimatic-dev/npm-debug.log 08:46:33.724 [pimatic] error: Error installing plugin pimatic-dash-button: Error running "./node_modules/pimatic/ppm.js install pimatic-dash-button@0.0.2 --unsafe-perm"
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig you have to install libpcap-dev. Please RTFM .
Since this plugin uses node-pcap, libpcap-dev must be installed on a raspberry pi:
sudo apt-get install libpcap-dev
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 Ah, ok. I thought the library gets installed automatically via pre-install. Maybe, this is something worthwhile to consider.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig it definitely is. I don’t have any experience in using the node pre-install feature. If you have some good resources send me a pm.
But I think it’s not possible to install these dependencies since they are installed using apt-get (or any other package manager depending on the OS)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 -
Thanks for the plugin. I’ve just ordered 2 buttons Since i’m running Pimatic and Kodi on the same Raspi 3, i’m wondering how much CPU load the ARP request sniffing will cause. Especially during streaming of movies over the LAN port from a NAS. There will be a lot of packets, which have to be processed by pcap. If the load is too high, there is still the possibility to activate the onboard WLAN and use it only for pcap sniffing.
-
@GooglyEyz CPU load seems to be fine but the memory consumption seems to have increased since using the plugin. I’ll have to test if it’s better when the plugin is deactivated, though.
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 Amazon dash button plugin available:
Sorry, can’t reproduce this error. Anyone else having problems? @mwittig maybe?
Getting back to this, I can reproduce this problem, now. It occurs if the device had been added a to view page. When you do this you will see another error at first:
Client error: Cannot read property '__ko__1473100260719' of null
. After this the front-end will no longer properly render and you’ll get the other error. I think the reason is that you’re using a “templete” which is unkown in the frontend, i.e. “dashbutton”. It should be needed that the devices gets added to view though, so the error won’t disappear after restart. It can be resolved by opening the Configuration Editor to manually remove the device from the view.EDIT: Ihave created a ticket for this issue on github.
I think the mobile frontend should be more robust against such errors. For the time being, users shall not add the DashButtonDevice to view pages.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@michbeck100 said in Amazon dash button plugin available:
but the memory consumption seems to have increased since using the plugin
Presumably, most of the memory is used for libpcap’s ringbuffer, which stores the already received packages. It is possible to tweak the allocated size which should be a multiple of the maximum packets size plus some slack needed to maintain packets as part of the ringbuffer. See pcap_set_buffer_size()
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig
The pcap man page says:buffer size
Packets that arrive for a capture are stored in a buffer, so that they do not have to be read by the application as soon as they arrive. On some platforms, the buffer’s size can be set; a size that’s too small could mean that, if too many packets are being captured and the snapshot length doesn’t limit the amount of data that’s buffered, packets could be dropped if the buffer fills up before the application can read packets from it, while a size that’s too large could use more non-pageable operating system memory than is necessary to prevent packets from being dropped.
The buffer size is set with pcap_set_buffer_size().The default size used in node_pcap is 10 MB for the buffer. As i think that there shouldn’t be so many ARP request per time in a standard home, so i guess 2 MB should be enough. What do you think? Remember ARP requests are issued once a device connects to a network.
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 -
@GooglyEyz I have analyzed the difference in memory usage since activating the plugin. It did increase by about 10 MB, so i guess @mwittig is right about the buffer size. For the time being an increase of 10 MB is still not that much of a problem.
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 Amazon dash button plugin available:
The default size used in node_pcap is 10 MB for the buffer. As i think that there shouldn’t be so many ARP request per time in a standard home, so i guess 2 MB should be enough. What do you think? Remember ARP requests are issued once a device connects to a network.
Yes, 2 MB should be more than enough. I have tested this with 600k which works flawlessly on a Pi 3. As it is possible to let libpcap (pre-)filter the incoming packet stream for ARP packets the memory required should be really low as the size of an ARP packet on the wire normally normally is less than 64 bytes.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig The plugin already filters just for ARP packages. I just didn’t change the default buffer size. The next update will bring a decrease to 1 MB. Just to be sure.
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 Amazon dash button plugin available:
The plugin already filters just for ARP packages.
That’s great! It would also be possible to filter ARP packets for the MAC vendor ids, but I don’t think it will improve performance / memory usage as the number of ARP requests on a home network normally is relatively low.
https://ask.wireshark.org/questions/35546/filter-mac-address-of-a-particular-manufacturer
I just didn’t change the default buffer size. The next update will bring a decrease to 1 MB. Just to be sure.
This make sense to me.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig My plugin already does this, too. I’m filtering just for addresses registered for Amazon Technologies Inc. These addresses can be found here: https://regauth.standards.ieee.org/standards-ra-web/pub/view.html#registries
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 Amazon dash button plugin available:
My plugin already does this, too.
Yes, I know, but I was referring to letting libpcap do the (pre-)filtering for you so that the “pcap session” will only retrun ARP requests from Amazon devices. ,As libpacap filtering is performed in kernel mode the advantage would be, that lesser context switches are required as lesser ARP packages will be passed to the application (pimatic) running in the user space.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@michbeck100 Wow, good to have someone who’s experienced with libpcap . I’ll have a look into this.
EDIT: reminder to myself created: https://github.com/michbeck100/pimatic-dash-button/issues/4pimatic-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