Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I can't compile the code #99

Open
Stefankante opened this issue Jan 5, 2018 · 21 comments
Open

I can't compile the code #99

Stefankante opened this issue Jan 5, 2018 · 21 comments

Comments

@Stefankante
Copy link

Stefankante commented Jan 5, 2018

Please advise for any mistake I did. I can't get through this. Thank you so much

WARNING: Category '' in library Digole is not valid. Setting to 'Uncategorized'
In file included from /Volumes/XRAIDDrive/GMMTV/Download/ESP8266HueEmulator-master/ESP8266HueEmulator/ESP8266HueEmulator.ino:19:0:
/Users/thom/Documents/Arduino/libraries/aJson-master-2/aJSON.h:92:6: error: conflicting return type specified for 'virtual int aJsonStream::flush()'
  int flush();
      ^
In file included from /Users/thom/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.0/cores/esp8266/Stream.h:26:0,
                 from /Users/thom/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.0/cores/esp8266/HardwareSerial.h:31,
                 from /Users/thom/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.0/cores/esp8266/Arduino.h:246,
                 from sketch/ESP8266HueEmulator.ino.cpp:1:
/Users/thom/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.0/cores/esp8266/Print.h:93:22: error:   overriding 'virtual void Print::flush()'
         virtual void flush() { /* Empty implementation for backward compatibility */ }
                      ^
exit status 1
Error compiling for board WeMos D1 mini Pro.
@probonopd
Copy link
Owner

Which exact operating and version and which exact Arduino and libraries versions are you using?

We are building on Ubuntu 14.04 using

source <(curl -SLs https://raw.githubusercontent.com/adafruit/travis-ci-arduino/master/install.sh)
mkdir -p $HOME/arduino_ide/libraries/
cd $HOME/arduino_ide/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 -
sed -i -e 's|#include "/secrets.h"|//#include "/secrets.h"|g' ESP8266HueEmulator/ESP8266HueEmulator.ino
sed -i -e 's|//const char|const char|g' ESP8266HueEmulator/ESP8266HueEmulator.ino
build_platform esp8266

@Stefankante
Copy link
Author

I'm on OSX Sierra 10.12.6 with Latest Arduino and all libraries just downloaded and install. I'll try to use terminal for your advise.

@Stefankante
Copy link
Author

I still can't get through that error after try to wipe any installed library and reinstall as describe in Command line.

@probonopd
Copy link
Owner

probonopd commented Jan 5, 2018

Do you have any chance to build it on Ubuntu 14.04 using the exact steps from above? This is the only configuration I have tested this on. Thanks.

@Stefankante
Copy link
Author

I have ever touch anything about linux before. I'll try it. Thanks.

@Stefankante
Copy link
Author

Stefankante commented Jan 7, 2018

I have result! Thank you so much for help. Now I can compile and upload to the WEMOS D1 mini board.

As I have latest version and old version installed for test each time. Turn out that I have to use ESP8266 Board library version 2.3, Other version newer or older didn't compile at all. I tested on both Ubuntu 16 and OSX Sierra.

But as I flash the board. In the beginning it worked after I have some lunch and get back soldering WS2812 for test. It didn't work again. (not related to compile issue.)

Flashing with 3M SPIFFS did work few times before at the beginning and then got #95 issue.
Flashed with 1M SPIFFS did work few times as well but then it can be discoverable by HUE app but not connect at all. I read all issue related to this but I have no clue how to solve at all.

@narfel
Copy link

narfel commented Jan 8, 2018

I'm probably not helping much, but i can confirm the exact same thing. Had to use 2.3 core to get rid of the return type of flush() error and running subsequently into watchdog resets no matter what SPIFFS i choose. I'm on Linux Mint Mate 18.3, with a WeMos D1 Mini board. The Watchdog resets occur before i could possibly check if SSDP discovery would work, though. Is there a special reason you stay on 2.3?

@Stefankante
Copy link
Author

Stefankante commented Jan 8, 2018

I use this setting in Arduino flash option.

https://ibb.co/hp60bm

Just guess that some issue post stated that memory is not enough. So I decided go no SPIFFS. It's working but with crash which it happened and get exception (28) which made it unusable before after crash.

But with no SPIFFS I get it working after it restart.

https://youtu.be/f3rWZggYqII

@probonopd
Copy link
Owner

probonopd commented Jan 9, 2018

Is there a special reason you stay on 2.3?

I am currently not developing this any further due to lack of time, but I am willing to merge pull requests that improve things - as long as the code still compiles in the continuous builds.

@gerardwr
Copy link

Installed this code acc. the README.

Compiling the latest code (Arduino 1.8.4 + ESP8266 version 2.3) gave me many warnings and several compile errors, mainly in the Neopixel code. I tried to solve them but did not succeed.

After I removed the specific Neopixel code from the sketch the sketch compiled and ran OK.

The Hue emulator on ESP8266 is recognised by the IOS Hue Gen 1 App as a valid bridge witch 2 lights. Switching the lights in the App ON/OFF and setting RGB levels result in corresponding messages in the Arduino Serial Monitor.

So the Hue emulation part of the latest code works.

I added some calls to the Adafruit-Neopixel library and, using the IOS App can now switch the Neopixels connected to the ESP8266 ON and OFF.

Also tried the latest IOS Hue App (Gen 2?). Connecting the App to the bridge was initiated (messages flying in the Serial monitor) but in the ESP8266 crashed, and remained crashing when booted. I assume some flash locations were damaged, maybe due to buffer overruns?

@ppsagarnaga
Copy link

@Stefankante Thank you, I tried with the no SPIFFS setting for my generic ESP8266 and it worked with Phillips HUE Gen 1 app. But with Phillips HUE Gen 2 app it crashes the ESP trying to save the setting from the 2 lamps as @gerardwr said.
Any workaround for making work with gen 2 app?
Oh one more thing!... I tried with Razer synapse 3 beta (they added a phillips hue integration) it detects the emulator but it ask to update with gen 2 app.

@gerardwr
Copy link

gerardwr commented Feb 4, 2018

Today I recompiled my already running sketch from a few days ago and it threw this error and stopped compiling:

On Mac Os X, Arduino 1.8.4, Arduino-ESP 2.3.0.

sketch/SSDP.cpp:257:5: note: in expansion of macro 'IP2STR'
     IP2STR(&ip), _port,

After I changed the lwIP setting from V2 to Prebuild it compiled fine.

schermafbeelding 2018-02-04 om 12 32 51

Be warned!

@mariusmotea
Copy link
Contributor

Razer implemented Hue Entertainment protocol that is secondary listening service in new Hue Bridge. Is based on udp steaming encrypted with dtls 1.2 psk. This is the reason why is asking for upgrade.

@ppsagarnaga
Copy link

Yes, you're right. I reached to the razer insider forums. Sadly it works only with bridge v2 and the new protocol.

@gerardwr
Copy link

gerardwr commented Feb 4, 2018

The sketch in the ZIP file below compiles and runs OK for me on Mac Os X, Arduino 1.8.4, Arduino-ESP 2.3.0, ESP8266 board Wemos D1 Mini

  • it's the sketch from this Github, thanks for sharing @probonopd, excellent work!
  • I replaced the Neopixel library used (lots of compile errors) with the Adafruit_Neopixel library, so make sure this library is added to your set of libraries
  • I added a function to convert Hue color info to RGB (was present in the "old" Neopixel ibrary) in the Arduino-tab "Hue.h".

The bridge is now discovered OK and the 2 lamps can be controlled nicely by the following Apps:

  • Philips Hue Gen 1 IOS App
  • Mac OS X Lighbulbs App (free)
  • Mac OS X Colors For Hue App (free)
  • Domoticx Home Automation program

Bridge can not be used by:

  • Philips Hue Gen 2 IOS App (sketch starts OK but ESP resets somewhere after processing "Scenes"
  • Google Home, Google Asstant or Amazon Echo. These devices require the bridge to be configured in the Hue Cloud, and this does not discover the bridge ;-(

Let us know how it goes if you try it. If you get the original version from @probonopd running let us know, I will be happy to dump my version for the original one.

ESP8266HueEmulator_Neopixel_stripped_beta.zip

@gibman
Copy link

gibman commented Feb 12, 2018

A word of warning for those compiling against ESP lib 2.3.

Look at my conclusion at the end of the page here.
#105

@gibman
Copy link

gibman commented Feb 13, 2018

For those wanting to compile against 2.4.0 or even the latest master from git repository follow this:

Delete both the SSDP.h and SSDP.cpp files, as they are now part of the 2.4.0 package.

In ESP8266HueEmulator.ino

//#include "SSDP.h"
#include <ESP8266SSDP.h>


Edit aJSON.h
//int flush();
virtual void flush();


and edit aJSON.cpp
/*
int
aJsonStream::flush()
{
int in = this->getch();
while(in != EOF)
{
in = this->getch();
}
return EOF;
}*/

void
aJsonStream::flush()
{
int in = this->getch();
while(in != EOF)
{
in = this->getch();
}
// return EOF;
}


I've compiled this on windows 10 using latest arduino IDE 1.9.0 beta + ESP lib 2.4.0 latest master source

@gerardwr
Copy link

gerardwr commented Feb 14, 2018

@gibman

I can confirm that compiling my sketch in Arduino 1.8.4 + 2.4.0 succeeds after your suggested changes.

NOTE 1 : The LightService.ccp tab also references SSDP.h, so I made this additional change there:

//#include "SSDP.h"
#include <ESP8266SSDP.h>

NOTE 2 : I had to select lwIP 1.4, lwIP V2 caused a looping wdt reset

schermafbeelding 2018-02-15 om 12 13 02

Thx for sharing.

@debsahu
Copy link

debsahu commented Feb 23, 2018

Can someone create a PR and/or add to readme/wiki? aJson needs fixing as well.

@plabonhasan
Copy link

hello dear can u help me? uplode is error

C:\Users\hasan\Music\ESP8266HueEmulator-master\ESP8266HueEmulator\ESP8266HueEmulator.ino:15:21: fatal error: secrets.h: No such file or directory

#include <secrets.h>

@piotrekcrash
Copy link

#include "/secrets.h" // Delete this line and populate the following
//const char* ssid = "";
//const char* password = "
";

Like described in code, delete this line with secrets.h import and enable lines with your wifi user and password

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants