[OBSOLETE] Amazon Dash Button

[2017-12-06T16:51:23.404Z] [dash] {“address”:“b4:7c:9c:e9:f9:d7”,“status”:“active”}
[2017-12-06T16:51:35.733Z] [stnp] Notify error: Error: connect ETIMEDOUT 192.168.1.1:39500
[2017-12-06T16:51:49.058Z] [dash] Finished discovery on local network
[2017-12-06T16:51:56.204Z] [stnp] Notify error: Error: connect ETIMEDOUT 192.168.1.1:39500
[2017-12-06T16:51:58.764Z] [dash] {“address”:“b4:7c:9c:e9:f9:d7”,“status”:“active”}

Can you solve this problem?

Hello, I am having a slightly different issue. The node proxy seems to start up fine but I noticed it shows it’s listening on http:/0.0.0.0 instead of http://:::8080 like everyone else is showing. The discovery works fine and see’s the buttons and reports the MAC addresses. I confirmed they are all correct. However, when I press the buttons, nothing happens and I do not see anything reported on the console either. It only sees the buttons in discovery mode. Any ideas? I am using port 8181 on the node proxy and the smart app. Also verified the secret is correct as well as the MAC addresses in the config.json file. TIA.

[2017-12-07T02:04:16.217Z] [stnp] SmartThings Node Proxy listening at http://0.0.0.0:8181
[2017-12-07T02:04:17.297Z] [stnp] Loaded plugin: dash

I skimmed through this thread, and didn’t see this specific question anywhere. Sorry if it’s a repeat…

My question has to do with ‘Notifications’.
I did see this general issue addressed in this thread (i.e. turn off notifications results in them all being turned off; even for ‘real’ ordering buttons you may have).

However, what I’m wondering about is a little different…

Is it possible to configure a router (with DD-WRT) to ‘catch’ messages from a given Amazon Dash Button (via MAC address), and only allow it to interact on the LAN, and block it from getting out to the internet?

If so, then we could use these on our LAN (for SmartThings, etc) all we want without them ever connecting to Amazon at all (that is, if I’m properly understanding how they work).

Ideas?

That sounds like an iptables question. I think it’s possible, but unsure how it would integrate within this topic.

DD-WRT = Linux using iptables … So, first thing I would look at to do something like this would be to check out other people doing MAC based routing on DD-WRT/iptables. Good news is my first search did provide something similar to what you’re asking for:

1 Like

That’s right… the Amazon Surprise Sweets button gets tied to the Surprise Sweets so if you ever press it, it places an order… lol… unless you implement one of the following work arounds listed in the first post under How to Block Orders. I’ve implemented the DNS block and it works great!

Yeah - there are some options posted in the other threads that also use the STNP:

Planning to add a default startup service/script for the RPi to the repo… but it’ll probably be end of the month.

Yeah… you and me both… check the update titled How to Block Orders in the first post to fix.

Yeah - the notify.address in the config.json is not correct… it should point to the SmartThings Hub.

Don’t worry about the http://0.0.0.0 vs http://:::8080… once you identified the buttons in discovery mode, did you put the MAC address for those buttons in the config.json and restart the STNP service? If you don’t see a message that says…

[2017-12-12T05:22:49.506Z] [dash] {"address":"44:65:0d:41:e1:50","status":"active"}

…then the STNP service is not detecting the button press which could be one of the following:

  • MAC address not set in config.json
  • Dash Button not on same network as STNP
  • Button configuration not complete with the Amazon App… note that when it’s correctly configured it’ll blink a couple times in white and then blink fast in red

@sgnihttrams @sfinney check the update titled How to Block Orders in the first post to fix.

1 Like

Thanks.
I just took a look in my DD-WRT router configs, and I found where I can create Access Policies. I created one that specifically denies internet access for all of my Dash Buttons. So, I think I should be good to go as far as that is concerned.

Now, I need to go back to the top, and read through everything carefully so I can try to actually do this thing… :slight_smile:

So either I did something wrong with my firewall or this does not work by blocking the mac address. I push the button the switch t I have set up turns on however the white light On the dash continued to flash for a long time and then the switch turns back off.

Can this be done with the Google Wifi router? I’m not seeing either of those two options…

Check and make sure that your access rules are not completely blocking access… ie. these MAC rules are usually used to prevent a device from connecting to your router, in which case the Dash button won’t even be able to connect to your LAN. You may also want to re-run the button setup to make sure that it’s got the right wifi settings, etc. When it works, it pulses white slowly and then flashes rapidly red.

Looks like that’s a no… you’d need to put a router in front of the Google Wifi that can set local DNS and then configure the Google Wifi to use the router for DNS resolution. If you’re looking for a good option… get a Ubiquiti EdgeRouter.

Thanks…it might be easier just to get a remote button…:slight_smile:

1 Like

@redloro

I’m trying this on a Windows 10 system, and (of course) having difficulty lol

When it came time to ‘install’ pcap, I got the Windows 10 version (Win10Pcap).
Now I’m getting this when I try to run node…

>node server.js
[2017-12-14T00:39:59.756Z] [stnp] SmartThings Node Proxy listening at http://:::8080
module.js:538
    throw err;
    ^

Error: Cannot find module 'pcap'
    at Function.Module._resolveFilename (module.js:536:15)
    at Function.Module._load (module.js:466:25)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (STNP\plugins\dash.js:22:12)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)

I put the Win10Pcap install directory in my PATH.

ALSO,
sorry that I didn’t say this first…but when I ran ‘npm run install:dash’, I got this…

STNP>npm run install:dash

> smartthings-nodeproxy@1.0.0 install:dash STNP
> npm install && npm install git+https://github.com/mranney/node_pcap.git

up to date in 1.032s
npm ERR! code ENOGIT
npm ERR! No git binary found in $PATH
npm ERR!
npm ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\CurrentUser\AppData\Roaming\npm-cache\_logs\2017-12-14T01_03_52_663Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! smartthings-nodeproxy@1.0.0 install:dash: `npm install && npm install git+https://github.com/mranney/node_pcap.git`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the smartthings-nodeproxy@1.0.0 install:dash script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\CurrentUser\AppData\Roaming\npm-cache\_logs\2017-12-14T01_03_52_709Z-debug.log

I then also installed git for Windows, and put it in my PATH, but it’s still giving the same messages, and I’m not sure what else may be needed on that either.

Any idea what to try next to troubleshoot (or fix) this?

Lmao… touche.

After installing WinPcap did you run in the same folder where server.js is located?

npm install git+https://github.com/mranney/node_pcap.git

@redloro

Oops…was that something I missed?

I just ran it now, and got this…

C:\STNP>npm install git+https://github.com/mranney/node_pcap.git

> socketwatcher@0.3.0 install C:\STNP\node_modules\socketwatcher
> node-gyp rebuild


C:\STNP\node_modules\socketwatcher>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\STNP\node_modules\socketwatcher
gyp ERR! node -v v8.9.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! socketwatcher@0.3.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the socketwatcher@0.3.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\CurrentUser\AppData\Roaming\npm-cache\_logs\2017-12-14T03_26_06_883Z-debug.log

So, is my next step to install Python?