2

Is there a possibility to connect my Philips Hue Bridge to a wifi network through my Raspberry Pi 3 B+ with Raspbian Stretch Lite?

Background

I live in an apartment compound with a separate wifi network provided to each tenant, there is no way to have our own wifi router. I do not have access to my landlord's router. Wifi: 192.168.1.0/24

What is Philips Hue and the Hue Bridge?

Philips Hue is a system for smart lights. The Hue Bridge is the device that controls all the lamps. Typically, you access the Hue Bridge from a smartphone app in order to turn on/off lights manually or set schedules. The Hue Bridge cannot connect to wifi directly, it only uses an ethernet port.

What I have tried so far

Approach 1

My first approach was to share my Raspberry's wifi to the ethernet device using the following approach: Sharing the Pi's WiFi connection through the Ethernet port The device connected via Ethernet then has internet, but is in a different subnet, so my phone could not find the Hue Bridge.

Approach 2

The second approach was to create a network bridge between eth0 and wlan0, but that also did not work for me. It seems that ethernet bridge to wireless is ok, but wireless bridge to ethernet is not. Raspberry PI 3 MODEL B - Wireless Bridge to ethernet

Approach 3

The hue bridge has a REST API on port 80. https://domoticproject.com/controlling-philips-hue-lights-with-raspberry-pi/

I used approach 1 so the Raspi creates a second subnet for the ethernet port and thus for the Hue bridge. I installed nginx reverse proxy on my raspi in order to forward the http requests to the hue bridge in my other subnet. The phone app can now find the bridge (by manually entering the raspi IP in the app). And I can also access kind of a start page of hue from my computer.

However the pairing process between the phone and the bridge requires me to press the button on the bridge for authorization. It seems the bridge needs to actively connect to the phone. This is where the nginx approach fails.

Does anyone have an idea of how to solve this?

kefa
  • 23
  • 4
  • I do not understand your problem. Do you have any link to a Philips Hue Bridge 2? What does it bridge? Two or more wired ethernet ports? Do you want to get internet access? Where is the internet router? What's the problem with your phone? Why does it need to find the Hue bridge? – Ingo Jun 23 '19 at 19:01
  • 1
    Thanks for asking. I have just updated my question, it should be clearer now. – kefa Jun 27 '19 at 13:47

1 Answers1

0

It is still a bit unclear what exactly the setup should be. First of all we have to accept that bridging a client connection (wlan0) is not possible due to a limitation of the on-board wifi device. For further information look at Raspberry Pi WiFi to Ethernet Bridge for a server.

If you want to use the local wifi network, then you have to "connect" the wired interface of the Hue Bridge to the wifi. This can be done with a RasPi as router using NAT (network address translation). For an example look at RasPi as Router, section Use routing.

You can also use proxy arp to make a pseudo bridge with the wifi client connection. Look at Workaround for a wifi bridge on a Raspberry Pi with proxy arp.

If you only need the web service on the Hue Bridge you can use port forwarding on the RasPi to the Hue Bridge. Look at Share Ethernet device on Wi-Fi, section Port forwarding.

You can spawn your own wifi network and bridge the access point with the wired connection to the Hue Bridge. This is possible. With routing to the existing local wifi network you get internet access. Look at Access point as WiFi router/repeater, optional with bridge, section Setup bridge.

If you run into trouble with the solution of your choice just ask in a comment.

Ingo
  • 40,606
  • 15
  • 76
  • 189
  • 1
    "Access point as WiFi router/repeater, optional with bridge" lets my phone communicate with the hue bridge. The devices connected to my raspi have no internet access, but that is fine for now. I will investigate this further. Proxy arp sounds super interesting, but I am not there yet. – kefa Jul 15 '19 at 15:37