Closed YannikW closed 6 years ago
How many network interfaces you have on device. Can you paste here the output from curl command specified in wiki - debug ?
Thanks for your fast reply!
I'm using a raspi 2 with only ethernet connected. (Did you mean this?)
Here is the output from debug curl command:
pi@raspberrypi:~ $ curl https://127.0.0.1/api/nouse/config -v -k
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-ECDSA-AES128-GCM-SHA256
* ALPN, server did not agree to a protocol
* Server certificate:
* subject: C=NL; O=Philips Hue; CN=b827ebfffe35010f
* start date: Sep 25 16:10:41 2018 GMT
* expire date: Oct 25 16:10:41 2018 GMT
* issuer: C=NL; O=Philips Hue; CN=b827ebfffe35010f
* SSL certificate verify result: unable to get local issuer certificate (20), c ontinuing anyway.
> GET /api/nouse/config HTTP/1.1
> Host: 127.0.0.1
> User-Agent: curl/7.52.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: nginx
< Date: Wed, 31 Oct 2018 16:37:33 GMT
< Content-type: application/json
< Content-Length: 86
<
* Curl_http_done: called premature == 0
* Connection #0 to host 127.0.0.1 left intact
[{"error":{"type":1,"description":"unauthorized user","address":"/api/nouse/conf
It seems the last line is incorrect - how can I fix this?
Hi, there is a issue with curl command,
curl https://127.0.0.1/api/nouse/config -v -k
must be
curl https://127.0.0.1/api/nouser/config -v -k
Okay, here is the new output:
pi@raspberrypi:~ $ curl https://127.0.0.1/api/nouser/config -v -k
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-ECDSA-AES128-GCM-SHA256
* ALPN, server did not agree to a protocol
* Server certificate:
* subject: C=NL; O=Philips Hue; CN=b827ebfffe35010f
* start date: Sep 25 16:10:41 2018 GMT
* expire date: Oct 25 16:10:41 2018 GMT
* issuer: C=NL; O=Philips Hue; CN=b827ebfffe35010f
* SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.
> GET /api/nouser/config HTTP/1.1
> Host: 127.0.0.1
> User-Agent: curl/7.52.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Server: nginx
< Date: Wed, 31 Oct 2018 19:16:58 GMT
< Content-type: application/json
< Content-Length: 227
<
* Curl_http_done: called premature == 0
* Connection #0 to host 127.0.0.1 left intact
{"starterkitid":"","swversion":"1809121051","replacesbridgeid":null,"bridgeid":"B827EBFFFE35010F","name":"Philips hue","datastoreversion":70,"mac":"b8:27:eb:35:01:0f","modelid":"BSB002","factorynew":false,"apiversion":"1.24.0"}
Looks ok, is the mac address of the interface connected to your LAN b8:27:eb:35:01:0f
? If yes, start the script in debug mode to see the output during pairing process. Are you sure you wipe the data of hue application on your mobile phone, because so far is behave like the app refuse the certificate?
I checked the MAC address and it is correct.
This is the output in debug mode:
pi@raspberrypi:/opt/hue-emulator $ sudo ./HueEmulator3.py
2018-11-01 10:36:10,765 - root - DEBUG - b827eb35010f
2018-11-01 10:36:10,783 - root - DEBUG - Config loaded
2018-11-01 10:36:10,869 - requests.packages.urllib3.connectionpool - DEBUG - Starting new HTTP connection (1): 127.0.0.1
2018-11-01 10:36:10,885 - requests.packages.urllib3.connectionpool - DEBUG - http://127.0.0.1:8080 "GET /api/283145a4e198cc6535/config HTTP/1.1" 200 1660
2018-11-01 10:36:10,914 - requests.packages.urllib3.connectionpool - DEBUG - Starting new HTTP connection (1): 127.0.0.1
2018-11-01 10:36:10,928 - requests.packages.urllib3.connectionpool - DEBUG - http://127.0.0.1:8080 "GET /api/283145a4e198cc6535/lights HTTP/1.1" 200 2178
2018-11-01 10:36:10,951 - requests.packages.urllib3.connectionpool - DEBUG - Starting new HTTP connection (1): 127.0.0.1
2018-11-01 10:36:10,962 - requests.packages.urllib3.connectionpool - DEBUG - http://127.0.0.1:8080 "GET /api/283145a4e198cc6535/sensors HTTP/1.1" 200 756
2018-11-01 10:36:10,969 - root - DEBUG - Starting deconz websocket
2018-11-01 10:36:10,980 - root - DEBUG - start ssdp broadcast
2018-11-01 10:36:10,982 - root - DEBUG - starting ssdp...
2018-11-01 10:36:10,988 - root - DEBUG - sync with lights
2018-11-01 10:36:11,007 - root - DEBUG - Starting httpd...
2018-11-01 10:36:11,025 - requests.packages.urllib3.connectionpool - DEBUG - Starting new HTTP connection (1): 192.168.192.35
2018-11-01 10:36:11,051 - root - DEBUG - Starting ssl httpd...
2018-11-01 10:36:11,144 - requests.packages.urllib3.connectionpool - DEBUG - http://192.168.192.35:80 "GET /get?light=1 HTTP/1.1" 200 93
192.168.192.52 - - [01/Nov/2018 10:36:35] "GET /hue/linkbutton HTTP/1.1" 401 -
----------------------------------------
Exception happened during processing of request from ('192.168.192.52', 51756)
192.168.192.52 - - [01/Nov/2018 10:36:41] "GET /hue/linkbutton HTTP/1.1" 200 -
Traceback (most recent call last):
File "/usr/lib/python3.5/socketserver.py", line 625, in process_request_thread
self.finish_request(request, client_address)
File "/usr/lib/python3.5/socketserver.py", line 354, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.5/socketserver.py", line 681, in __init__
self.handle()
File "/usr/lib/python3.5/http/server.py", line 424, in handle
self.handle_one_request()
File "/usr/lib/python3.5/http/server.py", line 390, in handle_one_request
self.raw_requestline = self.rfile.readline(65537)
File "/usr/lib/python3.5/socket.py", line 576, in readinto
return self._sock.recv_into(b)
ConnectionResetError: [Errno 104] Connection reset by peer
----------------------------------------
192.168.192.52 - - [01/Nov/2018 10:36:42] code 404, message not found
192.168.192.52 - - [01/Nov/2018 10:36:42] "GET /favicon.ico HTTP/1.1" 404 -
2018-11-01 10:36:55,500 - root - DEBUG - Sending M-Search response to 192.168.192.52
2018-11-01 10:36:57,744 - root - DEBUG - Sending M-Search response to 192.168.192.52
2018-11-01 10:36:59,148 - root - DEBUG - Sending M-Search response to 192.168.192.52
2018-11-01 10:37:00,451 - root - DEBUG - Sending M-Search response to 192.168.192.52
2018-11-01 10:37:02,255 - root - DEBUG - Sending M-Search response to 192.168.192.52
2018-11-01 10:37:03,459 - root - DEBUG - Sending M-Search response to 192.168.192.52
2018-11-01 10:37:05,363 - root - DEBUG - Sending M-Search response to 192.168.192.52
192.168.192.21 - - [01/Nov/2018 10:37:10] "GET /api/nouser/config HTTP/1.1" 200 -
2018-11-01 10:37:11,452 - root - DEBUG - Sending M-Search response to 192.168.192.21
192.168.192.21 - - [01/Nov/2018 10:37:18] "GET /api/nouser/config HTTP/1.1" 200 -
192.168.192.21 - - [01/Nov/2018 10:37:18] "POST /api/ HTTP/1.1" 200 -
2018-11-01 10:37:18,950 - root - DEBUG - in post method
2018-11-01 10:37:18,951 - root - DEBUG - /api/
2018-11-01 10:37:18,952 - root - DEBUG - b'{"devicetype":"Hue 3#Samsung SM-G965F","generateclientkey":true}'
192.168.192.52 - - [01/Nov/2018 10:37:30] "GET /hue/linkbutton?username=&password=&action=Activate HTTP/1.1" 200 -
192.168.192.52
is my local IP from my computer (where I cklick the active button. and 192.168.192.21
is the local IP of my phone with Hue app.
I propose to do this:
Basically will be like you are a new user.
This will delete my config completly, right? Can I just copy the config.json file and restore it? I would like to try this before performing a complete reset.. All that configuration again would suck 😒
Better move the folder to different location to have a backup not only to config but also to certificates. Then you can restore the preview config.json file and manually append the new username from config=>whitelist.
Thanks alot - it works again!
Steps to fix:
No need for copying some whitelist entries, because they were identical.. Still no idea what caused the problem, but now it works again :)
Describe the bug Hue App found the diyHue bridge, but it can't esablish the connection because app doesn't see the Linkbutton press.
My system worked before, but after my App prompted me a bridge update is available it doesn't connect anymore.
To Reproduce Steps to reproduce the behavior:
Expected behavior It should establish the connection to the bridge after click "Activate"
Additional context I tried reinstalling the Hue App - still doesn't connect. I performed a hue-emulator update - still doesn't connect.
I can turn my lights on and off with my tradfri switch and on the web interface - but I cannot connect the hue app.