maddox / dasher Goto Github PK
View Code? Open in Web Editor NEW🔘 A simple way to bridge your Amazon Dash buttons to HTTP services
License: MIT License
🔘 A simple way to bridge your Amazon Dash buttons to HTTP services
License: MIT License
I managed to get it working and then it just stopped working and I'm getting this error (Help Please!):
sudo npm run start
Password:
[email protected] start /Users/USER/dasher
node app.js
module.js:590
throw err;
^
SyntaxError: /Users/USER/dasher/config/config.json: Unexpected end of JSON input
at Object.parse (native)
at Object.Module._extensions..json (module.js:587:27)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/Users/USER/dasher/app.js:2:14)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
npm ERR! Darwin 16.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
npm ERR! node v6.10.0
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node app.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node app.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the dasher package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs dasher
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls dasher
npm ERR! There is likely additional logging output above.
I installed on my new Pi Zero W and when started manually, it would work fine. Even over the wifi. When I disconnect ssh, it would quit working. Understandable as the user logged out.
When I have attempted to set ti up to run via the auto start instructions, it would not run.
Auto Starting
Advanced information on autostarting Dasher on your Raspberry Pi can be found here.
Issue #47 says an issue was fixed in #35 but my limited knowledge says that was incorporated into the code we installed. Where mine is a fresh install, it should already be there.
I tried setting up auto start to the init.d folder with a script and it would not start. Also tried doing it as a service as I found a suggestion for. It would say it was running as a service, but not acting on button presses.
I am not getting a /var/log/dasher.err or /vol/log/dasher.log file created.
How can I get the error logs so I can have something to troubleshoot with?
when I run pi@raspberrypi:~/dasher $ script/find_button
it gives me the error below. What am I doing wrong:
module.js:472
throw err;
^
Error: Cannot find module '/home/pi/dasher/node_modules/node-dash-button/bin/findbutton'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:420:7)
at startup (bootstrap_node.js:139:9)
This could be because when I run pi@raspberrypi:~/dasher $ npm install
it comes up with:
Usage: npm <command>
where <command> is one of:
access, adduser, bin, bugs, c, cache, completion, config,
ddp, dedupe, deprecate, dist-tag, docs, edit, explore, get,
help, help-search, i, init, install, install-test, it, link,
list, ln, login, logout, ls, outdated, owner, pack, ping,
prefix, prune, publish, rb, rebuild, repo, restart, root,
run, run-script, s, se, search, set, shrinkwrap, star,
stars, start, stop, t, team, test, tst, un, uninstall,
unpublish, unstar, up, update, v, version, view, whoami
npm <cmd> -h quick help on <cmd>
npm -l display full usage info
npm help <term> search for help on <term>
npm help npm involved overview
Specify configs in the ini-formatted file:
/home/pi/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
[email protected] /usr/lib/node_modules/npm
Also how can I run this on a RPI 1 as I cannot install node.js v7?
``
Thanks
Hello,
I am running dasher on a Raspberry Pi 3 and receive the following error when running the sudo npm run start
`npm ERR! Linux 4.4.50-v7+
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "start"
npm ERR! node v4.8.1
npm ERR! npm v2.15.11
npm ERR! path /home/pi/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! /home/pi/npm-debug.log
`
But when I use sudo /etc/init.d/dasher start
, it works perfectly.
joey@joey-GM5664:$ cd /home/joey/dasher/dasher$ sudo npm run start
joey@joey-GM5664:
[email protected] start /home/joey/dasher
node app.js
module.js:428
throw err;
^
SyntaxError: /home/joey/dasher/config/config.json: Unexpected token ]
at Object.parse (native)
at Object.Module._extensions..json (module.js:425:27)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object. (/home/joey/dasher/app.js:2:14)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
npm ERR! Linux 4.4.0-21-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "start"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node app.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node app.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the dasher package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs dasher
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls dasher
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/joey/dasher/npm-debug.log
joey@joey-GM5664:~/dasher$
Here is the npm-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'run', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]prestart: [email protected]prestart: no script for prestart, continuing
6 silly lifecycle [email protected]
7 info lifecycle [email protected]start: [email protected]start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]
9 verbose lifecycle [email protected]start: PATH: /usr/share/npm/bin/node-gyp-bin:/home/joey/dasher/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/binstart: CWD: /home/joey/dasher
10 verbose lifecycle [email protected]
11 silly lifecycle [email protected]start: Args: [ '-c', 'node app.js' ]start: Returned: code: 1 signal: null
12 silly lifecycle [email protected]
13 info lifecycle [email protected]~start: Failed to exec start script
14 verbose stack Error: [email protected] start: node app.js
14 verbose stack Exit status 1
14 verbose stack at EventEmitter. (/usr/share/npm/lib/utils/lifecycle.js:232:16)
14 verbose stack at emitTwo (events.js:87:13)
14 verbose stack at EventEmitter.emit (events.js:172:7)
14 verbose stack at ChildProcess. (/usr/share/npm/lib/utils/spawn.js:24:14)
14 verbose stack at emitTwo (events.js:87:13)
14 verbose stack at ChildProcess.emit (events.js:172:7)
14 verbose stack at maybeClose (internal/child_process.js:821:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
15 verbose pkgid [email protected]
16 verbose cwd /home/joey/dasher
17 error Linux 4.4.0-21-generic
18 error argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "start"
19 error node v4.2.6
20 error npm v3.5.2
21 error code ELIFECYCLE
22 error [email protected] start: node app.js
22 error Exit status 1
23 error Failed at the [email protected] start script 'node app.js'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the dasher package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error node app.js
23 error You can get information on how to open an issue for this project with:
23 error npm bugs dasher
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls dasher
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
this is the error log after running npm install
pcap_binding.target.mk:86: recipe for target 'Release/obj.target/pcap_binding/pcap_binding.o' failed
make: *** [Release/obj.target/pcap_binding/pcap_binding.o] Error 1
make: Leaving directory '/home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 4.1.6-v7+
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/dasher/node_modules/node-dash-button/node_modules/pcap
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
npm ERR! Linux 4.1.6-v7+
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the pcap package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls pcap
npm ERR! There is likely additional logging output above.
Let me know if you need the log file.
Is there any way to use this program to shutdown the Pi similar to this method: https://howchoo.com/g/ymy4nza0nzb/reboot-your-raspberry-pi-using-an-amazon-dash-button ?
Hi,
Is it possible to get help to add Pushover integration?
I guess that I have to modify config.json to add code below,regarding to https://pushover.net/api#friendly:
{
"name": "Pushover test",
"address": "XX:XX:XX:XX:XX:XX",
"url": "https://api.pushover.net/1/messages.json",
"method": "POST",
"json": true,
"body": {"token": "tokenvalue", "user": "uservalue", "message": "test"}
}
Any help will be appreciated 😃
Raspberry Pi 3 with HASSbian install, ethernet install.
I tried running NPM. Got this.
npm WARN engine [email protected]: wanted: {"node":">= 4"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">= 0.12"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=4"} (current: {"node":"0.10.29","npm":"1.4.21"})
[email protected] install /home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/node_modules/socketwatcher
node-gyp rebuild
make: Entering directory '/home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/node_modules/socketwatcher/build'
CXX(target) Release/obj.target/socketwatcher/socket_watcher.o
In file included from ../socket_watcher.hpp:8:0,
from ../socket_watcher.cpp:5:
../../nan/nan.h:324:47: error: ‘REPLACE_INVALID_UTF8’ is not a member of ‘v8::String’
static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8;
^
socketwatcher.target.mk:82: recipe for target 'Release/obj.target/socketwatcher/socket_watcher.o' failed
make: *** [Release/obj.target/socketwatcher/socket_watcher.o] Error 1
make: Leaving directory '/home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/node_modules/socketwatcher/build'
gyp ERR! build error
gyp ERR! stack Error: make
failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:809:12)
gyp ERR! System Linux 4.4.34-v7+
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/node_modules/socketwatcher
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the socketwatcher package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls socketwatcher
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.4.34-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/pi/dasher
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/dasher/npm-debug.log
npm ERR! not ok code 0
thanks for this, your instructions and code worked well for me -- i'm able to hit ifttt and do what i wanted to do, but amazon still knows the button is being pressed and sends a "finish setting up your dash" notification on every press, which is messy traffic on top of my ifttt notification -- any plans to intercept and squelch that call to amazon?
I created the init.d script per your instructions for my raspberry pi 2. I can run this command manually and the script starts dasher correctly.
sudo /etc/init.d/dasher start
However, on boot of the raspberry pi, it throws this error into the /var/log/dasher.err file and dasher does not start
at create_session (/home/pi/dasher/node_modules/node-dash-button/index.js:28:15)
at register (/home/pi/dasher/node_modules/node-dash-button/index.js:47:24)
at new DasherButton (/home/pi/dasher/lib/dasher.js:12:21)
at Object.<anonymous> (/home/pi/dasher/app.js:8:16)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
here is the beginning of my init.d dasher file.
#!/bin/sh
### BEGIN INIT INFO
# Provides: dasher
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
dir="/home/pi/dasher"
cmd="DEBUG=* node app.js"
user="root"
name=`basename $0`
pid_file="/var/run/$name.pid"
stdout_log="/var/log/$name.log"
stderr_log="/var/log/$name.err"
I've tried to install dasher on both the lite and full versions on a clean Raspbian build using image 2016-09-23-raspbian-jessie, but neither have worked.
I also tried sudo npm install -g npm as suggested in another thread, and as you can see in the logs it stopped the "npm WARN engine" errors, but the install still failed.
The pastebin log shows everything entered after a fresh raspbian install:
Anyone know whats going on? Thanks
pi@raspberrypi:~/dasher $ sudo npm run start
[email protected] start /home/pi/dasher
node app.js
module.js:453
throw err;
^
SyntaxError: /home/pi/dasher/config/config.json: Unexpected token ]
at Object.parse (native)
at Object.Module._extensions..json (module.js:450:27)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object. (/home/pi/dasher/app.js:2:14)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
npm ERR! Linux 4.1.13-v7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
npm ERR! node v4.2.1
npm ERR! npm v2.14.7
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node app.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node app.js'.
npm ERR! This is most likely a problem with the dasher package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get their info via:
npm ERR! npm owner ls dasher
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/pi/dasher/npm-debug.log
Can this use WinPcap?
After running the find script i get a bunch of mac addresses rolling in, mostly my server and a couple nodemcu units i have around the house. There is one unknown manufacturer mac, but is not directly related to button pushes. What am i missing?
Started receiving this error after upgrading to Ubiquiti Edgerouter.
Have tried adding "protocol" but no luck.
Any suggestions?
I am not sure if anything has changed with configuration, but when I connected my button to Wifi but skipped the product selection page, it still ordered the item on button press. I suspect it might be because the button is linked to a single product so Amazon auto-selects it for you.
KIV while I test it out on another button that is coming soon
I seem to be running into a problem when with setting this up on a raspberry pi 2 with wheezy. Following the readmi, after $ sudo apt-get install libpcap-dev and $ sudo apt-get install npm, I attempt $ npm install but get errors. Any help is appreciated. Thanks!
pi@raspberrypi ~/projects/dasher $ npm install
npm http GET https://registry.npmjs.org/node-dash-button
npm http GET https://registry.npmjs.org/request
npm ERR! Error: failed to fetch from registry: request
npm ERR! at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12
npm ERR! at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9)
npm ERR! at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18)
npm ERR! at Request.callback (/usr/lib/nodejs/request/main.js:119:22)
npm ERR! at Request. (/usr/lib/nodejs/request/main.js:212:58)
npm ERR! at Request.emit (events.js:88:20)
npm ERR! at ClientRequest. (/usr/lib/nodejs/request/main.js:412:12)
npm ERR! at ClientRequest.g (events.js:156:14)
npm ERR! at ClientRequest.emit (events.js:67:17)
npm ERR! at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1256:7)
npm ERR! You may report this log at:
npm ERR! http://bugs.debian.org/npm
npm ERR! or use
npm ERR! reportbug --attach /home/pi/projects/dasher/npm-debug.log npm
npm ERR!
npm ERR! System Linux 4.4.16-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/pi/projects/dasher
npm ERR! node -v v0.6.19
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: request
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/projects/dasher/npm-debug.log
npm not ok
Hi
currently dasher crashes when the config points to URLs that are using self-signed certificates.
A new config option à la "skip-ssl-cert": true
would be great.
Thanks for this great project.
EDIT: it does not crash right away, but when the HTTP request is made (ie. the dash button was pressed)
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart [email protected]
6 info start [email protected]
7 verbose unsafe-perm in lifecycle true
8 info [email protected] Failed to exec start script
9 verbose stack Error: [email protected] start: node app.js
9 verbose stack Exit status 1
9 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:217:16)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at EventEmitter.emit (events.js:172:7)
9 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at ChildProcess.emit (events.js:172:7)
9 verbose stack at maybeClose (internal/child_process.js:827:16)
9 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
10 verbose pkgid [email protected]
11 verbose cwd /home/pi/Dasher/dasher
12 error Linux 4.4.11-v7+
13 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
14 error node v4.4.5
15 error npm v2.15.5
16 error code ELIFECYCLE
17 error [email protected] start: node app.js
17 error Exit status 1
18 error Failed at the [email protected] start script 'node app.js'.
18 error This is most likely a problem with the dasher package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error node app.js
18 error You can get information on how to open an issue for this project with:
18 error npm bugs dasher
18 error Or if that isn't available, you can get their info via:
18 error
18 error npm owner ls dasher
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]
When I start Dasher the below lines print
single element detected
Open Garge Door added.
Then when I press the button I get the below line
Open Garge Door pressed.
Then approximately 30-40 seconds later I get the following two line and the HA scene is run again.
Open Garge Door pressed.
Open Garge Door pressed.
Any idea how to fix this? I see something similar when running the find button. I get the following output from one button press.
possible dash hardware address detected: 10:ae:60:XX:XX:XX
possible dash hardware address detected: 10:ae:60:XX:XX:XX
~ 30 seconds passes then the below 2 print out.
possible dash hardware address detected: 10:ae:60:XX:XX:XX
possible dash hardware address detected: 10:ae:60:XX:XX:XX
Hey, everytime I try to start dasher on my pi, it gives me the following error:
npm ERR! Linux 4.4.32+ npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start" npm ERR! node v4.3.0 npm ERR! npm v3.10.8 npm ERR! code ELIFECYCLE npm ERR! [email protected] start:
node app.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] start script 'node app.js'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the dasher package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node app.js npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs dasher npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls dasher npm ERR! There is likely additional logging output above.
my node version is 4.3.0
any suggestions?
Can I use this to check whether either of my cell phones is connected to my wifi at 11 pm every night, then if it is, trigger the maker channel URL?
For example:
At 11:00 PM, if [MAC ADDRESS 1] or [MAC ADDRESS 2] is connected to [WIFI NETWORK] then [IFTTT MAKER CHANNEL URL]
Hi !
my config for one of my dash button is
{
"name": "Depart",
"address": "xx:xx:xx:xx:xx:xx",
"url": "http://192.168.1.XX:8123/api/services/scene/turn_on",
"method": "POST",
"headers": {"x-ha-access": "xxxxxxxxxxxxxx"},
"json": true,
"body": {"entity_id": "scene.depart"}
},
and it works !
I installed Letsencrypt and every certificates, and I have access from outdoor with https (great) !
But unfortunetely, my dash buttons don't worked, because my lan access is bloqued...
I tried with my duckdns adress : but no result
{
"name": "Depart",
"address": "xx:xx:xx:xx:xx:xx",
"url": "https://hass-example.duckdns.org/api/services/scene/turn_on",
"method": "POST",
"headers": {"x-ha-access": "xxxxxxxxxxxxxx"},
"json": true,
"body": {"entity_id": "scene.depart"}
},
How can I modified my config.json to pass over the certification ? (or other if it works :) )
thank you !!
Having an issue with getting dasher to run on my mac mini, any help is appreciated.
From terminal:
Daves-Mac-mini:dasher daveandalyssa$ sudo npm run start
Password:
[email protected] start /Users/daveandalyssa/Applications/dasher
node app.js
module.js:327
throw err;
^
Error: Cannot find module 'request'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/Users/daveandalyssa/Applications/dasher/lib/dasher.js:3:15)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
npm ERR! node v4.4.7
npm ERR! npm v2.15.8
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node app.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node app.js'.
npm ERR! This is most likely a problem with the dasher package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs dasher
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls dasher
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/daveandalyssa/Applications/dasher/npm-debug.log
Daves-Mac-mini:dasher daveandalyssa$
Here is the log file contents:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart [email protected]
6 info start [email protected]
7 verbose unsafe-perm in lifecycle true
8 info [email protected] Failed to exec start script
9 verbose stack Error: [email protected] start: node app.js
9 verbose stack Exit status 1
9 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:217:16)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at EventEmitter.emit (events.js:172:7)
9 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at ChildProcess.emit (events.js:172:7)
9 verbose stack at maybeClose (internal/child_process.js:827:16)
9 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
10 verbose pkgid [email protected]
11 verbose cwd /Users/daveandalyssa/Applications/dasher
12 error Darwin 15.6.0
13 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
14 error node v4.4.7
15 error npm v2.15.8
16 error code ELIFECYCLE
17 error [email protected] start: node app.js
17 error Exit status 1
18 error Failed at the [email protected] start script 'node app.js'.
18 error This is most likely a problem with the dasher package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error node app.js
18 error You can get information on how to open an issue for this project with:
18 error npm bugs dasher
18 error Or if that isn't available, you can get their info via:
18 error
18 error npm owner ls dasher
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]
I got your dasher setup working beautifully on my rpi2, with auto-startup.
I'm new to github so pardon if this is the wrong place. Was wondering, with the rpi3 out now, if you've considered using BLE with node to expand the project. I've been reading on the Misfit Flash/Link (recently on sale from manufacturer for $5/ $3) and thinking with the ability for multiple functions (single press, double press, etc) that it would be an excellent next expansion/evolution for this project.
I started to block the requests to amazon cloud (toprevent the app popups) which causes the button to send the requests twice with only a single button press.
Would it be possible to set a timer the first time the button is pressed and not send the request if it is fired again too quickly?
Hey - Thanks for the script. Trying to use, but cannot get working. Have tried setting up in two separate linux environments with same issue. Below is environment, procedure i followed, and results. Any suggestions? Thanks
Environment
I also tried Ubuntu 15.10 inside VM Workstation /w bridged NIC and got similar results
Procedure
pi@KNCar:~ $ npm install
npm ERR! install Couldn't read dependencies
npm ERR! package.json ENOENT, open '/home/pi/package.json'
npm ERR! package.json This is most likely not a problem with npm itself.
npm ERR! package.json npm can't find a package.json file in your current directory.
npm ERR! System Linux 4.1.19-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/pi
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! path /home/pi/package.json
npm ERR! code ENOPACKAGEJSON
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/npm-debug.log
npm ERR! not ok code 0
pi@KNCar:~/dasher $ npm install
npm WARN engine [email protected]: wanted: {"node":">=4"} (current: {"node":"0.10.29","npm":"1.4.21"})
> [email protected] install /home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/node_modules/socketwatcher
> node-gyp rebuild
make: Entering directory '/home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/node_modules/socketwatcher/build'
CXX(target) Release/obj.target/socketwatcher/socket_watcher.o
In file included from ../socket_watcher.hpp:8:0,
from ../socket_watcher.cpp:5:
../../nan/nan.h:324:47: error: ‘REPLACE_INVALID_UTF8’ is not a member of ‘v8::String’
static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8;
^
socketwatcher.target.mk:82: recipe for target 'Release/obj.target/socketwatcher/socket_watcher.o' failed
make: *** [Release/obj.target/socketwatcher/socket_watcher.o] Error 1
make: Leaving directory '/home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/node_modules/socketwatcher/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:809:12)
gyp ERR! System Linux 4.1.19-v7+
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/node_modules/socketwatcher
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the socketwatcher package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls socketwatcher
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.1.19-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/pi/dasher
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm WARN engine [email protected]: wanted: {"node":">=0.10.32"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=0.10.40"} (current: {"node":"0.10.29","npm":"1.4.21"})
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/dasher/npm-debug.log
npm ERR! not ok code 0
pi@KNCar:~/dasher $ sudo npm run start
> [email protected] start /home/pi/dasher
> node app.js
module.js:340
throw err;
^
Error: Cannot find module 'node-dash-button'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/pi/dasher/lib/dasher.js:2:18)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
npm ERR! [email protected] start: `node app.js`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is most likely a problem with the dasher package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get their info via:
npm ERR! npm owner ls dasher
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.1.19-v7+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "run" "start"
npm ERR! cwd /home/pi/dasher
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pi/dasher/npm-debug.log
npm ERR! not ok code 0
Any suggestions? Am I leaving out a big step? Thanks!
UPDATE
After posting, I went back to the Ubunutu 15 VM. I installed nodejs-legacy then tried again and this time 'npm install' again and this time it completed without errors. I had tried installing it in Raspbian on my RP, but it was already installed and up to date so doesn't help there. Would still much prefer to run on RP so the above post is still valid as all notes come from its installation. Thanks!
UPDATE #2
OK, ok, I spoke too soon...
'npm install' seemed to be successful as I didn't see any error messages. I edited the example config file (below) and then saved it in the same path as config.json. While still in the 'dasher' root, I then ran 'sudo npm run start' - it started! I clicked my dash button and after a few seconds, the terminal flooded with about 20 mesage about EthernetFrame. The trigger from IFTTT never went so I clicked the button again. Almost instantly, I got the echo "undefined press" followed by many lines of echo in the terminal. I quit npm, then tried launching it again but got errors. All of the events described are below followed by my config file...
ben@ubuntu:~/dasher$ sudo npm run start
> [email protected] start /home/ben/dasher
> node app.js
undefined added.
undefined added.
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
node_pcap: EthernetFrame() - Don't know how to decode ethertype 35033
undefined pressed.
there was an error
[Error: SELF_SIGNED_CERT_IN_CHAIN]
/home/ben/dasher/lib/dasher.js:38
if (response.statusCode === 401) {
^
TypeError: Cannot read property 'statusCode' of undefined
at Request.onResponse [as _callback] (/home/ben/dasher/lib/dasher.js:38:17)
at self.callback (/home/ben/dasher/node_modules/request/request.js:200:22)
at Request.EventEmitter.emit (events.js:95:17)
at Request.onRequestError (/home/ben/dasher/node_modules/request/request.js:831:8)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at CleartextStream.socketErrorListener (http.js:1547:9)
at CleartextStream.EventEmitter.emit (events.js:95:17)
at SecurePair.<anonymous> (tls.js:1389:19)
at SecurePair.EventEmitter.emit (events.js:92:17)
at SecurePair.maybeInitFinished (tls.js:982:10)
npm ERR! [email protected] start: `node app.js`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is most likely a problem with the dasher package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get their info via:
npm ERR! npm owner ls dasher
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.2.0-16-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "run" "start"
npm ERR! cwd /home/ben/dasher
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/ben/dasher/npm-debug.log
npm ERR! not ok code 0
ben@ubuntu:~/dasher$ sudo npm run start
> [email protected] start /home/ben/dasher
> node app.js
module.js:485
throw err;
^
SyntaxError: /home/ben/dasher/config/config.json: Unexpected token ]
at Object.parse (native)
at Object.Module._extensions..json (module.js:482:27)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/home/ben/dasher/app.js:2:14)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
npm ERR! [email protected] start: `node app.js`
npm ERR! Exit status 8
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is most likely a problem with the dasher package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get their info via:
npm ERR! npm owner ls dasher
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.2.0-16-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "run" "start"
npm ERR! cwd /home/ben/dasher
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/ben/dasher/npm-debug.log
npm ERR! not ok code 0
My (Edited) config.json file
{"buttons":[
{
"address": "mymacaddress",
"url": "https://maker.ifttt.com/trigger/Notify/with/key/mykey",
"method": "POST"
},
]}
Thoughts? Thanks!
I can see my button by its mac address in the attached devices, but cannot seem to dasher hear the request (it happened once, but I cannot reproduce). I
user@PC:$ cd dasher/dasher$ sudo npm run start
user@PC:
[sudo] password for user:
[email protected] start /home/user/dasher
node app.js
[2016-12-08T13:50:27.023Z] Notification added.
And the it just does not do anything, including responding to button presses. Any idea what I can try to do to fix the problem. Thank you!
Hello,
The docs say this is just a trigger, there is no state, only one action.
Is it possible to trigger an action to reverse the current state of my lights? that is, switch on if they are switched off, and switch off if they are switched on.
Should I use IFTTT or connect to my Philips Hue route directly (which is in the same network)?
Thanks.
Keyboard maestro uses this kind of urls
http://192.168.1.124:4490/action.html?macro=786B4E60-8D79-44A0-8E42-8482569DB9D0
So you can execute macros locally on the mac. But i can't execute it with dasher because i'm getting
"not a 200
null"
This error. I tried setting the request to get/post but it still doesn't work. Is a fix possible for this?
Btw. Thank you very much for this, it's so useful! :)
New to Pi, so this is confusing for me. Can anyone help, this is what I get when running npm install.
pi@magicmirror:~/dasher $ sudo npm run start
[email protected] start /home/pi/dasher
node app.js
warning: SIOCGIFADDR: en0: No such device - this may not actually work
[Error: SIOCGIFHWADDR: No such device]
Failed to create pcap session: couldn't find devices to listen on.
Try running with elevated privileges via 'sudo'
/home/pi/dasher/node_modules/node-dash-button/index.js:28
throw new Error('Error: No devices to listen');
^
Error: Error: No devices to listen
at create_session (/home/pi/dasher/node_modules/node-dash-button/index.js:28:15)
at register (/home/pi/dasher/node_modules/node-dash-button/index.js:47:24)
at new DasherButton (/home/pi/dasher/lib/dasher.js:12:21)
at Object. (/home/pi/dasher/app.js:8:16)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:134:18)
npm ERR! Linux 4.4.37-v7+
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
npm ERR! node v4.2.1
npm ERR! npm v4.0.3
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node app.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node app.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the dasher package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs dasher
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls dasher
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/pi/dasher/npm-debug.log
pi@magicmirror:/dasher $ node -v/dasher $ npm -v
v4.2.1
pi@magicmirror:
4.0.3
Hello !!
since something about 1 hour i try to open "find_button"
and here is what i have :-/
module.js:339
throw err;
^
Error: Cannot find module '/home/pi/dasher/script/node_modules/node-dash-button/bin/findbutton'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:134:18)
at node.js:961:3
Can someone help me ? thx
I can't figure out what the issue is here. I followed /u/bruhautomation tutorial to get Dasher up and running.
When I use the IFTTT method, it works perfectly (granted, with an expected delay). When I try to use the HTTP request method to shorten the delay, nothing happens.
Here is the code I am using:
{"buttons":[
{
"name": "Gatorade",
"address": "ADDRESS",
"url": "https://NAME.duckdns.org/api/services/scene/turn_on",
"method": "POST",
"headers": {"x-ha-access": "PASSWORD"},
"json": true,
"body": {"entity_id": "scene.morning"}
}
]}
Im using the exact same information with another app that sends HTTP requests and it works perfectly, so Im not sure what the issue is here.
Ive tried a variety of combinations of the above code as well, including appending the port number (which shouldnt be necesary for DNS) and changing x-ha-access to authorization, as I saw you have that in your example but it all results in the same errors.
This is the terminal readout when I try to run everything:
pi@hassbian:~/dasher $ sudo npm run start
> [email protected] start /home/pi/dasher
> node app.js
[2017-04-06T13:04:19.030Z] Gatorade added.
[2017-04-06T13:04:28.974Z] Gatorade pressed. Count: 1
[2017-04-06T13:06:36.562Z] there was an error
[2017-04-06T13:06:36.562Z] Response undefined
[2017-04-06T13:07:23.418Z] there was an error
[2017-04-06T13:07:23.418Z] Response undefined
I get an error if i execute the find_button script, but if i go into the node_modules folder node_modules/node-dash-button/bin/
and execute the script direct i works.
Any idea?
sudo node script/find_button
/home/pi/dasher/script/find_button:3
sudo node node_modules/node-dash-button/bin/findbutton
^^^^
SyntaxError: Unexpected identifier
at Object.exports.runInThisContext (vm.js:76:16)
at Module._compile (module.js:528:28)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.runMain (module.js:590:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
Hi, can you tell me the easiest way to update my dasher installation from November 2016?
Regards, M
On El Capitan (10.11.3) Dasher would run be loaded when installed with script/install but would not be loaded again by launchd after a reboot. As such, it stopped working every time I rebooted the server.
The service name was present when running "sudo launchctl list | grep -i dasher" before a reboot, but was entirely missing when running the same command after reboot. Installing again would bring it back up, but it would disappear again after the next reboot.
This appears to be due to the way Apple has mucked about with launchd recently.
This fixed it (at least for me):
Move Dasher launchd plist from LaunchAgents to LaunchDaemons
"mv /Library/LaunchAgents/org.dasher.plist /Library/LaunchDaemons"
Load into launchd with new bootstrap command:
"sudo launchctl bootstrap system /Library/LaunchDaemons/org.dasher.plist"
Will you add under "Dasher app -- Simply clone and install the dependencies." that this package is required?
sudo apt-get install nodejs-legacy
Here's the link to the apparent reason, for anyone curious. http://stackoverflow.com/questions/21168141/can-not-install-packages-using-node-package-manager-in-ubuntu
Im trying to get my Dashes to communicate with home assistant. I have my config as follows:
{
"buttons": [{
"name": "Dash A",
"address": "10:ae:60:32:8c:40",
"url": "https://maker.ifttt.com/trigger/Dash.A/with/key/bGkPmYg-xRMe1KapddJedg",
"method": "POST"
},{
"name": "Dash B",
"address": "f0:27:2d:0e:eb:5c",
"url": "http://192.168.2.123:8123/api/services/switch/toggle/",
"method": "POST",
"json": true,
"body": {
"entity_id": "switch.closet"
}
}]
}```
The Dash B sections is the Home Assistant part. What am I doing wrong. It comes back with:
Dash B pressed.
Not a 200
null
Why clues on what is the problem?
find_button is throwing an error. Here's the log with the libpcap-dev installed, npm install
completed and then the traceback.
Setting up libpcap-dev (1.3.0-1) ...
(homeassistant) pi@carlo-pi ~/dasher $ npm install
\
> [email protected] install /home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/node_modules/socketwatcher
> node-gyp rebuild
make: Entering directory '/home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/node_modules/socketwatcher/build'
CXX(target) Release/obj.target/socketwatcher/socket_watcher.o
SOLINK_MODULE(target) Release/obj.target/socketwatcher.node
COPY Release/socketwatcher.node
make: Leaving directory '/home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/node_modules/socketwatcher/build'
> [email protected] install /home/pi/dasher/node_modules/node-dash-button/node_modules/pcap
> node-gyp rebuild
make: Entering directory '/home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/build'
CXX(target) Release/obj.target/pcap_binding/pcap_binding.o
CXX(target) Release/obj.target/pcap_binding/pcap_session.o
SOLINK_MODULE(target) Release/obj.target/pcap_binding.node
COPY Release/pcap_binding.node
make: Leaving directory '/home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/build'
[email protected] node_modules/node-dash-button
âââ [email protected]
âââ [email protected] ([email protected], [email protected])
(homeassistant) pi@carlo-pi ~/dasher $ cd script/
(homeassistant) pi@carlo-pi ~/dasher/script $ ls
bootstrap find_button install restart server uninstall upgrade
(homeassistant) pi@carlo-pi ~/dasher/script $ sudo ./find_button
module.js:338
throw err;
^
Error: Cannot find module '/home/pi/dasher/script/node_modules/node-dash-button/bin/findbutton'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
Trying to get this to run on raspberry pi 1 b+, cannot run dasher after using sudo npm run start
Here is my log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart [email protected]
6 info start [email protected]
7 verbose unsafe-perm in lifecycle true
8 info [email protected] Failed to exec start script
9 verbose stack Error: [email protected] start:node app.js
9 verbose stack Exit status 1
9 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:214:16)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at EventEmitter.emit (events.js:172:7)
9 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at ChildProcess.emit (events.js:172:7)
9 verbose stack at maybeClose (internal/child_process.js:818:16)
9 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
10 verbose pkgid [email protected]
11 verbose cwd /home/pi/dasher
12 error Linux 4.1.17+
13 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
14 error node v4.2.1
15 error npm v2.14.7
16 error code ELIFECYCLE
17 error [email protected] start:node app.js
17 error Exit status 1
18 error Failed at the [email protected] start script 'node app.js'.
18 error This is most likely a problem with the dasher package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error node app.js
18 error You can get their info via:
18 error npm owner ls dasher
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]
Hello (again) Sorry for bad english im from france !
Now 90 percent of this is working ^^
but when i launch i got
[email protected] start /home/bell/dasher
node app.js
[2017-04-22T14:01:06.158Z] Porte added.
And even if i press there is nothing hapening :-/
Here is my configuration ! ( a friend gave it to me so i don't know if it's okay)
{"buttons":[
{
"name": "Porte",
"address": "your:dash:mac:40:B4:CD:87:CE:F4
"url": "$
"method": "POST"
}
]}
i know the ifttt url is correct bcs i can launch it manually with chrome.
can someone help ? thx ^^
After a few hours of running from the init.d script, I get this error in the dasher.err file.
pi@pi:~ $ tail -f /var/log/dasher.err
&& _.isEqual(packet.payload.payload.sender_ha.addr,
^
TypeError: Cannot read property 'addr' of undefined
at PcapSession. (/home/pi/dasher/node_modules/node-dash-button/index.js:78:66)
at emitOne (events.js:96:13)
at PcapSession.emit (events.js:188:7)
at PcapSession.on_packet_ready (/home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/pcap.js:99:10) at packet_ready (/home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/pcap.js:44:14)
at SocketWatcher.pcap_read_callback [as callback] (/home/pi/dasher/node_modules/node-dash-button/node_modules/pcap/pcap.js:64:45)
Hello.
I get some error messages:
[2017-02-18T15:27:17.449Z] DashButton1 pressed. Count: 1
[2017-02-18T15:27:17.596Z] Not authenticated
[2017-02-18T15:27:17.597Z] null
[2017-02-18T15:27:17.597Z] Unsuccessful status code
[2017-02-18T15:27:17.598Z] null
I use an Raspberry Pi3 with Pi-Hole and FHEM (Homeautomatik system)
Pi-Hole is configured as an DHCP and DNS server.
I want to use dasher with http push.
I am a linux noob, so anyone can help me ?
Looks like my 5 buck a year certificate from SSLS.COM is throwing some sort of error when hitting Home-Assistant.
[2016-11-23T20:54:36.146Z] Brooklyn DASH pressed.
[2016-11-23T20:54:36.559Z] there was an error
{ [Error: unable to verify the first certificate] code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE' }
/home/pi/dasher/lib/dasher.js:46
if (response && response.statusCode < 200 || response.statusCode > 299) {
^
TypeError: Cannot read property 'statusCode' of undefined
at Request.onResponse [as _callback] (/home/pi/dasher/lib/dasher.js:46:58)
at self.callback (/home/pi/dasher/node_modules/request/request.js:186:22)
at emitOne (events.js:77:13)
at Request.emit (events.js:169:7)
at Request.onRequestError (/home/pi/dasher/node_modules/request/request.js:845:8)
at emitOne (events.js:77:13)
at ClientRequest.emit (events.js:169:7)
at TLSSocket.socketErrorListener (_http_client.js:259:9)
at emitOne (events.js:77:13)
at TLSSocket.emit (events.js:169:7)
it looks like this require module might fix the issue for people with broken chains (as in my case).
https://github.com/Daplie/node-ssl-root-cas
Any Shot of incorporating this fix?
Thanks
I've tried 3 different versions of NodeJS, and still get the same error below;
Any chance this is a known issue?
Adams-MacBook-Pro:dasher adamowen$ sudo npm run start
[email protected] start /Users/adamowen/dasher
node app.js
module.js:440
return process.dlopen(module, path._makeLong(filename));
^
Error: Module version mismatch. Expected 47, got 48.
at Error (native)
at Object.Module._extensions..node (module.js:440:18)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at Object. (/Users/adamowen/dasher/node_modules/pcap/pcap.js:3:21)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
npm ERR! Darwin 16.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start"
npm ERR! node v5.7.1
npm ERR! npm v3.6.0
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node app.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node app.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the dasher package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs dasher
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls dasher
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/adamowen/dasher/npm-debug.log
sudo npm run start
[email protected] start /home/pi/dasher
node app.js
warning: SIOCGIFADDR: en0: No such device - this may not actually work
Error: SIOCGIFHWADDR: No such device
at Error (native)
at new PcapSession (/home/pi/dasher/node_modules/pcap/pcap.js:49:39)
at Object.exports.createSession (/home/pi/dasher/node_modules/pcap/pcap.js:123:12)
at create_session (/home/pi/dasher/node_modules/node-dash-button/index.js:24:28)
at register (/home/pi/dasher/node_modules/node-dash-button/index.js:47:24)
at new DasherButton (/home/pi/dasher/lib/dasher.js:12:21)
at Object. (/home/pi/dasher/app.js:8:16)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
Failed to create pcap session: couldn't find devices to listen on.
Try running with elevated privileges via 'sudo'
/home/pi/dasher/node_modules/node-dash-button/index.js:28
throw new Error('Error: No devices to listen');
^
Error: Error: No devices to listen
at create_session (/home/pi/dasher/node_modules/node-dash-button/index.js:28:15)
at register (/home/pi/dasher/node_modules/node-dash-button/index.js:47:24)
at new DasherButton (/home/pi/dasher/lib/dasher.js:12:21)
at Object. (/home/pi/dasher/app.js:8:16)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
npm ERR! Linux 4.1.19v7-aufs
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "start"
npm ERR! node v6.9.1
npm ERR! npm v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node app.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node app.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the dasher package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs dasher
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls dasher
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/pi/dasher/npm-debug.log
npm-debug.log.txt
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.