diyhue / diyHue

Main diyHue software repo
https://diyhue.org/
Other
1.58k stars 280 forks source link

/hue/linkbutton page dosen't show #142

Closed hjortby closed 5 years ago

hjortby commented 5 years ago

I've just installed the DiyHue via the automatic install script curl -s https://raw.githubusercontent.com/diyhue/diyHue/master/BridgeEmulator/easy_install.sh | sudo bash /dev/stdin also tryed via docker image.

Each time I try to access the link device page i get this message in the browser "Page not working" [DiyHue IP] did't not return any respond

To Reproduce

  1. Go to 'DiyHue IP '
  2. Click on 'Link device'
  3. Logon with hue/hue
  4. Page not show'n

Logs

----------------------------------------
192.168.1.19 - - [09/Jul/2019 10:57:58] "GET /hue/linkbutton HTTP/1.1" 401 -
----------------------------------------
Exception happened during processing of request from ('192.168.1.19', 49509)
Traceback (most recent call last):
  File "/usr/lib/python3.7/socketserver.py", line 650, in process_request_thread self.finish_request(request, client_address)
  File "/usr/lib/python3.7/socketserver.py", line 360, in finish_request self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.7/socketserver.py", line 720, in __init__ self.handle()
  File "/usr/lib/python3.7/http/server.py", line 426, in handle self.handle_one_request()
  File "/usr/lib/python3.7/http/server.py", line 414, in handle_one_request method()
  File "HueEmulator3.py", line 1119, in do_GET   self._set_end_headers(bytes(self.headers.headers['Authorization'], "utf8"))
AttributeError: 'HTTPMessage' object has no attribute 'headers'

Additional context I'm running DiyHue on a raspberry 2

mariusmotea commented 5 years ago

Can you try from a different browser? This function was working fine so far and nobody touch it.

hjortby commented 5 years ago

hi Motea thanks for your quick reply. I've tried with chrome, edge and Firefox same result on all of them i login and then I get the exception that I added the my post.

Med venlig hilsen/best regards

Thomas Hjortby


Fra: Motea Marius notifications@github.com sendt: tirsdag den 9. juli 2019 13.42 til: diyhue/diyHue Cc: Thomas Hjortby; Author Emne: Re: [diyhue/diyHue] /hue/linkbutton page dosen't show (#142)

Can you try from a different browser? This function was working fine so far and nobody touch it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/diyhue/diyHue/issues/142?email_source=notifications&email_token=AAOMTBJF7KV2AGABBPD4SJTP6R2RRA5CNFSM4H7ECJG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZQACSY#issuecomment-509608267, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAOMTBP7NWL2RQW5W6RFV4TP6R2RRANCNFSM4H7ECJGQ.

mariusmotea commented 5 years ago

Is the Raspbian up to date on your Raspberry? Was previously used in another projects? I'm thinking that maybe it has some python library issues. One workaround to this issue is to navigate to /opt/hue-emulator/, stop hue-emulator service, edit in config.json file "config" => "linkbutton" from false to true. Start the service back and try to pair.

hjortby commented 5 years ago

thanks I will try

hjortby commented 5 years ago

hi, sorry but that didn't work

i'm not that into linux, how do I check if the distro is upto date, i did apt update and upgrade,

mariusmotea commented 5 years ago

i will give you the commands:

sudo systemctl stop hue-emulator will stop the service sudo nano /opt/hue-emulator/config.json will open the file in editor, find the key linkbutton and change it to true from false. Press CTRL + X to exit and Y to save it. sudo systemctl start hue-emulator will start back the service

S3B1MAX commented 5 years ago

Hi, i have the same problem. Since the last but one update i have the same issue. I've tried anything: reboot, reinstallation. Nothing helped.

Edit: I have also tried the thing with "linkbutton" in the config. This does not work either. Edit2: When i run hue-emulator in debug mode i see the following while searchig for a bridge: 192.168.2.137 - - [11/Jul/2019 19:27:56] "GET /api/nouser/config HTTP/1.1" 200 -

mariusmotea commented 5 years ago

@S3B1MAX you also have raspberrypi2? If you update why need to pair again the application? I update my raspberrypi3b and i don't have any issues. Can you execute following command and compare the versions?

pi@raspberrypi:~ $ sudo pip freeze
astral==1.6.1
chardet==2.3.0
colorzero==1.1
cryptography==1.7.1
dnspython==2.0.0
gpiozero==1.5.0
idna==2.2
ifaddr==0.1.6
pyasn1==0.1.9
pygobject==3.22.0
python-apt==1.1.0b5
python-nmap==0.6.1
pytz==2018.4
requests==2.12.4
RPi.GPIO==0.6.5
six==1.12.0
spidev==3.3
urllib3==1.19.1
ws4py==0.3.4
zeroconf==0.21.3
S3B1MAX commented 5 years ago

@mariusmotea I am using a raspberry pi 2 model b. I needed to pair again beacause i want to try a new app. The app needs a new pairing. I also tried to re-pair after reinstalling diyhue with the original hue app. Also not working.

pi@diyHueServer:~ $ sudo pip freeze
automationhat==0.1.0
beautifulsoup4==4.5.3
blinker==1.3
blinkt==0.1.2
buttonshim==0.0.2
Cap1xxx==0.1.3
chardet==2.3.0
click==6.6
colorama==0.3.7
cryptography==1.7.1
drumhat==0.1.0
enum34==1.1.6
envirophat==1.0.0
ExplorerHAT==0.4.2
Flask==0.12.1
fourletterphat==0.1.0
gpiozero==1.4.1
html5lib==0.999999999
idna==2.2
ipaddress==1.0.17
itsdangerous==0.24
Jinja2==2.8
keyring==10.1
keyrings.alt==1.3
lxml==3.7.1
MarkupSafe==0.23
mcpi==0.1.1
microdotphat==0.2.1
mote==0.0.4
motephat==0.0.2
numpy==1.12.1
oauthlib==2.0.1
pantilthat==0.0.7
phatbeat==0.1.1
pianohat==0.1.0
picamera==1.13
picraft==1.0
piglow==1.2.4
pigpio==1.38
Pillow==4.0.0
pyasn1==0.1.9
pycrypto==2.6.1
pygame==1.9.3
pygobject==3.22.0
pyinotify==0.9.6
PyJWT==1.4.2
pyOpenSSL==16.2.0
pyserial==3.2.1
pyxdg==0.25
rainbowhat==0.1.0
requests==2.12.4
requests-oauthlib==0.7.0
RPi.GPIO==0.6.5
RTIMULib==7.2.1
scrollphat==0.0.7
scrollphathd==1.2.1
SecretStorage==2.3.1
sense-emu==1.1
sense-hat==2.2.0
simplejson==3.10.0
six==1.10.0
skywriter==0.0.7
sn3218==1.2.7
spidev==3.3
touchphat==0.0.1
twython==3.4.0
unicornhathd==0.0.4
urllib3==1.19.1
webencodings==0.5
Werkzeug==0.11.15

As far as i see we use the same versions expect the following: Mine is missing the following: astral, colorzero, dnspython, ifaddr, python-nmap, pytz, ws4py, zeroconf

gpiozero and six is older on my raspberry pi.

S3B1MAX commented 5 years ago

Got the page working again. After a complete update an upgrade of the rpi.

But it still won't link with the app.

Edit: Reinstalling the app on my phone did the thing. Now everything is working.

hjortby commented 5 years ago

I still can't get it to work, i've reinstalled the rpi with this image "Raspbian Buster with desktop and recommended software", did a full update and upgrade, installed the hueEmulator again via auto-install

Exactly the same error

S3B1MAX: which distro do you use?

