sqmk / Phue

Philips Hue client for PHP
Other
203 stars 45 forks source link

Different subnet #135

Closed ava8c closed 6 years ago

ava8c commented 6 years ago

Hello, I have a problem. I run Phue library in a NAS that is located at 192.168.1.2 and my Hue Bridge is at 192.168.2.3. I can't create a new client with $client = new \Phue\Client("192.168.2.3", "***"); I get:

Fatal error: Uncaught Phue\Transport\Exception\ConnectionException: Connection failure in /volume1/web/Phue-master/library/Phue/Transport/Http.php:231 Stack trace: #0 /volume1/web/Phue-master/library/Phue/Transport/Http.php(153): Phue\Transport\Http->getJsonResponse('/api/4yQuoDa05B...', 'GET', NULL) #1 /volume1/web/Phue-master/library/Phue/Command/GetSensors.php(32): Phue\Transport\Http->sendRequest('/api/4yQuoDa05B...') #2 /volume1/web/Phue-master/library/Phue/Client.php(244): Phue\Command\GetSensors->send(Object(Phue\Client)) #3 /volume1/web/Phue-master/library/Phue/Client.php(181): Phue\Client->sendCommand(Object(Phue\Command\GetSensors)) #4 /volume1/web/Phue-master/examples/roomba-on-start.php(18): Phue\Client->getSensors() #5 {main} thrown in /volume1/web/Phue-master/library/Phue/Transport/Http.php on line 231

Port 80 is open both in router and modem.

NAS sees the bridge through the command "./bin/phue-bridge-finder"

Philips Hue Bridge Finder Checking meethue.com if the bridge has phoned home: Request succeeded Number of bridges found: 1 Bridge #1 ID: 001788fffe27c30d Internal IP Address: 192.168.2.3 MAC Address:

Could you help me, please?

sqmk commented 6 years ago

I can not assist you with your personal network or NAS settings. Even though your bridge is phoning home to meethue with that internal ip address doesn't guarantee you can connect to that address from another location on your network. You will have to play around with your network settings as well as your NAS to allow connections between the two devices.

Closing this asI don't believe this is an issue with the library itself.