Skip to content

Instantly share code, notes, and snippets.

@soukupl
Last active November 7, 2017 17:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save soukupl/f24ed0f699e5c268587b5778277932d7 to your computer and use it in GitHub Desktop.
Save soukupl/f24ed0f699e5c268587b5778277932d7 to your computer and use it in GitHub Desktop.
You will need to install COAP client... I forgot from where I did instal it, sorry :( (it's long time ago)
1. Create identity:
coap-client -m post -u "Client_identity" -k "YOUR_SECURITY_CODE" -e '{"9090":"IDENTITY"}' "coaps://YOUR_GW_IP:5684/15011/9063"
2. You will get pre-sared key in response
{"9091":"YOUR_PRESHARED_KEY","9029":"1.2.0042"}
3. Ask the gateway for info (/15011/15012 command)
coap-client -m get -u "IDENTITY" -k "YOUR_PRESHARED_KEY" "coaps://YOUR_GW_IP:5684/15011/15012"
4. You will get long response... look for number in format XXX-XX-XXX - this is your HomeKit Code!
NOTES:
YOUR_SECURITY_CODE - it's printet on the bottom of the gateway
IDENTITY - seems like it is an name/id of the identity... I just used the word "IDENTITY" and it worked.
YOUT_GW_IP - well, IP address :D
YOUR_PRESHARED_KEY - random characters "password" for your identity... Just keep it safe :)
@hvanderlaan
Copy link

building coap-client

git clone --depth 1 --recursive -b dtls https://github.com/home-assistant/libcoap.git
cd libcoap
./autogen.sh
./configure --disable-documentation --disable-shared --without-debug CFLAGS="-D COAP_DEBUG_FD=stderr"
make
sudo make install

@jfrobs
Copy link

jfrobs commented Nov 1, 2017

capture d ecran 2017-11-01 a 10 36 48

Problem with your script on my Mac :/ Idea ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment