mariusmotea / diyHue

Philips Hue emulator that is able to control multiple types of lights
Other
627 stars 107 forks source link

out of range #441

Closed camatthew closed 5 years ago

camatthew commented 5 years ago

Describe the bug i get index out of range in the terminql and pqge reset in the browser

To Reproduce Steps to reproduce the behavior:

  1. Go to the .py file in /opt/hue-emulator
  2. go to localhost/tradfri
  3. put in details for tradfri gateway
  4. see the error in terminal and browser

Expected behavior A clear and concise description of what you expected to happen.

Logs If applicable, provide output logs. These can be obtained via manually running HueEmulator3.py with python3 HueEmulator3.py.

Additional context Add any other context about the problem here.

mariusmotea commented 5 years ago

But why you use the shell for this operation? Jut open in browser /tradfri page and ensure the details are correct.

camatthew commented 5 years ago

yes i know they are correct because i copied and pasted it from the psk on the qr code.

camatthew commented 5 years ago

i was in the shell to get the log

mariusmotea commented 5 years ago

Can you paste here entire error output to see on what line it happen?

camatthew commented 5 years ago

https://hastebin.com/piwigeferu.rb

mariusmotea commented 5 years ago

Ok, i will debug today with my gateway. I believe the output was changed with new firmware updates

mariusmotea commented 5 years ago

Hi,

I did not manage to replicate the issue.

192.168.10.51 - - [16/Nov/2018 19:11:54] "GET /tradfri?ip=192.168.10.12&code=4Rk                                                                                                 rHCWYKUzADBaE HTTP/1.1" 200 -
2018-11-16 19:11:54,373 - root - DEBUG - []
2018-11-16 19:11:55,601 - root - DEBUG - Sending M-Search response to 192.168.10.51                                                                                            

Can you paste the output of the following command here?

./coap-client-linux -m post -u "Client_identity" -k "{code}" -e '{"9090\":"hue-emulatorxxx"}' "coaps://192.168.x.x:5684/15011/9063"

replace the {code} with the security key and correct the ip with the real one.

camatthew commented 5 years ago

mystery@Bag-of-Mystery:/opt/hue-emulator$ ./coap-client-linux -m post -u "Client_identity" -k "AX33pBP3PUZ3D3xh" -e '{"9090\":"hue-emulatorxxx"}' "coaps://192.168.0.18:5684/15011/9063" v:1 t:CON c:POST i:75e6 {} [ ] 4.00

mariusmotea commented 5 years ago

OK, this show no output from your Tradfri Gateway. I provide here the output from my device:

With invalid key:

pi@raspberrypi:/opt/hue-emulator $  ./coap-client-linux -m post -u "Client_identity" -k "AX33pBP3PUZ3D3xh" -e '{"9090":"hue-emulatorxxx"}' "coaps://192.168.10.12:5684/15011/9063"
v:1 t:CON c:POST i:7d38 {} [ ]
Nov 17 12:26:10 ALRT 20 invalidate peer
Nov 17 12:26:10 WARN received alert, peer has been invalidated

with valid key:

pi@raspberrypi:/opt/hue-emulator $ ./coap-client-linux -m post -u "Client_identity" -k "4RkrHCWYKUzADBaE" -e '{"9090":"hue-emulatorxxx"}' "coaps://192.168.10.12:5684/15011/9063"
v:1 t:CON c:POST i:c33c {} [ ]
decrypt_verify(): found 24 bytes cleartext
decrypt_verify(): found 50 bytes cleartext
{"9091":"aQF27OSDFGNlsf7a","9029":"1.4.0015"}

to different ip with no coap server the output is like your, so very likely the ip is wrong or a firewall is blocking this traffic.

pi@raspberrypi:/opt/hue-emulator $ ./coap-client-linux -m post -u "Client_identity" -k "{code}" -e '{"9090\":"hue-emulatorxxx"}' "coaps://192.168.10.110:5684/15011/9063"
v:1 t:CON c:POST i:2ea5 {} [ ]

Important, you must not use same username twice, this is the reason i put there hue-emulatorxxx, after successful pair you need to replace xxx with something else.

camatthew commented 5 years ago

mystery@Bag-of-Mystery:/opt/hue-emulator$ ./coap-client-linux -m post -u "Client_identity" -k "AX33pBP3PUZ3D3xh" -e '{"9090":"hue-emulatorq4793"}' "coaps://192.168.0.18:5684/15011/9063" v:1 t:CON c:POST i:9664 {} [ ] {"9091":"DtcmCmNxuRnQJhQS","9029":"1.4.0015"}

mariusmotea commented 5 years ago

ok, so the issue is clear now for me, you have less lines in output. What device/OS are you using? If you want a quick fix you need to search in HueEmulator3.py for coap-client-linux and at the end of every line there is .decode('utf-8').split("\n")[3]). Instead of 3 you must put 1.

Missing lines are:

decrypt_verify(): found 24 bytes cleartext
decrypt_verify(): found 50 bytes cleartext
mariusmotea commented 5 years ago

i made an update to address this problem, please check it .

camatthew commented 5 years ago

i dont get page reset but it shows no lights and ``mystery@Bag-of-Mystery:/opt/hue-emulator$ sudo ./HueEmulator3.py 127.0.0.1 - - [17/Nov/2018 20:21:18] "GET /tradfri?ip=192.168.0.18&code=AX33pBP3PUZ3D3xh HTTP/1.1" 200 - v:1 t:CON c:POST i:206c {} [ ] v:1 t:CON c:GET i:78d5 {} [ ] v:1 t:CON c:GET i:765f {} [ ] v:1 t:CON c:GET i:9ae8 {} [ ] 127.0.0.1 - - [17/Nov/2018 20:21:19] code 404, message not found 127.0.0.1 - - [17/Nov/2018 20:21:19] "GET /favicon.ico HTTP/1.1" 404 - 127.0.0.1 - - [17/Nov/2018 20:21:19] code 404, message not found 127.0.0.1 - - [17/Nov/2018 20:21:19] "GET /favicon.ico HTTP/1.1" 404 -

Exception happened during processing of request from ('127.0.0.1', 60132) 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 422, in handle self.handle_one_request() File "/usr/lib/python3.5/http/server.py", line 410, in handle_one_request method() File "./HueEmulator3.py", line 1407, in do_GET self.send_error(404, 'not found') File "/usr/lib/python3.5/http/server.py", line 477, in send_error self.wfile.write(body) File "/usr/lib/python3.5/socket.py", line 594, in write return self._sock.send(b) BrokenPipeError: [Errno 32] Broken pipe

192.168.0.23 - - [17/Nov/2018 20:23:43] "GET /description.xml HTTP/1.1" 200 - 192.168.0.23 - - [17/Nov/2018 20:23:43] "GET /description.xml HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:02] "GET / HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:02] "GET /static/css/main.23de7225.css HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:02] "GET /config.js HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:02] "GET /static/js/main.7409e575.js HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:05] "GET /favicon-16x16.png HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:06] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:06] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:07] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:07] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - v:1 t:CON c:GET i:1e6e {} [ ] 127.0.0.1 - - [17/Nov/2018 20:25:08] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:08] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:08] "GET / HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:08] "GET /static/css/main.23de7225.css HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:08] "GET /config.js HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:08] "GET /static/js/main.7409e575.js HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:12] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:12] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:13] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:13] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:13] "PUT /api/web-ui-76825/groups/0/action HTTP/1.1" 200 - v:1 t:CON c:PUT i:1a65 {} [ ] 127.0.0.1 - - [17/Nov/2018 20:25:14] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:14] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:15] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:15] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:15] "PUT /api/web-ui-76825/groups/0/action HTTP/1.1" 200 - v:1 t:CON c:PUT i:395c {} [ ] 127.0.0.1 - - [17/Nov/2018 20:25:16] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:16] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:16] "PUT /api/web-ui-76825/groups/0/action HTTP/1.1" 200 - v:1 t:CON c:PUT i:c0b2 {} [ ] 127.0.0.1 - - [17/Nov/2018 20:25:16] "PUT /api/web-ui-76825/groups/0/action HTTP/1.1" 200 - v:1 t:CON c:PUT i:ec61 {} [ ] 127.0.0.1 - - [17/Nov/2018 20:25:17] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:17] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:18] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:25:18] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - v:1 t:CON c:GET i:47b2 {} [ ] 127.0.0.1 - - [17/Nov/2018 20:25:21] "GET /tradfri?ip=&code= HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:28:58] "GET /tradfri?ip=192.168.0.18&code=AX33pBP3PUZ3D3xh HTTP/1.1" 200 - v:1 t:CON c:POST i:ace9 {} [ ] v:1 t:CON c:GET i:ace9 {} [ ] v:1 t:CON c:GET i:fd15 {} [ ] v:1 t:CON c:GET i:f326 {} [ ] 127.0.0.1 - - [17/Nov/2018 20:29:19] "GET /tradfri?ip=192.168.0.18&code=AX33pBP3PUZ3D3xh HTTP/1.1" 200 - v:1 t:CON c:POST i:fdbf {} [ ] v:1 t:CON c:GET i:206c {} [ ] v:1 t:CON c:GET i:206c {} [ ] v:1 t:CON c:GET i:d3dd {} [ ] 192.168.0.3 - - [17/Nov/2018 20:29:55] "GET /description.xml HTTP/1.1" 200 - 192.168.0.3 - - [17/Nov/2018 20:29:55] "GET /description.xml HTTP/1.1" 200 - ^CTraceback (most recent call last): File "./HueEmulator3.py", line 1706, in sleep(10) KeyboardInterrupt ^CException ignored in: <module 'threading' from '/usr/lib/python3.5/threading.py'> Traceback (most recent call last): File "/usr/lib/python3.5/threading.py", line 1288, in _shutdown t.join() File "/usr/lib/python3.5/threading.py", line 1054, in join self._wait_for_tstate_lock() File "/usr/lib/python3.5/threading.py", line 1070, in _wait_for_tstate_lock elif lock.acquire(block, timeout): KeyboardInterrupt mystery@Bag-of-Mystery:/opt/hue-emulator$ ^C mystery@Bag-of-Mystery:/opt/hue-emulator$ sudo ./HueEmulator3.py v:1 t:CON c:GET i:4b5d {} [ ] 127.0.0.1 - - [17/Nov/2018 20:31:04] "GET /tradfri?ip=192.168.0.18 HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:31:32] "GET /tradfri?ip=192.168.0.18&code=AX33pBP3PUZ3D3xh HTTP/1.1" 200 - v:1 t:CON c:POST i:e158 {} [ ] v:1 t:CON c:GET i:0765 {} [ ] v:1 t:CON c:GET i:eb16 {} [ ] 127.0.0.1 - - [17/Nov/2018 20:32:02] "GET / HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:03] "GET /static/css/main.23de7225.css HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:03] "GET /config.js HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:03] "GET /static/js/main.7409e575.js HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:06] "GET /favicon-16x16.png HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:06] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:06] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:07] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:07] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:08] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:08] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - v:1 t:CON c:GET i:24f3 {} [ ] 127.0.0.1 - - [17/Nov/2018 20:32:09] "GET / HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:09] "GET /static/css/main.23de7225.css HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:09] "GET /config.js HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:09] "GET /static/js/main.7409e575.js HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:13] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:13] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:14] "GET / HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:14] "GET /static/css/main.23de7225.css HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:14] "GET /config.js HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:14] "GET /static/js/main.7409e575.js HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:17] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:17] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:18] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:18] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:19] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:19] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:21] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:21] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:22] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:22] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:22] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:22] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - v:1 t:CON c:GET i:8a2c {} [ ] 127.0.0.1 - - [17/Nov/2018 20:32:24] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:24] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:24] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:24] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:25] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:25] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:27] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:27] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:28] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:28] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:28] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:28] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:29] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:30] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:30] "GET /tradfri?ip=192.168.0.18&code=AX33pBP3PUZ3D3xh HTTP/1.1" 200 - v:1 t:CON c:POST i:4b45 {} [ ] 127.0.0.1 - - [17/Nov/2018 20:32:31] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:31] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - v:1 t:CON c:GET i:99c2 {} [ ] 127.0.0.1 - - [17/Nov/2018 20:32:31] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:32] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:33] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:33] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:33] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:33] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - v:1 t:CON c:GET i:f411 {} [ ] 127.0.0.1 - - [17/Nov/2018 20:32:34] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:34] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:35] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:36] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:36] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:37] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:37] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:38] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:38] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:39] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:40] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:40] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:40] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:41] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:42] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:42] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:42] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:43] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:44] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:44] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:45] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:45] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - v:1 t:CON c:GET i:4650 {} [ ] 127.0.0.1 - - [17/Nov/2018 20:32:45] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:46] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:47] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:47] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:48] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:48] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:49] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:49] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:50] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:50] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:51] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:51] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:52] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:52] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:53] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:53] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:54] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:54] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:55] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:55] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:56] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:56] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - v:1 t:CON c:GET i:258a {} [ ] 127.0.0.1 - - [17/Nov/2018 20:32:57] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:57] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:58] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:58] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:59] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:32:59] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:00] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:00] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:01] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:01] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:02] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:02] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:03] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:03] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:04] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:04] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:05] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:05] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:06] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:06] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:07] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:07] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - v:1 t:CON c:GET i:e4c4 {} [ ] 127.0.0.1 - - [17/Nov/2018 20:33:08] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:08] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:09] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:09] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:10] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:10] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:11] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:11] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:12] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:12] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:13] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:13] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:14] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:14] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:15] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:15] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:16] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:16] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:17] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:17] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:18] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:18] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - v:1 t:CON c:GET i:cf08 {} [ ] 127.0.0.1 - - [17/Nov/2018 20:33:19] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:19] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:20] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:20] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:21] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:21] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:22] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:22] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:23] "GET /api/web-ui-76825/groups HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:23] "GET /api/web-ui-76825/lights HTTP/1.1" 200 - 127.0.0.1 - - [17/Nov/2018 20:33:37] "GET /tradfri?ip=192.168.0.18&code=AX33pBP3PUZ3D3xh HTTP/1.1" 200 - v:1 t:CON c:POST i:797a {} [ ] v:1 t:CON c:GET i:e962 {} [ ] v:1 t:CON c:GET i:206a {} [ ] v:1 t:CON c:GET i:cf08 {} [ ]

Exception happened during processing of request from ('127.0.0.1', 46974) 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 422, 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) File "/usr/lib/python3.5/ssl.py", line 937, in recv_into return self.read(nbytes, buffer) File "/usr/lib/python3.5/ssl.py", line 799, in read return self._sslobj.read(len, buffer) File "/usr/lib/python3.5/ssl.py", line 583, in read v = self._sslobj.read(len, buffer) ssl.SSLError: [SSL: TLSV1_ALERT_UNKNOWN_CA] tlsv1 alert unknown ca (_ssl.c:2090)


Exception happened during processing of request from ('127.0.0.1', 60278) 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 422, in handle self.handle_one_request() File "/usr/lib/python3.5/http/server.py", line 410, in handle_one_request method() File "./HueEmulator3.py", line 1234, in do_GET lights_found = scanTradfri() File "./HueEmulator3.py", line 857, in scanTradfri device_parameters = json.loads(check_output("./coap-client-linux -m get -u \"" + bridge_config["tradfri"]["identity"] + "\" -k \"" + bridge_config["tradfri"]["psk"] + "\" \"coaps://" + bridge_config["tradfri"]["ip"] + ":5684/15001/" + str(device) +"\"", shell=True).decode('utf-8').rstrip('\n').split("\n")[-1]) File "/usr/lib/python3.5/json/init.py", line 319, in loads return _default_decoder.decode(s) File "/usr/lib/python3.5/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

127.0.0.1 - - [17/Nov/2018 20:34:40] "GET /tradfri?ip=192.168.0.18&code=AX33pBP3PUZ3D3xh HTTP/1.1" 200 - v:1 t:CON c:POST i:1135 {} [ ] v:1 t:CON c:GET i:fdbf {} [ ] v:1 t:CON c:GET i:2d32 {} [ ] v:1 t:CON c:GET i:2c1b {} [ ] ^C---------------------------------------- Exception happened during processing of request from ('127.0.0.1', 60284) 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 410, in handle_one_request method() File "./HueEmulator3.py", line 1234, in do_GET lights_found = scanTradfri() File "./HueEmulator3.py", line 853, in scanTradfri tradri_devices = json.loads(check_output("./coap-client-linux -m get -u \"" + bridge_config["tradfri"]["identity"] + "\" -k \"" + bridge_config["tradfri"]["psk"] + "\" \"coaps://" + bridge_config["tradfri"]["ip"] + ":5684/15001\"", shell=True).decode('utf-8').rstrip('\n').split("\n")[-1]) File "/usr/lib/python3.5/subprocess.py", line 316, in check_output **kwargs).stdout File "/usr/lib/python3.5/subprocess.py", line 398, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command './coap-client-linux -m get -u "Hue-Emulator-258" -k "bEYA05c3c9okCOoq" "coaps://192.168.0.18:5684/15001"' returned non-zero exit status -2

Traceback (most recent call last): File "./HueEmulator3.py", line 1706, in sleep(10) KeyboardInterrupt ^CException ignored in: <module 'threading' from '/usr/lib/python3.5/threading.py'> Traceback (most recent call last): File "/usr/lib/python3.5/threading.py", line 1288, in _shutdown t.join() File "/usr/lib/python3.5/threading.py", line 1054, in join self._wait_for_tstate_lock() File "/usr/lib/python3.5/threading.py", line 1070, in _wait_for_tstate_lock elif lock.acquire(block, timeout): KeyboardInterrupt mystery@Bag-of-Mystery:/opt/hue-emulator$ ^C mystery@Bag-of-Mystery:/opt/hue-emulator$ ^C mystery@Bag-of-Mystery:/opt/hue-emulator$ sudo ./HueEmulator3.py v:1 t:CON c:GET i:5b15 {} [ ] 127.0.0.1 - - [17/Nov/2018 20:35:19] "GET /tradfri?ip=192.168.0.18&code=AX33pBP3PUZ3D3xh HTTP/1.1" 200 - v:1 t:CON c:POST i:bb23 {} [ ] v:1 t:CON c:GET i:bb23 {} [ ] v:1 t:CON c:GET i:64c2 {} [ ] v:1 t:CON c:GET i:75e6 {} [ ] 127.0.0.1 - - [17/Nov/2018 20:35:20] "GET /tradfri?ip=192.168.0.18&code=AX33pBP3PUZ3D3xh HTTP/1.1" 200 - v:1 t:CON c:POST i:64f5 {} [ ] 127.0.0.1 - - [17/Nov/2018 20:35:21] "GET /tradfri?ip=192.168.0.18&code=AX33pBP3PUZ3D3xh HTTP/1.1" 200 - v:1 t:CON c:POST i:2a8e {} [ ] 127.0.0.1 - - [17/Nov/2018 20:35:22] "GET /tradfri?ip=192.168.0.18&code=AX33pBP3PUZ3D3xh HTTP/1.1" 200 - v:1 t:CON c:GET i:4547 {} [ ] v:1 t:CON c:POST i:424c {} [ ] v:1 t:CON c:GET i:9d6a {} [ ] v:1 t:CON c:GET i:9425 {} [ ] v:1 t:CON c:GET i:f28b {} [ ]

Exception happened during processing of request from ('127.0.0.1', 60386) v:1 t:CON c:GET i:89f8 {} [ ] 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 422, in handle self.handle_one_request() File "/usr/lib/python3.5/http/server.py", line 410, in handle_one_request method() File "./HueEmulator3.py", line 1236, in do_GET self._set_end_headers(bytes(webformTradfri() + "
No lights where found", "utf8")) File "./HueEmulator3.py", line 1194, in _set_end_headers self.wfile.write(data) File "/usr/lib/python3.5/socket.py", line 594, in write return self._sock.send(b) BrokenPipeError: [Errno 32] Broken pipe

v:1 t:CON c:GET i:ace9 {} [ ]

Exception happened during processing of request from ('127.0.0.1', 60388) 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 422, in handle self.handle_one_request() File "/usr/lib/python3.5/http/server.py", line 410, in handle_one_request method() File "./HueEmulator3.py", line 1236, in do_GET self._set_end_headers(bytes(webformTradfri() + "
No lights where found", "utf8")) File "./HueEmulator3.py", line 1194, in _set_end_headers self.wfile.write(data) File "/usr/lib/python3.5/socket.py", line 594, in write return self._sock.send(b) BrokenPipeError: [Errno 32] Broken pipe

127.0.0.1 - - [17/Nov/2018 20:35:22] "GET /tradfri?ip=192.168.0.18&code=AX33pBP3PUZ3D3xh HTTP/1.1" 200 - v:1 t:CON c:POST i:b1d5 {} [ ] v:1 t:CON c:GET i:8f13 {} [ ] v:1 t:CON c:GET i:4547 {} [ ] v:1 t:CON c:GET i:8039 {} [ ] ERROR:root:light 1 is unreachable Traceback (most recent call last): File "./HueEmulator3.py", line 767, in syncWithLights light_data = json.loads(check_output("./coap-client-linux -m get -u \"" + bridge_config["lights_address"][light]["identity"] + "\" -k \"" + bridge_config["lights_address"][light]["preshared_key"] + "\" \"coaps://" + bridge_config["lights_address"][light]["ip"] + ":5684/15001/" + str(bridge_config["lights_address"][light]["device_id"]) +"\"", shell=True).decode('utf-8').rstrip('\n').split("\n")[-1]) File "/usr/lib/python3.5/json/init.py", line 319, in loads return _default_decoder.decode(s) File "/usr/lib/python3.5/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) 127.0.0.1 - - [17/Nov/2018 20:38:07] "GET /tradfri?ip=192.168.0.18&code=AX33pBP3PUZ3D3xh HTTP/1.1" 200 - v:1 t:CON c:POST i:ad85 {} [ ] v:1 t:CON c:GET i:6336 {} [ ]

Exception happened during processing of request from ('127.0.0.1', 60384) 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 410, in handle_one_request method() File "./HueEmulator3.py", line 1232, in do_GET registration = json.loads(check_output("./coap-client-linux -m post -u \"Client_identity\" -k \"" + get_parameters["code"][0] + "\" -e '{\"9090\":\"" + new_identity + "\"}' \"coaps://" + get_parameters["ip"][0] + ":5684/15011/9063\"", shell=True).decode('utf-8').rstrip('\n').split("\n")[-1]) File "/usr/lib/python3.5/json/init.py", line 319, in loads return _default_decoder.decode(s) File "/usr/lib/python3.5/json/decoder.py", line 339, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

``

camatthew commented 5 years ago

that fixed it however the lights only show in apps, not the dashboard

mariusmotea commented 5 years ago

Yes, there only the groups and the lights inside the groups are displayed.