Closed konsumer closed 3 years ago
Update: I got it to work with an Echo Dot, by unplugging the dot, then plugging it back in and saying "Detect new devices" as soon as it woke up.
When I try to control it by voice it says there are more than 1 with that name. When I try to do it in the app (there is only 1 "arch 1" listed) I get "Device doesn't support requested value"
Update: I got it to work with an Echo Dot, by unplugging it, then plugging it back in and saying "Detect new devices"
Good news!
When I try to control it by voice it says there are more than 1 with that name. When I try to do it in the app (there is only 1 "arch 1" listed) I get "Device doesn't support requested value"
Hm. Maybe if you try renaming your device, then do "Discover" again?
Ok, after playing with it for a bit, it seems much more stable. Renaming it, and the previous restart seems to have made it work much better. Sort of unrelated: here is is wificonnectlite, ArduinoOTA and fauxmoESP all working together nicely on EM8266:
// the name of the config-wifi, the hostname, and the device-name (in Alexa)
#define DEVICE_NAME "archlights"
#include <WiFiConnect.h>
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <ArduinoOTA.h>
#include "fauxmoESP.h"
WiFiConnect wc;
fauxmoESP fauxmo;
void handleAlexa(unsigned char device_id, const char * device_name, bool state, unsigned char value) {
Serial.printf("[MAIN] Device #%d (%s) state: %s value: %d\n", device_id, device_name, state ? "ON" : "OFF", value);
// built-in LED is swapped on EM8266
digitalWrite(LED_BUILTIN, state ? LOW : HIGH);
}
void setupFauxmo () {
fauxmo.setPort(80); // This is required for gen3 devices
fauxmo.enable(true);
fauxmo.addDevice(DEVICE_NAME);
}
void setupWifi() {
// wc.resetSettings();
if (wc.autoConnect()) {
ArduinoOTA.setHostname(DEVICE_NAME);
ArduinoOTA.begin();
Serial.printf("Running as %s with IP: %s\n", DEVICE_NAME, WiFi.localIP().toString().c_str());
} else {
wc.setAPName(DEVICE_NAME);
wc.startConfigurationPortal(AP_WAIT);
}
}
void setup() {
Serial.begin(115200);
Serial.println("\n\n");
setupWifi();
setupFauxmo();
fauxmo.onSetState(handleAlexa);
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
if (WiFi.status() != WL_CONNECTED) {
setupWifi();
} else {
ArduinoOTA.handle();
fauxmo.handle();
}
}
This gives you the ability to setup wifi in a captive portal, program the device over wifi (no direct connection needed.) This works great! Thanks for a wonderful library.
I can't seem to get Alexa (via the app or an old Echo Dot) to connect to fauxmoESP. Not sure if this is a duplicate issue, or a new thing, as it seems to not work according to suggestions in other issues.
I am using this code:
Serial console correctly shows this:
and I can
ping 192.168.86.35
Here are the paths in the app I tried:
If you want any other info (like wireshark logs, etc) let me know.