Giter Site home page Giter Site logo

esp8266hueemulator's Introduction

ESP8266HueEmulator Build Status

This sketch emulates a Philips Hue bridge running on an ESP8266 using the Arduino IDE. Right now this is a proof-of-concept; contributions are highly welcome. Hue client apps can discover the emulated bridge and begin talking to it using the Hue protocol.

phihue_e27_starterset_430x300 jpg

Optionally, vou can use a strip of individually addressable WS2812b NeoPixels and attach it to GPIO2. The sketch talks to a strip of NeoPixels connected to GPIO2 (= pin D4 on the WEMOS D1 mini) of the ESP8266 with no additional circuitry. Right now the sketch uses the NeoPixels to tell that it is powered on, connected to the WLAN etc., and can switch on the first 3 NeoPixels using a Hue client (e.g., the iOS app).

To make this work, the sketch advertises its service with the so-called "Simple Service Discovery Protocol" (SSDP) that is also used as discovery protocol of Universal Plug and Play (UPnP). This sketch uses the ESP8266SSDP library from https://github.com/me-no-dev/Arduino

Please note that currently only the bare minimum to advertise the emulated Hue bridge is implemented, but it is enough so that the http://chromaforhue.com OS X app can discover and communicate with the emulated bridge.

Usage

  • I used Arduino-1.6.11.hourly201608161225.esp497d19d-x86_64.AppImage which conveniently comes with both the Arduino IDE and esp8266/Arduino ready-to-use; otherwise use a recent version of the Arduino IDE and esp8266/Arduino
  • In the Arduino IDE, Open the Library Manager and search for "NeoPixelBus by Makuna" and install
  • Download https://github.com/interactive-matter/aJson/archive/master.zip and install the library via the Arduino IDE
  • Important: Change #define PRINT_BUFFER_LEN 256 to #define PRINT_BUFFER_LEN 4096 in aJson/aJSON.h
  • Edit the sketch to contain your WLAN credentials
  • Load the sketch onto your ESP-01 or other ESP8266 device
  • Optionally connect the DATA line of your WS2812b NeoPixels to pin GPIO2 (you do not really need this in order to test communication between the sketch and Hue client apps)
  • Watch the output of the sketch in a serial console
  • Connect to the emulated bridge by using a Hue client app
  • Switch on one of the lights
  • Continue watching the output of the sketch in a serial console
  • Implement more of the protocol
  • Contribute pull requests ;-)

Compilation

Everything in one go:

mkdir -p $HOME/Arduino/libraries/
cd $HOME/Arduino/libraries/
git clone --branch 2.1.4 https://github.com/Makuna/NeoPixelBus.git
git clone https://github.com/interactive-matter/aJson.git
git clone https://github.com/PaulStoffregen/Time.git
git clone https://github.com/gmag11/NtpClient.git
sed -i -e 's|#define PRINT_BUFFER_LEN 256|#define PRINT_BUFFER_LEN 4096|g'  aJson/aJSON.h
cd -
git clone https://github.com/probonopd/ESP8266HueEmulator.git
sed -i -e 's|#include "/secrets.h"|//#include "/secrets.h"|g' ESP8266HueEmulator/ESP8266HueEmulator/ESP8266HueEmulator.ino
sed -i -e 's|//const char|const char|g' ESP8266HueEmulator/ESP8266HueEmulator/ESP8266HueEmulator.ino

Credits

  • Philips for providing open Hue APIs that are not restricted for use on Philips-branded hardware (as far as I can see by looking at their liberal Terms and Conditions of Use)
  • igrr for bringing the ESP8266 platform to the Arduino IDE
  • me-no-dev for porting the uSSDP library to the ESP8266 platform and helping me make this work
  • Makuna for the NeoPixelBus library supporting WS2812b NeoPixels on the ESP8266
  • interactive-matter for the aJson library

esp8266hueemulator's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp8266hueemulator's Issues

Need help with WS2812 5050 RGB 12-LED Ring

I have a WS2812 5050 RGB LED Ring with 12 leds. It is connected to pin D4 (GPIO2) on a WEMOS D1 Mini Pro that is configured as bridge. The HUE app on my iPad finds the HUE bridge emulator and reports 6 Hue Light Strips.

I am not sure how to modify the ESP8266HueEmulator.INO so that it works with this led ring. I have found the NUM_PIXELS_PER_LIGHT and PixelCount defines in the INO, but whatever I set it doesn't change anything on the led ring.

Any suggestions?

Cannot connect to bridge

Great idea and awesome project! I got this compiled and installed on a ESP-07 to try it out.

I used Chroma.app on my laptop, and it can discover the bridge, but cannot connect.

screen shot 2015-12-14 at 7 41 02 pm

screen shot 2015-12-14 at 7 41 14 pm

Here is the console output from the ESP chip:

===
980631
requestedUri: /api/api/config
980632
{"name":"hue emulator","swversion":"0.1","mac":"18:FE:34:FE:34:F3","dhcp":true,"ipaddress":"192.168.1.147","netmask":"255.255.255.0","gateway":"192.168.1.1","whitelist":{"api":{"name":"clientname#devicename"}},"swupdate":{"text":"","notify":false,"updatestate":0,"url":""}}
980643
===
980659
requestedUri: /api/e5qGUywTisnjL1XU
Running rgb2hsb
1.: H, S, B
2.: Convert to hue, sat, bri
Running rgb2hsb
1.: H, S, B
2.: Convert to hue, sat, bri
Running rgb2hsb
1.: H, S, B
2.: Convert to hue, sat, bri
Running rgb2hsb
1.: H, S, B
2.: Convert to hue, sat, bri
Running rgb2hsb
1.: H, S, B
2.: Convert to hue, sat, bri
Running rgb2hsb
1.: H, S, B
2.: Convert to hue, sat, bri
Running rgb2hsb
1.: H, S, B
2.: Convert to hue, sat, bri
Running rgb2hsb
1.: H, S, B
2.: Convert to hue, sat, bri
980682
{"groups":{},"scenes":{},"config":{"name":"hue emulator","swversion":"0.1","mac":"18:FE:34:FE:34:F3","dhcp":true,"ipaddress":"192.168.1.147","netmask":"255.255.255.0","gateway":"192.168.1.1","whitelist":{"api":{"name":"clientname#devicename"}},"swupdate":{"text":"","notify":false,"updatestate":0,"url":""}},"lights":{"1":{"type":"Extended color light","name":"Hue LightStrips 1","modelid":"LST001","state":{"on":false,"hue":0.00000,"bri":253.00000,"sat":0.00000,"xy":[0.00000,0.00000],"ct":500,"alert":"none","effect":"none","colormode":"hs","reachable":true}},"2":{"type":"Extended color light","name":"Hue LightStrips 2","modelid":"LST001","state":{"on":false,"hue":0.00000,"bri":253.00000,"sat":0.00000,"xy":[0.00000,0.00000],"ct":500,"alert":"none","effect":"none","colormode":"hs","reachable":true}},"3":{"type":"Extended color light","name":"Hue LightStrips 3","modelid":"LST001","state":{"on":false,"hue":0.00000,"bri":253.00000,"sat":0.00000,"xy":[0.00000,0.00000],"ct":500,"alert":"none","effect":"none","colormode":"hs","reachable":true}},"4":{"type":"Extended color light","name":"Hue LightStrips 4","modelid":"LST001","state":{"on":false,"hue":0.00000,"bri":253.00000,"sat":0.00000,"xy":[0.00000,0.00000],"ct":500,"alert":"none","effect":"none","colormode":"hs","reachable":true}},"5":{"type":"Extended color light","name":"Hue LightStrips 5","modelid":"LST001","state":{"on":false,"hue":0.00000,"bri":253.00000,"sat":0.00000,"xy":[0.00000,0.00000],"ct":500,"alert":"none","effect":"none","colormode":"hs","reachable":true}},"6":{"type":"Extended color light","name":"Hue LightStrips 6","modelid":"LST001","state":{"on":false,"hue":0.00000,"bri":253.00000,"sat":0.00000,"xy":[0.00000,0.00000],"ct":500,"alert":"none","effect":"none","colormode":"hs","reachable":true}},"7":{"type":"Extended color light","name":"Hue LightStrips 7","modelid":"LST001","state":{"on":false,"hue":0.00000,"bri":253.00000,"sat":0.00000,"xy":[0.00000,0.00000],"ct":500,"alert":"none","effect":"none","colormode":"hs","reachable":true}},"8":{"type":"Extend
980867
===
997892
requestedUri: /description.xml
<root><specVersion><major>1</major><minor>0</minor></specVersion><URLBase>http://192.168.1.147:80/</URLBase><device><deviceType>urn:schemas-upnp-org:device:Basic:1</deviceType><friendlyName>Philips hue (192.168.1.147)</friendlyName><manufacturer>Royal Philips Electronics</manufacturer><manufacturerURL>http://www.philips.com</manufacturerURL><modelDescription>Philips hue Personal Wireless Lighting</modelDescription><modelName>Philips hue bridge 2012</modelName><modelNumber>929000226503</modelNumber><modelURL>http://www.meethue.com</modelURL><serialNumber>00178817122c</serialNumber><UDN>uuid:2f402f80-da50-11e1-9b23-00178817122c</UDN><presentationURL>index.html</presentationURL><iconList><icon><mimetype>image/png</mimetype><height>48</height><width>48</width><depth>24</depth><url>hue_logo_0.png</url></icon><icon><mimetype>image/png</mimetype><height>120</height><width>120</width><depth>24</depth><url>hue_logo_3.png</url></icon></iconList></device></root>
I assume this is working since with this, Chroma for Hue finds a Bridge, so does the Hue iOS app. In constrast, without this they say no Bridge found.
997973
===
1003807
requestedUri: /api
CLIENT: 
api
[{"success":{"username": "api"}}]
1003814
===
1004821
requestedUri: /api/api/config
1004822
{"name":"hue emulator","swversion":"0.1","mac":"18:FE:34:FE:34:F3","dhcp":true,"ipaddress":"192.168.1.147","netmask":"255.255.255.0","gateway":"192.168.1.1","whitelist":{"api":{"name":"clientname#devicename"}},"swupdate":{"text":"","notify":false,"updatestate":0,"url":""}}
1004852
===
1004855
requestedUri: /api/api/config
1004856
{"name":"hue emulator","swversion":"0.1","mac":"18:FE:34:FE:34:F3","dhcp":true,"ipaddress":"192.168.1.147","netmask":"255.255.255.0","gateway":"192.168.1.1","whitelist":{"api":{"name":"clientname#devicename"}},"swupdate":{"text":"","notify":false,"updatestate":0,"url":""}}
1004875
===
1004882
requestedUri: /api/api/config
1004883
{"name":"hue emulator","swversion":"0.1","mac":"18:FE:34:FE:34:F3","dhcp":true,"ipaddress":"192.168.1.147","netmask":"255.255.255.0","gateway":"192.168.1.1","whitelist":{"api":{"name":"clientname#devicename"}},"swupdate":{"text":"","notify":false,"updatestate":0,"url":""}}
1004899
===
1004904
requestedUri: /api/api/config
1004905
{"name":"hue emulator","swversion":"0.1","mac":"18:FE:34:FE:34:F3","dhcp":true,"ipaddress":"192.168.1.147","netmask":"255.255.255.0","gateway":"192.168.1.1","whitelist":{"api":{"name":"clientname#devicename"}},"swupdate":{"text":"","notify":false,"updatestate":0,"url":""}}
1004926
===
1004930
requestedUri: /api/api/config
1004931
{"name":"hue emulator","swversion":"0.1","mac":"18:FE:34:FE:34:F3","dhcp":true,"ipaddress":"192.168.1.147","netmask":"255.255.255.0","gateway":"192.168.1.1","whitelist":{"api":{"name":"clientname#devicename"}},"swupdate":{"text":"","notify":false,"updatestate":0,"url":""}}
1004953
===
1004959
requestedUri: /api/api/config
1004960
{"name":"hue emulator","swversion":"0.1","mac":"18:FE:34:FE:34:F3","dhcp":true,"ipaddress":"192.168.1.147","netmask":"255.255.255.0","gateway":"192.168.1.1","whitelist":{"api":{"name":"clientname#devicename"}},"swupdate":{"text":"","notify":false,"updatestate":0,"url":""}}
1004985
===
1004989
requestedUri: /api/e5qGUywTisnjL1XU
Running rgb2hsb
1.: H, S, B
2.: Convert to hue, sat, bri
Running rgb2hsb
1.: H, S, B
2.: Convert to hue, sat, bri
Running rgb2hsb
1.: H, S, B
2.: Convert to hue, sat, bri
Running rgb2hsb
1.: H, S, B
2.: Convert to hue, sat, bri
Running rgb2hsb
1.: H, S, B
2.: Convert to hue, sat, bri
Running rgb2hsb
1.: H, S, B
2.: Convert to hue, sat, bri
Running rgb2hsb
1.: H, S, B
2.: Convert to hue, sat, bri
Running rgb2hsb
1.: H, S, B
2.: Convert to hue, sat, bri
1005023
{"groups":{},"scenes":{},"config":{"name":"hue emulator","swversion":"0.1","mac":"18:FE:34:FE:34:F3","dhcp":true,"ipaddress":"192.168.1.147","netmask":"255.255.255.0","gateway":"192.168.1.1","whitelist":{"api":{"name":"clientname#devicename"}},"swupdate":{"text":"","notify":false,"updatestate":0,"url":""}},"lights":{"1":{"type":"Extended color light","name":"Hue LightStrips 1","modelid":"LST001","state":{"on":false,"hue":0.00000,"bri":253.00000,"sat":0.00000,"xy":[0.00000,0.00000],"ct":500,"alert":"none","effect":"none","colormode":"hs","reachable":true}},"2":{"type":"Extended color light","name":"Hue LightStrips 2","modelid":"LST001","state":{"on":false,"hue":0.00000,"bri":253.00000,"sat":0.00000,"xy":[0.00000,0.00000],"ct":500,"alert":"none","effect":"none","colormode":"hs","reachable":true}},"3":{"type":"Extended color light","name":"Hue LightStrips 3","modelid":"LST001","state":{"on":false,"hue":0.00000,"bri":253.00000,"sat":0.00000,"xy":[0.00000,0.00000],"ct":500,"alert":"none","effect":"none","colormode":"hs","reachable":true}},"4":{"type":"Extended color light","name":"Hue LightStrips 4","modelid":"LST001","state":{"on":false,"hue":0.00000,"bri":253.00000,"sat":0.00000,"xy":[0.00000,0.00000],"ct":500,"alert":"none","effect":"none","colormode":"hs","reachable":true}},"5":{"type":"Extended color light","name":"Hue LightStrips 5","modelid":"LST001","state":{"on":false,"hue":0.00000,"bri":253.00000,"sat":0.00000,"xy":[0.00000,0.00000],"ct":500,"alert":"none","effect":"none","colormode":"hs","reachable":true}},"6":{"type":"Extended color light","name":"Hue LightStrips 6","modelid":"LST001","state":{"on":false,"hue":0.00000,"bri":253.00000,"sat":0.00000,"xy":[0.00000,0.00000],"ct":500,"alert":"none","effect":"none","colormode":"hs","reachable":true}},"7":{"type":"Extended color light","name":"Hue LightStrips 7","modelid":"LST001","state":{"on":false,"hue":0.00000,"bri":253.00000,"sat":0.00000,"xy":[0.00000,0.00000],"ct":500,"alert":"none","effect":"none","colormode":"hs","reachable":true}},"8":{"type":"Extend
1005210
===

Official Hue iOS app says connection to bridge lost

The official Hue iOS app starts connecting to the emulated bridge and begins communicating with it, then says that the connection to bridge is lost. I do not know why yet; probably some of the answer messages are not correct yet.

Please note that currently only the bare minimum to advertise the emulated Hue bridge is implemented, but it is enough so that the http://chromaforhue.com OS X app can discover and communicate with the emulated bridge.

Pull requests are highly welcome!

What Hardware is supported

Dear...
Great peace of work!!!!!!

My problem, what Hardware do i need.
Can i switch a regular white or rgb ledstrip to, when i am fine to now that this not the same color like HUE
There are more esp8266 version will this work on all?
And perhaps you have other idea's what i can buy in China...

Help Me pls

Arduino: 1.6.9 (Mac OS X), Board: "Generic ESP8266 Module, 80 MHz, 40MHz, DIO, 115200, 512K (64K SPIFFS), ck, Disabled, None"

/Users/Manuel/Downloads/ESP8266HueEmulator-master/ESP8266HueEmulator/ESP8266HueEmulator.ino: In function 'void loop()':
ESP8266HueEmulator:297: error: no matching function for call to 'NeoPixelAnimator::UpdateAnimations(int)'
if ( animator.IsAnimating() ) animator.UpdateAnimations(100);
^
/Users/Manuel/Downloads/ESP8266HueEmulator-master/ESP8266HueEmulator/ESP8266HueEmulator.ino:297:64: note: candidate is:
In file included from /Users/Manuel/Downloads/ESP8266HueEmulator-master/ESP8266HueEmulator/ESP8266HueEmulator.ino:18:0:
/Users/Manuel/Documents/Arduino/libraries/NeoPixelBus_by_Makuna/src/NeoPixelAnimator.h:110:10: note: void NeoPixelAnimator::UpdateAnimations()
void UpdateAnimations();
^
/Users/Manuel/Documents/Arduino/libraries/NeoPixelBus_by_Makuna/src/NeoPixelAnimator.h:110:10: note: candidate expects 0 arguments, 1 provided
exit status 1
no matching function for call to 'NeoPixelAnimator::UpdateAnimations(int)'

Can you Help me pls?

Room saving

I was testing the software using the original Philips Hue application. I am able to discover and control the light. However, after I make the first control, this is lost and the Android app force me to assign the light in a room.

I do that every time, but I think is making a save request to the ESP and this is just ignoring.

Do you have the same issue ?

Incorrect colors

I recently did a fresh installation of everything, I am emulating just one light with 24 pixels.

All seems to work fine except the colors. What could be causing this issue? Any way I can fix it?

I am using wifimanager library to connect to a wifi network at initialization.

1
2
3
4
5
6
7

New lights should extend an existing bridge

Most Hue apps only support one bridge per home, with the idea being that additional Hue lights simply extend a bridge.

Controlling two or more ESP8266 bridges is tedious and infeasible if one would like to add multiple lights throughout their home.

It would be optimal if additional wireless lights simply extended an existing bridge, so we could control all the lights in our home without having to change apps or delve into app settings.

Control of IR Bulbs?

Guys,
There are lot's of very cheap infrared controlled Bulbs out there. Any body like the idea of added IR support to this project? There would of course be some limitations as IR typically has specific codes for a reduced set of colours and there is always the sync issue when the same code is used for on and off. However, with a simple IR Transmitter (IR Transmitter LED, a resister and maybe a transistor) we could have limited control over IR bulbs aswell...

Andy.

can't compile the code

Hi,

I have arduino 1.6.5 (OSX) and esp8266 lib v2.1.0

while compiling I get this errors:

ESP8266HueEmulator:37: error: invalid use of template-name 'NeoPixelBus' without an argument list
ESP8266HueEmulator:38: error: 'NeoPixelAnimator' does not name a type
ESP8266HueEmulator.ino: In function 'void handleAllOthers()':
ESP8266HueEmulator:174: error: 'strip' was not declared in this scope
ESP8266HueEmulator:177: error: 'AnimUpdateCallback' was not declared in this scope
ESP8266HueEmulator:177: error: expected ';' before 'animUpdate'
ESP8266HueEmulator:184: error: 'animator' was not declared in this scope
ESP8266HueEmulator:184: error: 'animUpdate' was not declared in this scope
ESP8266HueEmulator:188: error: 'AnimUpdateCallback' was not declared in this scope
ESP8266HueEmulator:188: error: expected ';' before 'animUpdate'
ESP8266HueEmulator:195: error: 'animator' was not declared in this scope
ESP8266HueEmulator:195: error: 'animUpdate' was not declared in this scope
ESP8266HueEmulator.ino: In function 'void setup()':
ESP8266HueEmulator:228: error: 'strip' was not declared in this scope
ESP8266HueEmulator.ino: In function 'void loop()':
ESP8266HueEmulator:297: error: 'animator' was not declared in this scope
ESP8266HueEmulator:298: error: 'strip' was not declared in this scope
ESP8266HueEmulator.ino: In function 'void infoLight(RgbColor)':
ESP8266HueEmulator:309: error: 'strip' was not declared in this scope
ESP8266HueEmulator.ino: In function 'void addLightJson(aJsonObject*, int)':
ESP8266HueEmulator:403: error: 'strip' was not declared in this scope
invalid use of template-name 'NeoPixelBus' without an argument list

what do I wrong?

Wrong color conversion?

Hi. I'm just playing around with this emulator. So far everything seems to work fine.
However, when using the Hue App, it seems that the colors are somehow "messed up".
It is hardly impossible to set a desired color using the Hue App.
As far as I can tell, the problem is in the getXYtoRGB function. From my understanding this function should translate the XY values to rgb values in the range of 0.0 to 1.0. - which then, multiplied with the saturation, give rgb values in the range of 0-255. However, the calculation give values outside of this range.

As example: Trying to set dark red: Hue App sends for xy 0.690456 / 0.295907, which is close to a absolute red. Doing the math I'm getting as r=1.6559, g=0.5179 and b=0.2311 ... which end's up in these RBG values red=166, green=132 and blue=59 ... all at all not even a red, but more of a "white with a touch of red". It is no surprise, cause the calculated values are > 255: red = $01A6, green=$0084, blue=$003A - but when converted to uint8_t, only the lower 8 bits are used ...

I double checked with various other pages, but the math is always (more or less) the same ...
What am I missing here?

Any support for HUE sensors using API ?

I have a temp. humid sensor attached to the arduino.
It would be cool to see the readouts using HUE.

Example call:

all : /api//sensors
or one specific : /api//sensors/

JSON =>

{
"5":{
"state":{
"temperature":1796,
"lastupdated":"2016-10-15T12:10:46"
},
"config":{
"on":true,
"battery":100,
"reachable":true,
"alert":"none",
"ledindication":false,
"usertest":false,
"pending":[

     ]
  },
  "name":"Hue temperature sensor 1",
  "type":"ZLLTemperature",
  "modelid":"SML001",
  "manufacturername":"Philips",
  "swversion":"6.1.0.18912",
  "uniqueid":"##:##:##:##:##:##:##:##-##-####"

},
"6":{
"state":{
"presence":false,
"lastupdated":"2016-10-15T12:05:35"
},
"config":{
"on":true,
"battery":100,
"reachable":true,
"alert":"none",
"ledindication":false,
"usertest":false,
"sensitivity":2,
"sensitivitymax":2,
"pending":[

     ]
  },
  "name":"Landing MS",
  "type":"ZLLPresence",
  "modelid":"SML001",
  "manufacturername":"Philips",
  "swversion":"6.1.0.18912",
  "uniqueid":"##:##:##:##:##:##:##:##-##-####"

},
"7":{
"state":{
"lightlevel":15351,
"dark":false,
"daylight":true,
"lastupdated":"2016-10-15T12:15:09"
},
"config":{
"on":true,
"battery":100,
"reachable":true,
"alert":"none",
"tholddark":2054,
"tholdoffset":7000,
"ledindication":false,
"usertest":false,
"pending":[

     ]
  },
  "name":"Hue ambient light sensor 1",
  "type":"ZLLLightLevel",
  "modelid":"SML001",
  "manufacturername":"Philips",
  "swversion":"6.1.0.18912",
  "uniqueid":"##:##:##:##:##:##:##:##-##-####"

},
"8":{
"state":{
"status":0,
"lastupdated":"2016-10-15T12:05:35"
},
"config":{
"on":true,
"reachable":true
},
"name":"MotionSensor 6.Companion",
"type":"CLIPGenericStatus",
"modelid":"PHA_STATE",
"manufacturername":"Philips",
"swversion":"1.0",
"uniqueid":"MotionSensor 6.Companion",
"recycle":true
}
}

Is support for this planned ?

regards
gibman

Do not hardcode client identification string

In the sketch you will find something like String client = "e7x4kuCaC8h885jo";. This needs to be changed by you to the client string that the client app actually sends. This is a quick and dirty hack, the sketch should parse this out of what is being sent by the app instead.

'hsb' was not declared in this scope

when I try to compile the sketch I get the following error:
ESP8266HueEmulator:550: error: 'hsb' was not declared in this scope
'HsbColor' does not name a type

I`m on Arduino 1.6.4 and I use the arduino-esp version on july 23th

iOS Hue app causes reboot

Seems to cause reboots consistently, whenever the brightness is altered.

Looking at the serial output, it seems to receive requests constantly when the brightness slider is moved, until it hits the "You need to use a newer version of the ESP826" line and then it reboots.

It works fine for the chroma app on the mac?

Any ideas?

Can't turn the lights on

Hi!
I cannot make this work. I have a esp8266 (data pin: D4) connected to ws2812b lightstrip with 32 leds.
I could connect to it thought the phone app but cannot turn the lights on.
The only instruction I didn't do is this because I didn't find this one: Replace avm/pgmspace.h with pgmspace.h
what I set up:
wifi creditials,
#define NUM_PIXELS_PER_LIGHT 32
#define pixelCount 32
#define pixelPin D4
set #define PRINT_BUFFER_LEN 4096 in aJSON.h
and this one shows as many device in the app as I write into it:
#define MAX_LIGHT_HANDLERS 2
What have I missed?

Switch to async libraries

In order to improve reliability, we might switch to

#include <ESPAsyncTCP.h>
#include <ESPAsyncWebServer.h>
#include <AsyncJson.h>

Pull requests for an async branch welcome.

Ajson

Can I ask why you switched from arduinojson to ajson?

I'm looking at integrating this project now so trying to get to grips with it.

Looking at the json string I thing you limit of 8 lights is to do with you json print buffer size. I can do 10 actually. But it breaks once my strong goes over 4096 chars.

The original hue strip light I think can only be one colour at a time. Just looking at their promo video. So one solution would be to set how many hue lights u want to a max of 8, then dividing the strip up by that number?

I'm going to try and use spiffs to store the led state so that u can name the lights, add groups etc.

Consider state for creating JSON

For creating the JSON, we should take the state of the lights into consideration.

For example, as per the Hue API, brightness 0 is not the same as off. However, physically in an RGB strip, the two are the same. The sketch should maintain the state whether a light is off or brightness 0, because otherwise the client app will do strange things (e.g., set the brightness slider to 0 whenever the light is switched off).

Pull requests welcome.

Colors are wrong

Hue clients send color information not as RGB (which would be the easiest) but, as one of multiple options, as hue, sat, briwith hue (expressed in ~deg*182.04), bri between 0-254 (0 is not off!), and sat between 0-254. Conversions are required to drive NeoPixels which only understand RGB. Currently these conversions are not correct.

Need to use HSB. Makuna has started to implement HSBColor object already.
Looking forward to using it.

Hue Bridge Not Recognized with version 4.5.6

I have a iLive Platinum Alexa device, that says it supports Home Automation (but I'm beginning to doubt that).

Here is my trace:

2017-09-19 12:41:14,899 [main] INFO com.bwssystems.HABridge.upnp.UpnpListener - Traceupnp: sendUpnpNotify notifyTemplate is <<<NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.0.68:8080/description.xml
SERVER: Linux/3.14.0 UPnP/1.0 IpBridge/1.19.0
NTS: ssdp:alive
hue-bridgeid: B827EBFFFE7B2EF9
NT: uuid:2f402f80-da50-11e1-9b23-b827eb7b2ef9
USN: uuid:2f402f80-da50-11e1-9b23-b827eb7b2ef9

Here is the output of a upnp discovery app in Linux:
USN: uuid:2f402f80-da50-11e1-9b23-b827eb7b2ef9::upnp:rootdevice
Location: http://192.168.0.68:8080/description.xml
resource available
USN: uuid:2f402f80-da50-11e1-9b23-b827eb7b2ef9
Location: http://192.168.0.68:8080/description.xml
resource available

Here is the description.xml
10http://192.168.0.68:8080/urn:schemas-upnp-org:device:Basic:1Philips hue (192.168.0.68)Royal Philips Electronicshttp://www.philips.comPhilips hue Personal Wireless LightingPhilips hue bridge 2015BSB002http://www.meethue.comb827eb7b2ef9uuid:2f402f80-da50-11e1-9b23-b827eb7b2ef9(null)(null)(null)(null)(null)index.htmlimage/png484824hue_logo_0.pngimage/png12012024hue_logo_3.png

ESP8266 using Sleep as Android

Hello there,
I'm trying to know if there is a way the app Sleep as Android could recognize the hub created with the ESP8266 as an actual Philips Hue Hub, since there's a functionality to use philips smartbulbs in this app. This way, I could plug a ws2812b led strip on this "false" hub and then make it recognize on this app, and wakeup with controlled ambient lightning with it...
Do you know if this could work ?

Thanks for any answers or advices !
(Sorry for my English !)

"New" iOS app crashes when searching bridge

Using Philips Hue iOS app version 2.3.0 of 08.08.2016.

On the ESP serial console I see

Starting SSDP...
SSDP Started
===
23765
requestedUri: /api/nouser/config
23766
{"name":"hue emulator","swversion":"001","portalservices":false,"linkbutton":false,"mac":"18:FE:34:D1:76:58","dhcp":true,"ipaddress":"192.168.0.17","netmask":"255.255.255.0","gateway":"192.168.0.1","whitelist":{"":{"name":"clientname#devicename"}},"swupdate":{"text":"","notify":false,"updatestate":0,"url":""}}
23787
===

The iOS app says "found new bridge" for about a second and then crashes.

With the same sketch running, I can find the bridge using the "old" Philips Hue gen 1 iOS app just fine:

===
267337
requestedUri: /api/e7x4kuCaC8h885jo/config
267337
{"name":"hue emulator","swversion":"001","portalservices":false,"linkbutton":false,"mac":"18:FE:34:D1:76:58","dhcp":true,"ipaddress":"192.168.0.17","netmask":"255.255.255.0","gateway":"192.168.0.1","whitelist":{"":{"name":"clientname#devicename"}},"swupdate":{"text":"","notify":false,"updatestate":0,"url":""}}
267359
===

More than one NeoPixel per emulated bulb/LightStip

Let's say I have a 30-LED NeoPixel strip but the sketch can only emulate 6 Hue LightStrips. There should be a constant that can be set to have more than one consecutive NeoPixels treated as one emulated LightStrip. In this example, I would like to set const ledsPerBulb = 5; // treat 5 physical LEDs as one emulated bulb.

Pull requests welcome!

xy to RGB

I've just spent several hours on this particular problem and have not solved it, its a bit out of my area.
For the iOS Hue app to work, I require xy colour space numbers.

your equation for rgb to xy works.

I cannot derive one that converts RGB back to xy!

can you help?

Speed it up

Currently there is a high latency (around 2-3 seconds) for processing a request. Why is this?

Pull requests appreciated.

Using RGB power strip

I've a RGB LED strip with 60 leds. However it is not neopixel compatible. Rather, it has 4 wires, white-positive, Red, Green and blue for negative of those three colours respectively. I've managed to get colour of my choice using esp8266 creating a webserver. This is done by using 3 n-MOSFETS connected to Red, green and blue wires and to ground. Their gate is driven by 3 GPIO pins of the esp8266 using pulse width modulation technique as there is no true analog output from esp8266

But due to lack of knowledge of internet protocols, ssdp and all that, i am unable to follow the example code you gave for lighting the neopixel. To get colour of my choice i only need red, green and blue
intensity levels separately as integer values from 0-255.

If i am correct, there is a virtual function in your library for that *lighthandler, but i am unable to get red, green and blue levels there...any help is greatly appreciated.

If i am successful, i will put these strips at strategic locations to get lighting effect according to time of day, music being played and what not. The reason i am trying for hue protocol is that there are so many apps already there to achieve these goals, i only have to make my led strip appear like a hue light bulb. I suppose, that will not be very difficult courtesy to your library as neopixel example you gave achieves this.

Another advantage of using philips hue protocol is that it can be directly connected to the cloud and using services like ifttt.com (please see: https://ifttt.com/hue for examples, if interested) i can very easily achieve something like the following (just a few examples, but very useful at least for me):

fading alarm--light should gradually increase intensity 6.00am-8.00am in morning much like the real thing.
alert lights -- if someone is outside my room, the PIR sensor gives a signal and the light should automatically turn somewhat more reddish in colour and increase intensity.
fitness tracker alert -- if i do not run according to my goal, the light should turn somewhat more yellowish
sleep assistant -- light shold gradually fade according to time and turn orangish in evening time.
example like point 3 which depend on different services can be achieved due to support of 3rd party...

New Apps require Push-Link-Button

New Apps, like the 2. gen Android App find the bridge,
but won't get past waiting for the user to press the Push-Link-Button on the Bridge.

Same happens for the Luminance Hue App for Linux(relies on phue Phyton library),
which throws an exception at the Push-Link screen:
http.client.RemoteDisconnected: Remote end closed connection without response

fatal error: TimeLib.h: No such file or directory

I just downloaded the latest version and I I am seeing this error when I verify it:

`D:\Development\ESP8266 Arduino\Sketches\ESP8266HueEmulator-master\ESP8266HueEmulator\ESP8266HueEmulator.ino:10:21: fatal error: TimeLib.h: No such file or directory

#include <TimeLib.h>

                 ^

compilation terminated.

exit status 1
Error compiling for board WeMos D1 R2 & mini.`

How can I solve this?

HueEmulator not picked up by Quby (Toon eneco dutch) mabey others ?

it dosnt pickup the emulator the problem is the broadcast is not like a real hue this is a sample of how it should be

These are broadcasts, groups of 6 (3 doubles of different UPnP devices), with an interval of approx. 1 minute:

NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.102:80/description.xml
SERVER: FreeRTOS/6.0.5, UPnP/1.0, IpBridge/0.1
NTS: ssdp:alive
NT: upnp:rootdevice
USN: uuid:2f402f80-da50-11e1-9b23-00178818572b::upnp:rootdevice

NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.102:80/description.xml
SERVER: FreeRTOS/6.0.5, UPnP/1.0, IpBridge/0.1
NTS: ssdp:alive
NT: upnp:rootdevice
USN: uuid:2f402f80-da50-11e1-9b23-00178818572b::upnp:rootdevice

NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.102:80/description.xml
SERVER: FreeRTOS/6.0.5, UPnP/1.0, IpBridge/0.1
NTS: ssdp:alive
NT: uuid:2f402f80-da50-11e1-9b23-00178818572b
USN: uuid:2f402f80-da50-11e1-9b23-00178818572b

NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.102:80/description.xml
SERVER: FreeRTOS/6.0.5, UPnP/1.0, IpBridge/0.1
NTS: ssdp:alive
NT: uuid:2f402f80-da50-11e1-9b23-00178818572b
USN: uuid:2f402f80-da50-11e1-9b23-00178818572b

NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.102:80/description.xml
SERVER: FreeRTOS/6.0.5, UPnP/1.0, IpBridge/0.1
NTS: ssdp:alive
NT: urn:schemas-upnp-org:device:basic:1
USN: uuid:2f402f80-da50-11e1-9b23-00178818572b

NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.102:80/description.xml
SERVER: FreeRTOS/6.0.5, UPnP/1.0, IpBridge/0.1
NTS: ssdp:alive
NT: urn:schemas-upnp-org:device:basic:1
USN: uuid:2f402f80-da50-11e1-9b23-00178818572b

some more details
https://raw.githubusercontent.com/ewjmulder/program-your-home/master/eneco-toon/IDEAS.txt

mzanetti/shine does not find emulated bridge

The Qt-based Linux Hue client mzanetti/shine (the only Hue client for Linux I could find) does not find the emulated bridge:

void HueBridgeConnection::onNoBridgesFound() No hue bridges found!

This is the code from discovery.cpp for discovering bridges:

void Discovery::findBridges()
{
    m_timeout->stop();
    m_reportedBridges.clear();

    QString b("M-SEARCH * HTTP/1.1\r\n"
              "HOST: 239.255.255.250:1900\r\n"
              "MAN: \"ssdp:discover\"\r\n"
              "MX: %1\r\n"
              "ST: libhue:idl\r\n");
    b.arg(DISCOVERY_TIMEOUT);

//    qDebug() << "writing datagram" << b;
    m_timeout->start(DISCOVERY_TIMEOUT * 1000);
    if (writeDatagram(b.toUtf8(), QHostAddress("239.255.255.250"), 1900) < 0) {
        emit error();
    }
}

ESP Client

Is there a possibility to use an esp as a client?

Using sk6812 RGBW Strip

The sk6812 is a digital light strip which works similar to the ws2812, but is also available with additional white leds. Adafruit also sells them as Neopixels RGBW.
I guess this is a better choice, as I want to use this project for my main room light.

As Philips also sells the Hue Light Strip Plus with separated white now,
I wonder if it will be easy to modify this code to act as the light strip plus.

Process the Input that is send to the emulator (and send them to Yeelight)

Not really an issue but a question/idea
Is there already any implementation to actually process the hue commands that the emulator recieves?

For example, I am interested in the Xiaomi Yeelight Wifi Bulbs,
and would like to use the esp8266 to send commands to it.

This would make a really cheap Hue alternative, that doesn't lack the features of the real thing.

Yeelight Developer Docs: http://www.yeelight.com/download/Yeelight_Inter-Operation_Spec.pdf

Getting Exception (28) and Exception (3) on boot

Hello, I'm getting the following errors over Serial after flashing.
I'm using a WEMOS D1 mini with the 1.6.8 IDE and latest ESP8266 core (2.3.0). I edited #define PRINT_BUFFER_LEN 4096 as described.

Starting HTTP at 10.47.173.139:80
Starting SSDP...
SSDP Started

Exception (28):
epc1=0x4000bf80 epc2=0x00000000 epc3=0x00000000 excvaddr=0x0000076c depc=0x00000000

ctx: sys 
sp: 3ffff5a0 end: 3fffffb0 offset: 01a0

>>>stack>>>
3ffff740:  ffffffff 00000000 0000000a 3fffd848  
3ffff750:  4022785a 00030ca8 00002f0a 40233da0  
3ffff760:  0000003c 0000076c 00000000 3ffff7a0  
3ffff770:  3ffff7b0 4010762c 3ffefef0 3fff3fc4  
3ffff780:  3fff22cc 3ffec80a 3ffff860 3fff22ff  
3ffff790:  3ffff7b0 3ffff7a0 0000000c 3fff22d0  
3ffff7a0:  3fff3f84 3fff442c 3fff442c 000004b0  
3ffff7b0:  3fff252c 00000050 00000000 3fff22d0  
3ffff7c0:  3fff3f84 3fff442c 3fff442c 40202f76  
3ffff7d0:  3ffefef0 3fff0135 3fff01f5 3ffe8b8c  
3ffff7e0:  3ffeff55 3ffeff30 0000076c 3fff4494  
3ffff7f0:  7f5e0001 0000faff 3ffefecc 4020f016  
3ffff800:  3fff01f5 3ffeff30 3ffeff55 8bad2f0a  
3ffff810:  00000050 3ffefef0 01ad2f0a 3fff442c  
3ffff820:  00000000 00000080 3ffefecc 40206388  
3ffff830:  3fff0135 3fff01f5 3ffeff30 3ffeff55  
3ffff840:  8bad2f0a 00000050 3ffefef0 3fff22d0  
3ffff850:  3fff3f84 3fff442c 3fff442c 40233dd4  
3ffff860:  50545448 312e312f 30303220 0d4b4f20  
3ffff870:  5458450a 430a0d3a 45484341 4e4f432d  
3ffff880:  4c4f5254 616d203a 67612d78 32313d65  
3ffff890:  0a0d3030 41434f4c 4e4f4954 7468203a  
3ffff8a0:  2f3a7074 3730312f 35383633 2e343038  
3ffff8b0:  312e3038 36333730 31303637 30312e36  
3ffff8c0:  37363337 37393536 3730313a 36373633  
3ffff8d0:  2f393837 37313030 46463838 34314546  
3ffff8e0:  32394632 45530a0d 52455652 7241203a  
3ffff8f0:  6e697564 2e312f6f 50552030 312f504e  
3ffff900:  7520312e 3a706e70 746f6f72 69766564  
3ffff910:  332f6563 33323338 2d363336 38353534  
3ffff920:  6464342d 31392d61 632d3838 65306164  
3ffff930:  39656336 0d383964 6575680a 6972622d  
3ffff940:  69656764 74203a64 69766564 0a0d6563  
3ffff950:  3a4e5355 69757520 38333a64 36333233  
3ffff960:  342d3633 2d383535 61646434 3831392d  
3ffff970:  64632d38 36653061 64396563 0a0d3839  
3ffff980:  ff000a0d 00000000 3ffea731 00000008  
3ffff990:  36633664 3f393832 3fff2384 00000000  
3ffff9a0:  3ffee99c 00000000 4010214f 3fff2384  
3ffff9b0:  00000000 00000000 00000020 40102006  
3ffff9c0:  3ffea5e0 402134bf 3fff2384 3fff21b4  
3ffff9d0:  00000000 4021bbf4 3ffee99c 00000005  
3ffff9e0:  3fffd848 40002364 00000001 00000000  
3ffff9f0:  40002be8 00000078 00000000 00000010  
3ffffa00:  40001f46 3ffee9c8 3fff1f0c 00000004  
3ffffa10:  36323839 00643663 3ffef168 3fff03fc  
3ffffa20:  00000010 3fff0260 00000000 4010053d  
3ffffa30:  00000010 3fff02d8 00000000 3fff03fc  
3ffffa40:  00000010 3ffefe84 00000000 4010053d  
3ffffa50:  00000000 3ffffab0 3ffffac0 3ffea25a  
3ffffa60:  401075d4 3ffea37c 60000600 3ffef7b8  
3ffffa70:  3ffeeb1c 00000007 00000008 00000001  
3ffffa80:  00000000 09826c6d 00000000 3ffffa17  
3ffffa90:  00000008 0000001e 3ffefdb4 401004d8  
3ffffaa0:  3ffffac0 3ffffab0 00000004 4020ec24  
3ffffab0:  3ffe8ae0 09826c6d 3fff2848 3fff25f0  
3ffffac0:  4000b570 00000000 00000001 4020ed21  
3ffffad0:  00000000 00000000 00000000 00000000  
3ffffae0:  00000000 00000000 00000000 00000000  
3ffffaf0:  00000000 00000000 00000000 00000000  
3ffffb00:  00000000 00000000 00000000 00000000  
3ffffb10:  7e6052bc 8accca88 864bbd05 54e527c1  
3ffffb20:  b67c6715 bd12fa53 0fd15519 61b01f20  
3ffffb30:  bc9cb9e5 6432908e 0582159b f7fa07aa  
3ffffb40:  4000b570 00000008 00000038 3ffffc20  
3ffffb50:  00000000 00000000 00000000 00000000  
3ffffb60:  00000000 00000000 00000000 00000000  
3ffffb70:  00000000 00000000 00000000 00000000  
3ffffb80:  00000000 00000000 00000000 00000000  
3ffffb90:  c569a7aa 442a2f4b c6786b8d dd1c2ccd  
3ffffba0:  0f714763 e1d5dfd2 e44e072d f36572a0  
3ffffbb0:  10f18fb8 acdf9bcf a9c1d104 88d74471  
3ffffbc0:  4000b5f9 00000008 00000038 3ffffca0  
3ffffbd0:  00000008 3ffffca0 dd167d81 5cbfce80  
3ffffbe0:  97ed0d24 4bf68432 5333ece4 71a967f2  
3ffffbf0:  7e1a8d46 b19f6f7d 2a0fb844 163170ef  
3ffffc00:  52d46872 32a56e1f 9ead6315 76c6f3f5  
3ffffc10:  113d33a6 45872244 80336e19 ea1d2965  
3ffffc20:  d498e3c9 d71c7fe5 5fb431d0 bd98296e  
3ffffc30:  62b79d24 cc89f83f c46f3406 d8956fcb  
3ffffc40:  be5ecdd6 f9a6288f b9cc3c84 6271291e  
3ffffc50:  4000b62e 45d0be19 8a3a8a76 2490a100  
3ffffc60:  3ffee760 40101b9a 00000001 00000000  
3ffffc70:  00000000 40101967 00000000 3ffee730  
3ffffc80:  00000001 00000000 00000002 40102006  
3ffffc90:  401052c8 3ffedeb8 3ffee730 463a3975  
3ffffca0:  00000005 00000000 00000020 40102006  
3ffffcb0:  3ffea5e5 401052e3 3ffee048 00000000  
3ffffcc0:  40102d19 3ffee048 00000000 00000000  
3ffffcd0:  00007fff 00520f1d 3ffeea5c 40102ea8  
3ffffce0:  3ffeae90 00000000 00000000 00000008  
3ffffcf0:  00000000 00520f1d 401032e6 00000100  
3ffffd00:  7fffffff 3ffeae90 3ffeae90 00000001  
3ffffd10:  00000001 00007fff 3fffc200 00000022  
3ffffd20:  3ffffd30 00520f1d 00000000 4000050c  
3ffffd30:  3fffc278 40103080 3fffc200 00000022  
3ffffd40:  3ffeae9c 3ffee99c 3ffeb54e 3ffeb56a  
3ffffd50:  4020668c 00000030 00000010 ffffffff  
3ffffd60:  402066d2 00000000 402066fe 3ffe97c8  
3ffffd70:  3ffffe8e 00ff0000 0000000a 00000000  
3ffffd80:  0000002a 00000003 3ffffff8 3ffefecc  
3ffffd90:  00000002 0000003f 00000003 00000030  
3ffffda0:  4021417a 3ffedd50 3fff1f0c 3ffedd50  
3ffffdb0:  00000002 00000000 4021401b 00000001  
3ffffdc0:  ffffffff 00000000 3ffea731 00000008  
3ffffdd0:  3fff03fc 00000434 00000434 4010020c  
3ffffde0:  00000000 3ffea2e8 00000001 4010068c  
3ffffdf0:  40227ff9 00000000 3ffee99c 40107530  
3ffffe00:  4022fea6 3fff1f0c 3ffeb56a 4022febd  
3ffffe10:  3fff3fc4 faffffef 8bad2f0a 00000016  
3ffffe20:  00000000 00000022 3ffef190 00000003  
3ffffe30:  00000026 3fff3fc4 3fff3f44 3ffec80a  
3ffffe40:  3fff22cc 3fff3fc4 3ffefecc 40206898  
3ffffe50:  4e2d3130 3735534c 31303065 37346330  
3ffffe60:  34383866 65626431 63326331 36653131  
3ffffe70:  36376532 70003165 67726f2d 69766564  
3ffffe80:  654d6563 52616964 65646e65 00726572  
3ffffe90:  00000000 00000002 3ffeff55 00000031  
3ffffea0:  0000000a 00197bb8 4021ead3 3ffec80a  
3ffffeb0:  3fff22cc 3fff3fc4 3fff3f44 4020f077  
3ffffec0:  00000000 00000000 00000001 40206198  
3ffffed0:  3fff22cc 3fff3fc4 3fff3f84 402323e4  
3ffffee0:  0000076c 00000000 3ffec7f6 3fff1e18  
3ffffef0:  000000e0 3ffea2e8 00000001 40107520  
3fffff00:  40220000 00000000 3ffeb5cf 3fff1e10  
3fffff10:  3ffec7f6 3fff1e18 3fff3fc4 40233b20  
3fffff20:  00000002 3fff22cc 3fff22cc 3ffef190  
3fffff30:  00000000 3fff3fdc 0000001c 3fff22cc  
3fffff40:  3ffec7e8 00000000 3fff3fc4 40232f29  
3fffff50:  19ad2f0a 00000001 4010522e 3ffee7a8  
3fffff60:  3ffedd78 40101bd5 00000000 00000005  
3fffff70:  00000002 40101967 00000002 00000000  
3fffff80:  401019a2 00000002 3fffdab0 3fff235c  
3fffff90:  3fffdc80 00000000 3fff3fc4 402279bf  
3fffffa0:  40000f49 3fffdab0 3fffdab0 40000f49  
<<<stack<<<

 ets Jan  8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v3fff1b50
~ld
çStarting HTTP at 10.47.173.139:80
Starting SSDP...
SSDP Started

Exception (3):
epc1=0x4000bf64 epc2=0x00000000 epc3=0x00000000 excvaddr=0x40232e7d depc=0x00000000

ctx: sys 
sp: 3ffff5a0 end: 3fffffb0 offset: 01a0

>>>stack>>>
3ffff740:  ffffffff 00000000 0000000a 3fffd848  
3ffff750:  4022785a 3ffedd78 3fff1f0c 00000001  
3ffff760:  00000040 40232e7d 00000000 3ffff7a0  
3ffff770:  3ffff7b0 4010762c 3ffefef0 3fff3fc4  
3ffff780:  3fff22cc 3ffeaefa 3ffff860 3fff22ff  
3ffff790:  3ffff7b0 3ffff7a0 0000000c 3fff22d0  
3ffff7a0:  00000002 00000001 00000000 000004b0  
3ffff7b0:  3fff252c 00000050 3fff4472 3fff442c  
3ffff7c0:  3fff22cc 3fff442c 3fff442c 40202f76  
3ffff7d0:  3ffefef0 3fff0135 3fff01f5 3ffe8b8c  
3ffff7e0:  3ffeff55 3ffeff30 3fff22cc 40232e7d  
3ffff7f0:  7f5e0001 0000faff 3ffefecc 4020f016  
3ffff800:  3fff01f5 3ffeff30 3ffeff55 8bad2f0a  
3ffff810:  00000050 3ffefef0 01ad2f0a 3ffff850  
3ffff820:  3ffffec4 3fff22d0 3ffefecc 40206388  
3ffff830:  3fff0135 3fff01f5 3ffeff30 3ffeff55  
3ffff840:  8bad2f0a 00000050 3ffefef0 3fff22d0  
3ffff850:  3fff3f84 3fff442c 3fff442c 40233dd4  
3ffff860:  50545448 312e312f 30303220 0d4b4f20  
3ffff870:  5458450a 430a0d3a 45484341 4e4f432d  
3ffff880:  4c4f5254 616d203a 67612d78 32313d65  
3ffff890:  0a0d3030 41434f4c 4e4f4954 7468203a  
3ffff8a0:  2f3a7074 3730312f 35383633 2e343038  
3ffff8b0:  312e3038 36333730 31303637 30312e36  
3ffff8c0:  37363337 37393536 3730313a 36373633  
3ffff8d0:  2f393837 37313030 46463838 34314546  
3ffff8e0:  32394632 45530a0d 52455652 7241203a  
3ffff8f0:  6e697564 2e312f6f 50552030 312f504e  
3ffff900:  7520312e 3a706e70 746f6f72 69766564  
3ffff910:  332f6563 33323338 2d363336 38353534  
3ffff920:  6464342d 31392d61 632d3838 65306164  
3ffff930:  39656336 0d383964 6575680a 6972622d  
3ffff940:  69656764 0d203a64 3a54530a 0a0d6520  
3ffff950:  48434143 4f432d45 4f52544e 6d203a4c  
3ffff960:  612d7861 313d6567 0d303032 434f4c0a  
3ffff970:  4f495441 68203a4e 3a707474 30312f2f  
3ffff980:  2e37342e 2e333731 3a393331 642f3038  
3ffff990:  72637365 69747069 782e6e6f 0a0d6c6d  
3ffff9a0:  56524553 203a5245 75647241 2f6f6e69  
3ffff9b0:  20302e31 504e5055 312e312f 42704920  
3ffff9c0:  67646972 2e302f65 680a0d31 622d6575  
3ffff9d0:  67646972 3a646965 46383120 46343345  
3ffff9e0:  43454646 39443945 4e0a0d38 75203a54  
3ffff9f0:  3a706e70 746f6f72 69766564 0a0d6563  
3ffffa00:  3a4e5355 69757520 38333a64 36333233  
3ffffa10:  342d3633 2d383535 61646434 3831392d  
3ffffa20:  64632d38 36653061 64396563 0a0d3839  
3ffffa30:  00000a0d 3fff02d8 00000000 3fff03fc  
3ffffa40:  00000010 3ffefe84 00000000 4010053d  
3ffffa50:  00000000 3ffffab0 3ffffac0 3ffea25a  
3ffffa60:  401075d4 3ffea37c 60000600 3ffef7b8  
3ffffa70:  3ffeeb1c 00000007 00000008 00000001  
3ffffa80:  00000000 09826c6d 00000000 3ffffa17  
3ffffa90:  00000008 0000001e 3ffefdb4 401004d8  
3ffffaa0:  3ffffac0 3ffffab0 00000004 4020ec24  
3ffffab0:  3ffe8ae0 09826c6d 3fff2848 3fff25f0  
3ffffac0:  4000b570 00000000 00000001 4020ed21  
3ffffad0:  00000000 00000000 00000000 00000000  
3ffffae0:  00000000 00000000 00000000 00000000  
3ffffaf0:  00000000 00000000 00000000 00000000  
3ffffb00:  00000000 00000000 00000000 00000000  
3ffffb10:  fa8df024 a74aba4f 66dc1280 0483bfe8  
3ffffb20:  c5756344 09da8074 a51205ff d3a26c8e  
3ffffb30:  c8324834 b78d8b4f 72d95eb0 384d79f3  
3ffffb40:  4000b570 00000008 00000038 3ffffc20  
3ffffb50:  00000000 00000000 00000000 00000000  
3ffffb60:  00000000 00000000 00000000 00000000  
3ffffb70:  00000000 00000000 00000000 00000000  
3ffffb80:  00000000 00000000 00000000 00000000  
3ffffb90:  5fe80931 1a2e6bc8 3ffaf902 fb876288  
3ffffba0:  5f454023 95da2a33 1cdb27af 23c9c4d1  
3ffffbb0:  fe969119 22ae52cd 1c13b328 c4372129  
3ffffbc0:  4000b5f9 00000008 00000038 3ffffca0  
3ffffbd0:  00000008 3ffffca0 efa6c34e b34003dc  
3ffffbe0:  ed667cac 76b33cf6 9a8c7914 40eb5fac  
3ffffbf0:  0f999a6a 01333aaa 2b675eda a313de37  
3ffffc00:  f542844a cf79fa93 a44f7790 9cfec05e  
3ffffc10:  32c8889d 0391d069 653e7f95 92f9fe8a  
3ffffc20:  f818fd5b 44289430 b599f7f1 22e2f841  
3ffffc30:  0e170434 29cc7119 f8263419 b2429d31  
3ffffc40:  c06473cf ed3b4dbc 31bc1e7f c88cf23e  
3ffffc50:  4000b62e 547930cf 42db55eb 8a2c4ced  
3ffffc60:  4000b6c4 3ffffca0 3ffffe30 ffffffff  
3ffffc70:  4000b72e 3ffffc80 00000008 0cb29019  
3ffffc80:  00000000 00000000 4000a333 3ffffda8  
3ffffc90:  3ffffe30 3ffffd88 00000000 f4cf082a  
3ffffca0:  00000005 00000000 00000020 40102006  
3ffffcb0:  3ffea5e5 401052e3 3ffee020 00000000  
3ffffcc0:  40102d19 3ffee020 00000000 00000000  
3ffffcd0:  00007fff 0076bc96 3ffeea5c 40102ea8  
3ffffce0:  3ffeae90 00000000 00000000 00000008  
3ffffcf0:  00000005 00000000 00000020 40102006  
3ffffd00:  3ffea5e5 401052e3 3ffee048 00000001  
3ffffd10:  40102d19 3ffee048 00000020 40102006  
3ffffd20:  00007fff 0076c55b 3ffeea5c 40102ea8  
3ffffd30:  3ffeae6c 00000000 00000000 00000022  
3ffffd40:  00000000 0076c55b 401032e6 00000100  
3ffffd50:  7fffffff 3ffeae6c 3ffeae6c 00000001  
3ffffd60:  00000001 00007fff 00000001 00000001  
3ffffd70:  3ffffe73 0076c55b 00000000 4000050c  
3ffffd80:  3fffc278 40103080 3fffc200 00000022  
3ffffd90:  3ffeae78 00000024 00000004 00000030  
3ffffda0:  4023f825 00000030 00000010 ffffffff  
3ffffdb0:  4023f898 3ffeaff2 0000003a 00205bc4  
3ffffdc0:  00000000 00007064 3fff1e0c 0000076c  
3ffffdd0:  faffffef 00001000 000000e0 00000000  
3ffffde0:  3fff3fc4 00000000 00000132 00000030  
3ffffdf0:  40227ff9 00000000 3ffee99c 40107530  
3ffffe00:  4022fea6 0000003c 4010214f 4022febd  
3ffffe10:  3fff3fdc 00000000 8bad2f0a 40102006  
3ffffe20:  00000000 402134bf 3ffedeb8 3ffec80a  
3ffffe30:  3fff22cc 3fff3fdc 3fff3f44 3ffeaefa  
3ffffe40:  3fff22cc 3fff3fc4 3ffefecc 40206898  
3ffffe50:  3ffee3d0 4021a28e 3fff1f0c 4000050c  
3ffffe60:  3ffee3f1 3ffedeb8 00000003 40220a57  
3ffffe70:  000000d0 3fff1f0c 3ffece10 3a706e70  
3ffffe80:  4021a118 00000030 00000010 ffffffff  
3ffffe90:  00250001 00001002 3fff0000 00000002  
3ffffea0:  40220000 3fff3fdc 3fffdb80 3ffeaefa  
3ffffeb0:  3fff22cc 3fff3fc4 3fff3f44 4020f077  
3ffffec0:  3ffec7c0 3fffdcc0 3ffea650 40206198  
3ffffed0:  3fff22cc 3fff3fc4 3fff3f84 402323e4  
3ffffee0:  0000076c 00000000 3ffeaee6 3fff1e18  
3ffffef0:  000000e0 00000000 00000000 40107520  
3fffff00:  00000000 00000000 00000000 3fff1e10  
3fffff10:  3ffeaee6 3fff1e18 3fff3fc4 40233b20  
3fffff20:  00000002 3fff22cc 3fff22cc 3ffef190  
3fffff30:  00000000 3fff3fc4 0000001c 3fff22cc  
3fffff40:  3ffeaed8 00000000 3fff3fc4 40232f29  
3fffff50:  04ad2f0a 0000017c 00000000 0000002b  
3fffff60:  00000002 0000001a 4021397f 3ffee020  
3fffff70:  3ffeaeb0 3fffdcc0 3ffea670 3ffea670  
3fffff80:  402138f2 3ffee020 3fffdab0 3fff2324  
3fffff90:  3fffdc80 00000000 3fff3fc4 402279bf  
3fffffa0:  40000f49 3fffdab0 3fffdab0 40000f49  
<<<stack<<<

 ets Jan  8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v3fff1b50
~ld

Wifi connection issue.

I had to replace the part of setup() that connects to WiFi with the more normal

  WiFi.begin(ssid, password);
    while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }

from other sketches, since it would fail 90% of the time and the code it has would just stop there and say WiFi failed. I dont know enough about git to be able to do whatever to update it.

Hue iOS app seems to require scenes functionality

When I open the iOS app (the one with the color icon), it finds the emulated bridge, but it immediately asks me to create a "room". Then it stalls forever "saving" the "room", doing requests like

=== 121256
Method: POST
requestedUri: api/api/scenes
URI: scenes
121257
[{"error":{"type":4,"address":"/api/api/","description":"Method not supported for scenes"}}]
121261
=== 121287
Method: POST
requestedUri: api/api/scenes
URI: scenes
121288
[{"error":{"type":4,"address":"/api/api/","description":"Method not supported for scenes"}}]
121292
=== 121317
Method: DELETE
requestedUri: api/api/groups/1
URI: groups/1
121317
=== 123624

Apparently the app insists on each lamp being in a scene now. It used to work entirely without scenes before.

This effectively prevents me from using the iOS app.

The other iOS app (the one with the b/w icon) does not seem to be able to find the emulated bridge at all.

Travis CI compilation fails

Travis CI compilation is broken with the following error:

########################################################################

SWITCHING TO esp8266: ✓

########################################################################

ESP8266HueEmulator.ino: ✖

----------------------------- DEBUG OUTPUT -----------------------------

Picked up JAVA_TOOL_OPTIONS: 

Loading configuration...

Xlib:  extension "RANDR" missing on display ":1.0".

Initializing packages...

Preparing boards...

Verifying...

In file included from /home/travis/arduino_ide/libraries/NeoPixelBus/src/NeoPixelBus.h:77:0,

                 from ESP8266HueEmulator.ino:7:

/home/travis/arduino_ide/libraries/NeoPixelBus/src/internal/DotStarSpiMethod.h:29:17: fatal error: SPI.h: No such file or directory

 #include <SPI.h>

                 ^

compilation terminated.

Error compiling.

------------------------------------------------------------------------

Will not merge any PRs until this can be resolved, because I always want to have a state of the repository that is known to build at least on Travis CI.

The state of the repository as it is now built successfully 2 months ago in https://travis-ci.org/probonopd/ESP8266HueEmulator/builds/155632821.

Can't compile too

Arduino: 1.6.8 Hourly Build 2015/12/23 04:43 (Windows 7), Плата:"NodeMCU 1.0 (ESP-12E Module), 80 MHz, Serial, 115200, 4M (3M SPIFFS)"
C:\Download\PhilipsTV\esp2866hueEmulator\HueEmulator\HueEmulator.ino: In function 'void handleAllOthers()':
HueEmulator:81: error: 'addConfigJson' was not declared in this scope
addConfigJson(root);
^
HueEmulator:96: error: 'addConfigJson' was not declared in this scope
addConfigJson(config);
^
HueEmulator:100: error: 'addLightJson' was not declared in this scope
addLightJson(lights, i, StripRgbColors[i-1]);
^
HueEmulator:112: error: 'subStr' was not declared in this scope
client = subStr(requestedUri.c_str(), "/", 1);
^
HueEmulator:131: error: 'subStr' was not declared in this scope
int numberOfTheLight = atoi(subStr(requestedUri.c_str(), "/", 4)) - 1; // The number of the light to be switched; they start with 1
^
HueEmulator:165: error: 'hsb2rgb' was not declared in this scope
rgb = hsb2rgb(hue, sat, bri);
^
C:\Download\PhilipsTV\esp2866hueEmulator\HueEmulator\HueEmulator.ino: In lambda function:
HueEmulator:181: error: no matching function for call to 'HslColor::LinearBlend(const HslColor&, const RgbColor&, const float&)'
HslColor updatedColor = HslColor::LinearBlend(originalColor, rgb, param.progress);
^
C:\Download\PhilipsTV\esp2866hueEmulator\HueEmulator\HueEmulator.ino:181:89: note: candidate is:
In file included from C:\Users\Администратор\Documents\Arduino\libraries\NeoPixelBus-master\src/NeoPixelBus.h:33:0,
from C:\Download\PhilipsTV\esp2866hueEmulator\HueEmulator\HueEmulator.ino:17:
C:\Users\Администратор\Documents\Arduino\libraries\NeoPixelBus-master\src/internal/HslColor.h:67:55: note: template static HslColor HslColor::LinearBlend(const HslColor&, const HslColor&, float)
template static HslColor LinearBlend(const HslColor& left,
^
C:\Users\Администратор\Documents\Arduino\libraries\NeoPixelBus-master\src/internal/HslColor.h:67:55: note: template argument deduction/substitution failed:
C:\Download\PhilipsTV\esp2866hueEmulator\HueEmulator\HueEmulator.ino:181:89: note: couldn't deduce template parameter 'T_NEOHUEBLEND'
HslColor updatedColor = HslColor::LinearBlend(originalColor, rgb, param.progress);
^
C:\Download\PhilipsTV\esp2866hueEmulator\HueEmulator\HueEmulator.ino: In lambda function:
HueEmulator:192: error: no matching function for call to 'HslColor::LinearBlend(const HslColor&, RgbColor&, const float&)'
HslColor updatedColor = HslColor::LinearBlend(originalColor, black, param.progress);
^
C:\Download\PhilipsTV\esp2866hueEmulator\HueEmulator\HueEmulator.ino:192:91: note: candidate is:
In file included from C:\Users\Администратор\Documents\Arduino\libraries\NeoPixelBus-master\src/NeoPixelBus.h:33:0,
from C:\Download\PhilipsTV\esp2866hueEmulator\HueEmulator\HueEmulator.ino:17:
C:\Users\Администратор\Documents\Arduino\libraries\NeoPixelBus-master\src/internal/HslColor.h:67:55: note: template static HslColor HslColor::LinearBlend(const HslColor&, const HslColor&, float)
template static HslColor LinearBlend(const HslColor& left,
^
C:\Users\Администратор\Documents\Arduino\libraries\NeoPixelBus-master\src/internal/HslColor.h:67:55: note: template argument deduction/substitution failed:
C:\Download\PhilipsTV\esp2866hueEmulator\HueEmulator\HueEmulator.ino:192:91: note: couldn't deduce template parameter 'T_NEOHUEBLEND'
HslColor updatedColor = HslColor::LinearBlend(originalColor, black, param.progress);
^
C:\Download\PhilipsTV\esp2866hueEmulator\HueEmulator\HueEmulator.ino: In function 'void handleAllOthers()':
HueEmulator:201: error: 'addLightJson' was not declared in this scope
addLightJson(root, numberOfTheLight + 1, rgb); // FIXME: This does not give the new color while an animation is still running
^
C:\Download\PhilipsTV\esp2866hueEmulator\HueEmulator\HueEmulator.ino: In function 'void setup()':
HueEmulator:234: error: 'infoLight' was not declared in this scope
infoLight(white);
^
HueEmulator:248: error: 'StringIPaddress' was not declared in this scope
ipString = StringIPaddress(WiFi.localIP());
^
C:\Download\PhilipsTV\esp2866hueEmulator\HueEmulator\HueEmulator.ino: In function 'void loop()':
HueEmulator:298: error: no matching function for call to 'NeoPixelAnimator::UpdateAnimations(int)'
if ( animator.IsAnimating() ) animator.UpdateAnimations(100);
^
C:\Download\PhilipsTV\esp2866hueEmulator\HueEmulator\HueEmulator.ino:298:64: note: candidate is:
In file included from C:\Download\PhilipsTV\esp2866hueEmulator\HueEmulator\HueEmulator.ino:18:0:
C:\Users\Администратор\Documents\Arduino\libraries\NeoPixelBus-master\src/NeoPixelAnimator.h:110:10: note: void NeoPixelAnimator::UpdateAnimations()
void UpdateAnimations();
^
C:\Users\Администратор\Documents\Arduino\libraries\NeoPixelBus-master\src/NeoPixelAnimator.h:110:10: note: candidate expects 0 arguments, 1 provided
C:\Download\PhilipsTV\esp2866hueEmulator\HueEmulator\HueEmulator.ino: In function 'void addLightJson(aJsonObject*, int, RgbColor)':
HueEmulator:388: error: 'rgb2hsb' was not declared in this scope
HsbColor hsb = rgb2hsb(rgb);
^
exit status 1
'addConfigJson' was not declared in this scope

ESP2866 Lib Ardunio IDE

What ESP2866 Lib are we all using? For some reason it errors out when compiling, saying ESP2866 Generic is not supported. Which ESP2866 Board are you guys working with? Thanks!

compile error

I am getting an error compiling. The error is described here.
esp8266/Arduino#612
What setup are you using to avoid this.
I am also getting a waring which i get rid of by adding this near the top.
// gets rid of annoying "deprecated conversion from string constant blah blah" warning

pragma GCC diagnostic ignored "-Wwrite-strings"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.