Skip to content
This repository has been archived by the owner on Aug 1, 2020. It is now read-only.

New Amazon Dash buttons not detected #36

Closed
tommcintyre opened this issue Oct 7, 2016 · 5 comments
Closed

New Amazon Dash buttons not detected #36

tommcintyre opened this issue Oct 7, 2016 · 5 comments
Labels

Comments

@tommcintyre
Copy link

It appears that "new" model Dash buttons (they have finally been released in the UK, and I'm playing with one on the day of release) behave differently when connecting to the network than the previous models.

Rather than broadcasting an ARP request from 0.0.0.0, they instead broadcast a DHCP request from 0.0.0.0. They do then send out ARP requests for other network devices (e.g. the gateway), but these have the source IP set to the address allocated to the device.

The following patch to build/ArpProbes.js fixes this, and should properly handle both the new and old button varieties. Change:

const ARP_PROBE_FILTER = 'arp src host 0.0.0.0';

to

const ARP_PROBE_FILTER = '(arp or (udp and src port 68 and dst port 67)) and src host 0.0.0.0';

(I believe udp and src port 68 and dst port 67 is the most succinct way to filter DHCP request packets.)

@ide ide added the bug label Oct 7, 2016
@ide
Copy link
Owner

ide commented Oct 7, 2016

Thanks for the detailed report and investigation! Dash Buttons update their firmware OTA I believe, so this fix applies to old Dash Buttons with the new firmware, too.

@ide
Copy link
Owner

ide commented Oct 7, 2016

This might take a little longer to fix since that filter applies to DHCP discovery and request packets, and we only want one of them or else the Dash Button handler might get invoked twice per press. The UDP packet payload contains the data needed to identify DHCP discovery packets, I have a bit to learn since I'm not familiar with the packet format though.

@tommcintyre
Copy link
Author

tommcintyre commented Oct 7, 2016

Ahh, good to know that they can be remotely updated - something to keep in mind as more people buy dash buttons just to hack them!

I couldn't see any DHCP Discovery packets here, but that must just be my network configuration... However, I think the following could be added to the filter spec to restrict it to DHCP Request packets only:

udp[247:4] == 0x63350103

(I found this magic number floating around on the Internet, but confirmed it using WireShark - see image below. It does a 4-byte numeric comparison (has to be 1 byte, 4 bytes, etc.) which catches the last byte of the DHCP magic number, and verifies that the next 3 bytes are a "Request" message type option. I believe this is always the first option specified.)

packet

So the full filter could be something like:

(arp or (udp and src port 68 and dst port 67 and udp[247:4] == 0x63350103)) and src host 0.0.0.0

@PabloOyarzo
Copy link

The sad thing is that this error is why almost all scripts I find on google doesn't work on my computer. I was planning to give a presentation of IoT with this device but I don't think I'll be able as I've tried at least 5 scripts and none of them seem to work. If any of you wants to give me a hand I'll be much appreciated.

@ide ide closed this as completed in bbcd1da Oct 17, 2016
@ide
Copy link
Owner

ide commented Oct 17, 2016

@tommcintyre Thanks for the detailed investigation! I've tested it with a Dash Button of mine and published v2.0.0 to npm.

@PabloOyarzo If you want dedicated support you should get the AWS IoT buttons (https://smile.amazon.com/dp/B01C7WE5WM) instead of the consumer-facing Dash Buttons.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants