vintlabs / fauxmoESP

Add voice control of your ESP32 and ESP8266 devices using Amazon Alexa
MIT License
384 stars 69 forks source link

v3.0 not discovered by Alexa #58

Closed pvint closed 3 years ago

pvint commented 6 years ago

Original report by GeneBean (Bitbucket: genebean, GitHub: genebean).


If I use v2.3.0 of this repo with Arduino Core 2.3.0 for the ESP8266 my nodeMCU 1.0 (esp-12E) module is discovered by the Alexa app. If I update to the 3.0 version of this repo my device is never found nor is anything other than the wifi connection and free heap shown in the serial console.

In both cases I was using the provided example sketch and only changed my wifi creds and the plug name.

I did try adding #define DEBUG_FAUXMO_VERBOSE true to the 3.0 version of the sketch but it didn't change a thing.

pvint commented 6 years ago

Original comment by GeneBean (Bitbucket: genebean, GitHub: genebean).


FWIW, I upgraded fauxmoESP to 2.4.3 with the core still at 2.3.0 and am still working.

pvint commented 6 years ago

Original comment by Daniele Testa (Bitbucket: danieletesta, GitHub: danieletesta).


Same here. Not working with my esp8266 on version 3. I see that the lib switched from emulating WeMo to emulating Philipps Hue? Does that mean that I manually have to enable the Philipps Hue skill for Alexa before this works? If so, that should be mentioned in the documentation, because now it's not. In any case, I am also unable to enable that skill, because when trying to enabling it in the Alexa app, it just forwards me to the Philipps page and wants me to login. After logging in, it searches for some "philipps bridge" which if (of course) can not find and there is no way to skip that step.

pvint commented 5 years ago

Original comment by Kai Wienberg (Bitbucket: kaiwienberg, ).


I have the same problem, my ESP8266 does not get discovered with the example sketch

pvint commented 5 years ago

Original comment by Adam Byers (Bitbucket: adamslab, GitHub: adamslab).


Same issue... not being discovered by Alexa.

pvint commented 5 years ago

Original comment by Adam Byers (Bitbucket: adamslab, GitHub: adamslab).


I'm wondering if the switch to the Hue protocol means that a Hue bridge is required now. That seems to be the only way to add Hue devices to Alexa is via a bridge (excepting v1 Hue devices). Kind of sad that this isn't in the documentation and the move to a method that requires another device in the chain.

pvint commented 5 years ago

Original comment by Daniele Testa (Bitbucket: danieletesta, GitHub: danieletesta).


Adam, I think the code is emulating a Hue Bridge, but I am not sure. I also think it's weird that they would switch to a completely new protocol all of sudden without any deeper documentation on what's going on. They should have created a completely new project instead of just updating the version number to 3. They claim that the Hue API is easier to use as the API is openly documented and adds additional features as dimming etc. I ended up just creating a super simple REST API together with an Alexa skill. Much better than having this crap break between versions.

pvint commented 5 years ago

Original comment by Adam Byers (Bitbucket: adamslab, GitHub: adamslab).


Hello Daniele, After some head banging last night (some hints in other threads lead me to this) I found that (if you're using the Arduino IDE) if you switch to the 2.3.0 ESP8266 board version it discovered just fine. Showed up a some kind of Hue bulb. The dimming even worked. So, I think the issue is between the latest Fauxmo code and the latest ESP8266 core for Arduino.

pvint commented 5 years ago

Original comment by Daniele Testa (Bitbucket: danieletesta, GitHub: danieletesta).


Ok, that's cool. I might give it another try. However, this kind of proves my point. If a software can break because of changes in the framework, it's most likely not good code. Not following framework guidelines etc. Having to be afraid that everything will stop working every time the software gets a new version or the frameworks gets an update is not very pleasant. Also, if the newest version of the framework breaks the code, why haven't this been noticed and fixed? Is nobody using this code? Is nobody maintaining it? This bug was reported 2 months ago with no response.

pvint commented 5 years ago

Original comment by Luca Inox (Bitbucket: LucaInox, ).


Hello Daniele and Others, we are all on the same boat. This is my enviroment: Arduino IDE 1.8.7 - Echo Dot Mini 3rd generation - ESP8266 2.3.0 or 2.4.2 - fauxmoESP 3.02 - ==> device never discovered by Alexa.

pvint commented 5 years ago

Original comment by Rycoviac (Bitbucket: Rycoviac, GitHub: Rycoviac).


You have to fall back to ESP8266 2.3 in your boardmanager. Had this problem yesterday. Now it works fine for me with my Echo Dot 2nd generation.

pvint commented 5 years ago

Original comment by Stefan Grünwald (Bitbucket: stefan84, GitHub: stefan84).


One issue I found on trying to get it running is, that enable is by default true but I think it should be false. So you have to call fauxmo.enable(false); and fauxmo.enable(true);

Now it works again with my Echo Dot. But I'm still not able to detect it using my Echo Spot.

pvint commented 5 years ago

Original comment by Luca Inox (Bitbucket: LucaInox, ).


Stefan are you using an echo dot 3rd generation? It seems to me that 3rd generation echo devices are not supported (yet).

pvint commented 5 years ago

Original comment by Daniele Testa (Bitbucket: danieletesta, GitHub: danieletesta).


Luca, wouldn't that be very odd? The code is suppose to emulate a Philipps Hue device, which even has an "open" API. Why would support for Hue break in 3rd generation? If that is true, it's just absurd.

pvint commented 5 years ago

Original comment by Luca Inox (Bitbucket: LucaInox, ).


Daniele, many people here claim that using framework 2.3.0 the code works with echo dot 2nd generation. I have a 3rd generation device and i was not able to see my wemos D1 mini discovered by Alexa. I only loaded the basic example provided with the library just fixing the minor bug file name "credentials.sample.h".

pvint commented 5 years ago

Original comment by Andrew D (Bitbucket: [Andrew Drummond](https://bitbucket.org/Andrew Drummond), ).


Changing from lwIP variant "v2 lower memory" to "v2 higher bandwidth" in the arduino ide allowed my "devices" to be discovered when they were not before. Hope this helps others.

pvint commented 5 years ago

Original comment by Luca Inox (Bitbucket: LucaInox, ).


Andrew D please can you tell us about your enviroment? ESP8266 Framework version number, Arduino IDE version, echo generation etc. and also where to find that lwIP variant parameter?

pvint commented 5 years ago

Original comment by Andrew D (Bitbucket: [Andrew Drummond](https://bitbucket.org/Andrew Drummond), ).


2.5.0-dev, but also tried and succeeded with 2.4.0 framework. Ide 1.8.5.
echo dots v1 and v2. The LwiP variant parameter is found under "Tools->Lwip Variant" (when an esp8266 board is selected)

pvint commented 5 years ago

Original comment by Luca Inox (Bitbucket: LucaInox, ).


sorry nothing for me the only difference is echo dot v3 i tried to follow exactly your enviroment.

pvint commented 5 years ago

Original comment by Stuckey (Bitbucket: Stuckeymax, GitHub: Stuckeymax).


I have a Philips Hue Bridge v1.0 talking to three Philips bulbs. Having this bridge device will not help with the ESP8266 emulating Hue. The Hue bridge is a bridge between Ethernet and the Philips bulbs, which speak 2.4-GHz Zigbee, not 802.11, so the ESP2866 will not see the Hue bridge at all, except possibly as a (negligible) source of interference. I do wonder if HAVING a Philips Hue bridge, which has been around here for years and in use with Amazon Echo, precludes finding another thing (ESP8266 emulating Hue) that wants to be Hue. Not worth deconstructing and shutting down the existing Philips infrastructure here to find out; I'll find another way in.

My current problem: the compiler error message: 'class fauxmoESP; has no member named 'onMessage'

working on how to get 2.3.0 going.

pvint commented 5 years ago

Original comment by Carlos Yz (Bitbucket: [Carlos Yamazaki](https://bitbucket.org/Carlos Yamazaki), ).


Stuckey, the function call is different in 2.4.4 and 3.02 examples: 2.4.4 :

#!arduino

 fauxmo.onSetState([](unsigned char device_id, const char * device_name, bool state) 

3.0.2

#!arduino

fauxmo.onSetState([](unsigned char device_id, const char * device_name, bool state, unsigned char value) 

and onMessage function exists only in version 2.4.4 and below causing the error, in my case

pvint commented 5 years ago

Original comment by Peter Feerick (Bitbucket: pfeerick, GitHub: pfeerick).


With v2.4.2 of the ESP8266 Arduino Core, I was able to get a ESP8266 'Witty' module working perfectly so far by setting the lwIP option to 'v1.4 Higher Bandwidth'. 'v2 Higher Bandwith' made the difference between the ESP8266 being discoverable by the Echo Dot Gen2, but would make the ESP8266 crash if I issued a voice command which asked for a specific brightness to be set. Simply on and off commands were fine, but soon as I asked for a specific brightness it would crash and the WDT would trigger a reset. 'v1.4 Higher Bandwidth' seems to have resolved that, and it is working great so far. Thanks for pointing that out as a possibility... I thought my new echo dot was going to be about as useful as a hockey puck! :D

pvint commented 5 years ago

Original comment by Rob Janssen (RobIII) (Bitbucket: [Rob Janssen](https://bitbucket.org/Rob Janssen), ).


Same here. Works fine on an Arduino Uno, Wemos d1 mini doesn't work (not v2.x nor 3.x). Echo dot v2.

pvint commented 5 years ago

Original comment by Arpad (Bitbucket: ArpadB, GitHub: ArpadB).


Moved to #66

pvint commented 5 years ago

Original comment by Luca Inox (Bitbucket: LucaInox, ).


I tried to replicate your steps but no success. So i want to enumerate here what i did to find if i misunderstood your post. My enviroment is Echo Dot gen 3, Arduino IDE 1.8.7, ESP8266 library 2.4.2, FauxmoESP 3.0.2, board selection: Wemos D1 mini ( v2 lower memory). First i edited the src file templates.h in FAUXMO_DESCRIPTION_TEMPLATE i deleted this block "" "" "image/png" "48" "48" "24" "hue_logo_0.png" "" "" "image/png" "120" "120" "24" "hue_logo_3.png" "" "" i replaced FAUXMO_DEVICE_JSON_TEMPLATE[] with the block you published.

Then i edited fauxmoESP.cpp

char match[] = {"POST /api"}; char match[] = {"GET /api"};

Then i edited the fauxmoESP_Basic.ino

include "credentials.sample.h"

fauxmo.enable(true); (i deleted fauxmo.enable(false); and again fauxmo.enable(true);)

i left fauxmo.addDevice("light 1"); and deleted fauxmo.addDevice("light 2");

Compiled everything successfully. Asked "Alexa find devices"..Alexa replays "ok...it will last 20 seconds, activate home automation skill...) then Alexa "No device found". What i did wrong???

pvint commented 5 years ago

Original comment by Arpad (Bitbucket: ArpadB, GitHub: ArpadB).


The answer for Luca Inox's question was moved to #66, and incorporated to my post there.

pvint commented 5 years ago

Original comment by Stuckey (Bitbucket: Stuckeymax, GitHub: Stuckeymax).


If you have a Philips Hue Bridge on your network, Alexa will not discover your fauxmo devices. The solution is simple: 1) Disconnect power from your Philips Hue Bridge; 2) Tell Alexa to discover devices (fauxmo will be found, with the name you have given it; 3) Plug in your Philips Hue bridge. Now, Alexa will recognize your new device AND your Philips Hue lights will work normally; 4) If you decide to change the name of your fauxmo, you don't need to go though this again. Just tell Alexa to discover, she'll say no new devices, and in a minute or two, your new device name will be recognized. I'm using kakopappa's irdevkit.ino version found at https://gist.github.com/kakopappa/02299a8ceec0aaaad3ea3bd7f2af8066

Works well. I can get four button-push commands out of it to a single device using the four binary states of 1) Command on while state is off; 2) Command off while state is on; 3) Command on while state is on; and 4) Command off while state is off. Right now, I'm using only three of these for a Somfy 3-button handheld remote.

pvint commented 5 years ago

Original comment by Arpad (Bitbucket: ArpadB, GitHub: ArpadB).


I apologize. I saved my post for the wrong issue. I'm going to copy it to #66, where it belongs. I'll also delete them from here, so Luca Inox's notes are also related to the other issue.

pvint commented 5 years ago

Original comment by miscmail23 (Bitbucket: miscmail23, GitHub: miscmail23).


so do you guys know when fauxMo would support 3rd gen of Alexa?

pvint commented 5 years ago

Original comment by Stuckey (Bitbucket: Stuckeymax, GitHub: Stuckeymax).


miscmail = Have you tried this one? https://gist.github.com/kakopappa/02299a8ceec0aaaad3ea3bd7f2af8066 You can view network packet activity in the IDE's serial port window. Other smart home accessories (Philips Hue, WeMo, etc.) unplugged during discovery?

pvint commented 5 years ago

Original comment by Arpad (Bitbucket: ArpadB, GitHub: ArpadB).


There is a separate issue about the 3rd gen echo dot. (#66) Stuckey, you always link projects, that emulate Belkin. This backdoor is closed in the 3rd generation echo dot (And maybe in some 2nd gen firmware). The discovery is working perfectly, the Alexa even able to turn the light on, but after that it connects to the Belkin WEB API, and tries to get a confirmation about the device status (not from the device itself). As the result, Alexa will complain, and won't be able to control the light. (It means, you won't be able to turn the light off anymore.) You can see the connection to Belkin, and the actual message when you use the Alexa app. So please, don't offer different Belkin emulators to 3rd gen owners. For us, the last chance before writing (or using) Alexa skills is the Hue emulation. And this is what the fauxmo 3.0 was designed for.

pvint commented 5 years ago

Original comment by miscmail23 (Bitbucket: miscmail23, GitHub: miscmail23).


Hi Stuckey, it works ok in Wemos D1, but Alexa 3rd gen still not be able to discover it. Thanks anyway..

pvint commented 5 years ago

Original comment by miscmail23 (Bitbucket: miscmail23, GitHub: miscmail23).


Stuckey, the link you gave me, it got link to sinric as below. https://github.com/kakopappa/arduino-esp8266-alexa-wemo-switch/blob/master/sinric.ino

It works with my 3rd gen Amazon Alexa. Friendly name "tv" was discovered by Alexa. I didn't change the code, only defined SSID & password.

Thank you Stuckey...........

pvint commented 5 years ago

Original comment by Felix Hauser (Bitbucket: FelixHauser, GitHub: FelixHauser).


Well, I'm kind of stuck as well. I've downgraded the ESP8266 library to the 2.3 version, but then I cannot upload the sketch to my NodeMCU 0.9 module. The error by upload is:

espcomm_upload_mem failed

with the latest ESP8266 library, I could upload to the board without problem and the sketch was running, but no device detected.

Any hints?

UPDATE: I've just tried on a D1 Mini and it works like a charm.

pvint commented 5 years ago

Original comment by Logiciels Andro (Bitbucket: Andrologiciels, GitHub: Andrologiciels).


Thank's to Stuckey and miscmail 23, the sketch works very well with DOT v3 and v2 with a single device. Do you think it's possible to manage more than one ?

pvint commented 5 years ago

Original comment by Peter Feerick (Bitbucket: pfeerick, GitHub: pfeerick).


When you have problems like that @FelixHauser , check / try lowering the serial baud rate - it might be too high - 115200 is pretty much guaranteed to always work... but the higher 912600 baud can fail with some hardware.

pvint commented 5 years ago

Original comment by Stuckey (Bitbucket: Stuckeymax, GitHub: Stuckeymax).


And you can improve the odds of successful operation by switching clock speed from 80 to 160 MHz in the IDE Tools/CPU Frequency

SMc

pvint commented 5 years ago

Original comment by miscmail23 (Bitbucket: miscmail23, GitHub: miscmail23).


I agree with Peter, i fixed that issue (espcomm_upload_mem failed) by changing the baud rate.

pvint commented 5 years ago

Original comment by Xose Pérez (Bitbucket: [Xose Pérez](https://bitbucket.org/Xose Pérez), ).


The latest version in dev branch works with gen1 and gen3 devices. Can you guys test it?

pvint commented 5 years ago

Original comment by Adam Byers (Bitbucket: adamslab, GitHub: adamslab).


Arduino IDE v1.8.8 with ESP8266 library v2.4.2 and Faxmo v3.1.0 seems to be working fien with 2nd gen devices. No discovery issues like I reported before.

pvint commented 5 years ago

Original comment by Franck Bouquin (Bitbucket: franckBQN, ).


Thanks to Andrew D, by compiling with lwIP variant "v2 lower memory" to "v2 higher bandwidth" Alexa detects correctly my devices.

With "v2 lower memory" it was working with only one addDevice call.

I investigated a little with Resllet (https://restlet.com/modules/client/?utm_source=DHC) And by sending GET request to http://MY_ESP32_IP/api/lights I can see in the FauxmoESP logs that the response is well prepared but never arrives on my computer. I don't have enough time to really understand the cause. But thanks to Andrew D, it works now fine with my Echo Spot

pvint commented 5 years ago

Original comment by Peter Wenzel (Bitbucket: [peter wenzel](https://bitbucket.org/peter wenzel), ).


Hi All,

I have tried everything but cannot get Alexa to discover my device using the basic example code and ONLY changing the credentials file. Here's what I'm using

ESP8266 v2.4.2, v2 higher bandwidth, Faxmo v3.1.0, Alexa Gen 3 Device

Can anyone help? I've spent far too long banging my head on the table on this...

pvint commented 5 years ago

Original comment by Stuckey (Bitbucket: Stuckeymax, GitHub: Stuckeymax).


Tried irdevkit version?

Stuckey

pvint commented 5 years ago

Original comment by Peter Wenzel (Bitbucket: [peter wenzel](https://bitbucket.org/peter wenzel), ).


Thanks for the note back. Are you referring to this: https://github.com/kakopappa/arduino-esp8266-alexa-wemo-switch/blob/master/sinric.ino? Yes and unfortunately it didn't work :(. I saw mismail23 got it working. Have you got either solution working on Alex Gen 3? If so can you confirm your specific setup, I'll try to replicate.

pvint commented 5 years ago

Original comment by Daniele Testa (Bitbucket: danieletesta, GitHub: danieletesta).


Guys, if you want less problems, ditch this library full of bugs. Here is a 70-line implementation of Wemo emulation that you can use instead.

https://github.com/philbowles/weenymo

pvint commented 5 years ago

Original comment by Peter Wenzel (Bitbucket: [peter wenzel](https://bitbucket.org/peter wenzel), ).


Daniele - looks like this code was uploaded 24 hours ago; just tried and ran into an error on compile.

I think others have gotten FauxmoESP on Alexa Gen 3 so fingers crossed with a little trouble shooting I can as well (and perhaps help others avoid future problems!).

pvint commented 5 years ago

Original comment by Stuckey (Bitbucket: Stuckeymax, GitHub: Stuckeymax).


Look up irdevkit.ino

SMc

pvint commented 5 years ago

Original comment by Daniele Testa (Bitbucket: danieletesta, GitHub: danieletesta).


@wenzelpi I had no issues compiling it. What error did you get?

pvint commented 5 years ago

Original comment by Peter Feerick (Bitbucket: pfeerick, GitHub: pfeerick).


@wenzelpi I'm using a 2nd generation Echo Dot, but I found setting lwIP to v1.4 Higher Bandwidth to be the most reliable. When I set it to v2 Higher Bandwith the Wemos stopped crashing on discovery, but would then crash when I tried to use set brightness commands.

For a 3rd Gen device, are you using the set port syntax that was added specifically for 3rd gen? (copied from the fauxmoESP_Basic example)

fauxmo.setPort(80); // This is required for gen3 devices
pvint commented 5 years ago

Original comment by Peter Wenzel (Bitbucket: [peter wenzel](https://bitbucket.org/peter wenzel), ).


@pfeerick , thanks for the note. Yep, I have the post syntax added in setting the port to 80 as you indicated. I am running the basic example and ONLY changing the credentials file, all else is staying as is.

Pete

pvint commented 5 years ago

Original comment by Peter Wenzel (Bitbucket: [peter wenzel](https://bitbucket.org/peter wenzel), ).


update: because they are cheap and easy to return (and I'm determined to get this working) I bought a 2nd Gen Echo Dot, unplugged all my Gen 3 Echo Dots, and reran. No luck :(. Here's what the serial monitor shows....

16:58:43.764 -> [WIFI] Connecting to --------- .............. 16:58:45.146 -> [WIFI] STATION Mode, SSID: -------, IP address: 192.168.1.147 16:58:50.160 -> [MAIN] Free heap: 46648 bytes [this repeats on forever]

To reconfirm my setup: ESP8266 v2.4.2, v1.4 higher bandwidth, Faxmo v3.1.0, Alexa Gen 3 Device and / or Gen 2 Device (they are connected to the 2.4Ghz band on my network), Arduino IDE 1.8.8, NodeMCU ESP-12E

Suggestions for how to troubleshoot? Thanks in advance!