$ sudo pip freeze
arandr==0.1.9
asn1crypto==0.24.0
automationhat==0.1.0
blinker==1.4
blinkt==0.1.2
buttonshim==0.0.2
Cap1xxx==0.1.3
certifi==2018.8.24
chardet==3.0.4
Click==7.0
colorama==0.3.7
colorzero==1.1
configparser==3.5.0b2
cookies==2.2.1
cryptography==2.6.1
drumhat==0.1.0
entrypoints==0.3
enum34==1.1.6
envirophat==1.0.0
ExplorerHAT==0.4.2
Flask==1.0.2
fourletterphat==0.1.0
funcsigs==1.0.2
gpiozero==1.5.1
idna==2.6
ipaddress==1.0.17
itsdangerous==0.24
Jinja2==2.10
keyring==17.1.1
keyrings.alt==3.1.1
MarkupSafe==1.1.0
mcpi==0.1.1
microdotphat==0.2.1
mock==2.0.0
mote==0.0.4
motephat==0.0.2
numpy==1.16.2
oauthlib==2.1.0
olefile==0.46
pantilthat==0.0.7
pbr==4.2.0
phatbeat==0.1.1
pianohat==0.1.0
picamera==1.13
picraft==1.0
piglow==1.2.4
pigpio==1.42
Pillow==5.4.1
pycairo==1.16.2
pycrypto==2.6.1
pyflakes==2.0.0
pygame==1.9.4.post1
PyGObject==3.30.4
pyinotify==0.9.6
PyJWT==1.7.0
pyOpenSSL==19.0.0
pyserial==3.4
python-apt==1.8.4
python-nmap==0.6.1
pyxdg==0.25
rainbowhat==0.1.0
requests==2.21.0
requests-oauthlib==1.0.0
responses==0.9.0
RPi.GPIO==0.6.5
RTIMULib==7.2.1
scrollphat==0.0.7
scrollphathd==1.2.1
SecretStorage==2.3.1
sense-emu==1.1
sense-hat==2.2.0
simplejson==3.16.0
six==1.12.0
skywriter==0.0.7
sn3218==1.2.7
spidev==3.3
touchphat==0.0.1
twython==3.7.0
unicornhathd==0.0.4
urllib3==1.24.1
Werkzeug==0.14.1
S3B1MAX commented 5 years ago

@hjortby I use the following:

Operating System: Raspbian GNU/Linux 9 (stretch)
Kernel: Linux 4.14.79-v7+
hjortby commented 5 years ago

thanks S3B1MAX I'll will try with that one

mariusmotea commented 5 years ago

One important check i forget, what is the python3 version you use? You can check with following command that show also the version i use.

pi@raspberrypi:/opt/hue-emulator $ /usr/bin/python3
Python 3.5.3 (default, Sep 27 2018, 17:25:39)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
bairlin commented 5 years ago

Try to clear your cache of your browser and then use login data with a capital "H" for User/Password...

User: Hue Password: Hue

The problem is, you get no information or feedback if you have entered wrong credentials.

That way it works for me.... I hope it helps...

Best regards!

bairlin commented 5 years ago

But I have a problem that my Philips Hue App does not connect to the DIY Hue Bridge.... The App (iOS) finds the bridge. But after using the "Link Button" the App tells me that the bridge can´t be found and so there is no connection. This happens to me after the update of the iOS App to Version 3.24.0. I have deinstalled and reinstalled the App. But no luck, the bridge cannot be connected... I am not sure if there is a bug in the DIY Hue bridge. I also tried to update the bridge with the following command: curl -s https://raw.githubusercontent.com/diyhue/diyHue/master/BridgeEmulator/easy_install.sh | sudo bash /dev/stdin

It didn't´t help...

Any ideas? Bet regards!!

mariusmotea commented 5 years ago

@bairlin this is different issue, join Slack for live support.

bairlin commented 5 years ago

Right... sorry - other issue... ;-) I will turn back to that as soon as time permits. But just for me to know - I haven´t used Slack before... how to find the support then via Slack? Is that a discussion channel then? Sorry for my question... :-)

hjortby commented 5 years ago

@mariusmotea my python version are this Python 3.7.3 (default, Apr 3 2019, 05:39:12) [GCC 8.2.0] on linux Type "help", "copyright", "credits" or "license" for more information.

bairlin commented 5 years ago

@hjortby: Have you tried to use Hue/Hue??

Am 12.07.2019 um 16:45 schrieb hjortby notifications@github.com:

@mariusmotea my python version are this Python 3.7.3 (default, Apr 3 2019, 05:39:12) [GCC 8.2.0] on linux Type "help", "copyright", "credits" or "license" for more information.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

mariusmotea commented 5 years ago

So probably is not working with python 3.7. Now my raspberry py is updated and has version 3.5 so i believe we are using different mirrors.

Fisico commented 5 years ago

Try to clear your cache of your browser and then use login data with a capital "H" for User/Password...

User: Hue Password: Hue

The problem is, you get no information or feedback if you have entered wrong credentials.

That way it works for me.... I hope it helps...

Best regards!

Yea had the same problem,

Maybe there is a way to promt "invalid credentials" to the user.

hjortby commented 5 years ago

hi Guys I got it to work now, I installed a fresh version of Rasbian stretch did a update/upgrade and installed the HueEmulator again. and then it worked, Im not sure if its be cource I login with Hue/Hue instead of hue/hue or be course of the e Python version which now is 3.5.3

but thanks for all your help