Device not responding but Works???

Issue #35 duplicate
Jezz
created an issue

Hi. Thank you for the brilliant fauxmoESP library. I have just set this up and up-loaded the fauxmoESP_Basic example on a Wemos D1. I can use the "switch one on/off" voice command and it turns the LED on and off, but a few seconds later the Echo says "switch one isn't responding". Does any one know how to solve this? Thanks


This is what i get from the serial monitor. [MAIN] Free heap: 46352 bytes [MAIN] Device #0 (switch one) state: OFF [MAIN] Free heap: 46352 bytes [MAIN] Free heap: 46352 bytes [MAIN] Device #0 (switch one) state: ON [MAIN] Free heap: 46352 bytes

Comments (50)

  1. michael2525

    Hi. I have the same problem. I can switch on/off two relays by voice command, but Alexa response "switch one isn't responding". I am using the new Echo 2, ESP8266 NodeMcu and fauxmo version 2.3.0. Thanks.

  2. Jezz reporter

    I have not tried it with 2 switches, but for some reason i cant get it to rediscover my ESP8266 NodeMCU or WemosD1 now. Not to sure what is going on...

  3. Michael

    Unfortunately i have the same problem. Maybe it has something to do with this part of the code!?

    fauxmo.onMessage(inquiry);

    I have found this in the changelog, but i don't know how to use it correctly. :/

    [2.3.0] 2017-11-08 Fixed Answer correctly to GetBinaryState queries (thanks to John McC) Deprecated Use onSetState callback instead of onMessage callback Use onGetState callback instead of setState method

  4. CLH

    I have the same issue with the "not responding". I can use voice commands and everything works, but it replies "Not Responding". Also, I cannot use the app to turn on or off anything unless it's in a group and turn on/off all at same time.

  5. SaucedCowboy

    This does not seem to work with the Echo 2nd generation. In the serial monitor I can see the ESP8266 (wemos D1 mini clone) responding to the probes from the Echo when I tell it to discover devices but the Echo never lists any devices as found. Bummer.. I guess I will need to wait until it is updated for the Echo 2nd generation unless there is already a fix for it.

  6. Jezz reporter

    @ SaucedCowboy. Exactly the same issue here. I did get it to work once, but now i cant get it to work on any of my ESP8266 devices. I have even tried different libraries, still nothing. Lets hope a fix or update comes on the scene soon :)

  7. Bibi

    I have make follow changes in Wemo.h and it works now. Use fauxmo.onSetState and fauxmo.onGetState instead of fauxmo.onMessage callback.

    const char SETSTATE_TEMPLATE[] PROGMEM =
        "<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">"
          "<s:Body>"
            "<u:SetBinaryState xmlns:u=\"urn:Belkin:service:basicevent:1\">"
              "<BinaryState>%d</BinaryState>"
            "</u:SetBinaryState>"
          "</s:Body>"
        "</s:Envelope>\r\n"
        "\r\n";
    
    const char GETSTATE_TEMPLATE[] PROGMEM =
        "<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">"
          "<s:Body>"
            "<u:GetBinaryStateResponse xmlns:u=\"urn:Belkin:service:basicevent:1\">"
              "<BinaryState>%d</BinaryState>"
            "</u:GetBinaryStateResponse>"
          "</s:Body>"
        "</s:Envelope>\r\n"
        "\r\n";
    
  8. Michael

    Hey Bibi, can you help me, adding the fauxmo.onGetState instead of fauxmo.onMessage callback in my code? Thanks!!

    include <ESP8266WiFi.h>

    include <RCSwitch.h>

    include "fauxmoESP.h"

    define WIFI_SSID "xxx"

    define WIFI_PASS "xxxx"

    fauxmoESP alexawifi; RCSwitch mySwitch = RCSwitch();

    void wifiSetup() {

    // ----------------------------------------------------------------------------- // WLAN SETUP // -----------------------------------------------------------------------------

    WiFi.mode(WIFI_STA);
    
    Serial.printf("Verbindungs zu %s wird aufgebaut ", WIFI_SSID);
    
    WiFi.begin(WIFI_SSID, WIFI_PASS);
    
    while (WiFi.status() != WL_CONNECTED) {
        Serial.print(">");
        delay(100);
    } 
    Serial.println("");
    Serial.printf("Verbunden! SSID: %s, IP Adresse: %s\n", WiFi.SSID().c_str(), WiFi.localIP().toString().c_str());
    

    }

    void anfrage(uint8_t device_id, const char * device_name, bool state) { Serial.print("Gerät: "); Serial.println(device_name); Serial.print("Status: ");

    if (state) {

    if(device_id == 0) {
    Serial.println("ON");
    
    mySwitch.send(5588305, 24);
    delay(50);
    }
    
    if(device_id == 1) {
    Serial.println("ON");
    
    mySwitch.send(5309777, 24);
    delay(50);
    }
    
    if(device_id == 2) {
    Serial.println("ON");
    
    mySwitch.send(4261201, 24);
    delay(50);
    }
    
    if(device_id == 3) {
    Serial.println("ON");
    
    mySwitch.send(1049937, 24);
    delay(50);
    }
    
    if(device_id == 4) {
    Serial.println("ON");
    
    mySwitch.send(282961, 24);
    delay(50);
    }
    

    }

    else {

    if(device_id == 0) {
    Serial.println("OFF");
    
    mySwitch.send(5588308, 24);
    delay(50);
    }
    
    if(device_id == 1) {
    Serial.println("OFF");
    
    mySwitch.send(5309783, 24);
    delay(50);
    }
    
    if(device_id == 2) {
    Serial.println("OFF");
    
    mySwitch.send(4261204, 24);
    delay(50);
    }
    
    if(device_id == 3) {
    Serial.println("OFF");
    
    mySwitch.send(1049940, 24);
    delay(50);
    }
    
    if(device_id == 4) {
    Serial.println("OFF");
    
    mySwitch.send(282964, 24);
    delay(50);
    }
    

    }

    }

    void setup() {

    Serial.begin(115200);
    Serial.println("Nach dem Verbinden, sage 'Alexa, schalte <Gerät> 'an' oder 'aus'");
    
    mySwitch.enableTransmit(5);
    
    wifiSetup();
    geraete();
    

    }

    void geraete(){

    alexawifi.addDevice("Lampe 1"); //ID 0
    alexawifi.addDevice("Lampe 2"); //ID 1
    alexawifi.addDevice("Lampe 3"); //ID 2
    alexawifi.addDevice("Lampe 4"); //ID 3
    alexawifi.addDevice("Lampe 5"); //ID 4
    
    alexawifi.onMessage(anfrage);
    }
    

    void loop() { alexawifi.handle(); }

  9. Bibi

    @ Michael. Here is it.

    #include <ESP8266WiFi.h>
    #include <RCSwitch.h>
    #include "fauxmoESP.h"
    #define WIFI_SSID "xxx"
    #define WIFI_PASS "xxxx"
    
    fauxmoESP alexawifi;
    RCSwitch mySwitch = RCSwitch();
    
    bool Lamp1 = false;
    bool Lamp2 = false;
    bool Lamp3 = false;
    bool Lamp4 = false;
    bool Lamp5 = false;
    
    
    void wifiSetup() {
    
      // ----------------------------------------------------------------------------- // WLAN SETUP // -----------------------------------------------------------------------------
    
      WiFi.mode(WIFI_STA);
    
      Serial.printf("Verbindungs zu %s wird aufgebaut ", WIFI_SSID);
    
      WiFi.begin(WIFI_SSID, WIFI_PASS);
    
      while (WiFi.status() != WL_CONNECTED) {
        Serial.print(">");
        delay(100);
      }
      Serial.println("");
      Serial.printf("Verbunden! SSID: %s, IP Adresse: %s\n", WiFi.SSID().c_str(), WiFi.localIP().toString().c_str());
    
    }
    
    
    void callbackSetState(unsigned char device_id, const char * device_name, bool state)
    {
      Serial.print("Gerät: "); Serial.println(device_name); Serial.print("Status: ");
    
      if (state)
      {
    
        Serial.println("ON");
    
        switch (device_id) {
          case 0:
            {
              mySwitch.send(5588305, 24);
              Lamp1 = true;
            }
            break;
          case 1:
            {
              mySwitch.send(5309777, 24);
              Lamp2 = true;
            }
            break;
          case 2:
            {
              mySwitch.send(4261201, 24);
              Lamp3 = true;
            }
            break;
          case 3:
            {
              mySwitch.send(1049937, 24);
              Lamp4 = true;
            }
            break;
          case 4:
            {
              mySwitch.send(282961, 24);
              Lamp5 = true;
            }
            break;
        }
    
      } else {
    
        Serial.println("OFF");
    
        switch (device_id) {
          case 0:
            {
              mySwitch.send(5588308, 24);
              Lamp1 = false;
            }
            break;
          case 1:
            {
              mySwitch.send(5309783, 24);
              Lamp2 = false;
            }
            break;
          case 2:
            {
              mySwitch.send(4261204, 24);
              Lamp3 = false;
            }
            break;
          case 3:
            {
              mySwitch.send(1049940, 24);
              Lamp4 = false;
            }
            break;
          case 4:
            {
              mySwitch.send(282964, 24);
              Lamp5 = false;
            }
            break;
        }
      }
      delay(50);
    }
    
    bool callbackGetState(unsigned char device_id, const char * device_name)
    {
      switch (device_id) {
        case 0:
          return Lamp1;
          break;
        case 1:
          return Lamp2;
          break;
        case 2:
          return Lamp3;
          break;
        case 3:
          return Lamp4;
          break;
        case 4:
          return Lamp5;
          break;
      }
    }
    
    //  void anfrage(uint8_t device_id, const char * device_name, bool state) {
    //    Serial.print("Gerät: "); Serial.println(device_name); Serial.print("Status: ");
    //
    //    if (state) {
    //
    //      if (device_id == 0) {
    //        Serial.println("ON");
    //
    //        mySwitch.send(5588305, 24);
    //        delay(50);
    //      }
    //
    //      if (device_id == 1) {
    //        Serial.println("ON");
    //
    //        mySwitch.send(5309777, 24);
    //        delay(50);
    //      }
    //
    //      if (device_id == 2) {
    //        Serial.println("ON");
    //
    //        mySwitch.send(4261201, 24);
    //        delay(50);
    //      }
    //
    //      if (device_id == 3) {
    //        Serial.println("ON");
    //
    //        mySwitch.send(1049937, 24);
    //        delay(50);
    //      }
    //
    //      if (device_id == 4) {
    //        Serial.println("ON");
    //
    //        mySwitch.send(282961, 24);
    //        delay(50);
    //      }
    //
    //    }
    //
    //    else {
    //
    //      if (device_id == 0) {
    //        Serial.println("OFF");
    //
    //        mySwitch.send(5588308, 24);
    //        delay(50);
    //      }
    //
    //      if (device_id == 1) {
    //        Serial.println("OFF");
    //
    //        mySwitch.send(5309783, 24);
    //        delay(50);
    //      }
    //
    //      if (device_id == 2) {
    //        Serial.println("OFF");
    //
    //        mySwitch.send(4261204, 24);
    //        delay(50);
    //      }
    //
    //      if (device_id == 3) {
    //        Serial.println("OFF");
    //
    //        mySwitch.send(1049940, 24);
    //        delay(50);
    //      }
    //
    //      if (device_id == 4) {
    //        Serial.println("OFF");
    //
    //        mySwitch.send(282964, 24);
    //        delay(50);
    //      }
    //
    //    }
    //
    //  }
    
    void setup() {
    
      Serial.begin(115200);
      Serial.println("Nach dem Verbinden, sage 'Alexa, schalte <Gerät> 'an' oder 'aus'");
    
      mySwitch.enableTransmit(5);
    
      wifiSetup();
      geraete();
    
    }
    
    void geraete() {
    
      alexawifi.addDevice("Lampe 1"); //ID 0
      alexawifi.addDevice("Lampe 2"); //ID 1
      alexawifi.addDevice("Lampe 3"); //ID 2
      alexawifi.addDevice("Lampe 4"); //ID 3
      alexawifi.addDevice("Lampe 5"); //ID 4
    
      // alexawifi.onMessage(anfrage);
    
      alexawifi.onSetState(callbackSetState);
      alexawifi.onGetState(callbackGetState);
    }
    
    void loop() {
      alexawifi.handle();
    }
    
  10. Curt

    I also have a device not responding issue. When turning on device, alexa says device not responding, although device turns on. When turning off device, alexa says okay, and device turns off.

  11. Jezz reporter

    Curt, you are lucky i cant get it to work at all now, i cant even get it to discover any switches. I have came to the conclusion it does not work on the Echo plus. When i try the discovery, the serial monitor displays the following text 13 times then Alexa reports no devices found when trying the example code from the library ....

    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.0.15:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 444556B75D4400
    SERVER: Unspecified, UPnP/1.0, Unspecified
    X-User-Agent: redsonic
    ST: urn:Belkin:service:basicevent:1
    USN: uuid:Socket-1_0-444556B75D4400::urn:Belkin:service:basicevent:1
    
  12. Curt

    @ Bibi: I have tried with and without editing wemo.h. Hardware: - amazon echo v2 - nodemcu v1.0 board - also tried on adafruit feather huzzah board

    Please see the following code of what I am testing with:

    /*
        12/29/17
        nodemcu simple fauxmo base
    
    */
    
    #include <time.h>
    #include <ESP8266WiFi.h>
    
    #include <DNSServer.h>            //Local DNS Server used for redirecting all requests to the configuration portal
    #include <ESP8266WebServer.h>     //Local WebServer used to serve the configuration portal
    #include <WiFiManager.h>          //https://github.com/tzapu/WiFiManager WiFi Configuration Magic
    
    #include <fauxmoESP.h>
    
    #define LED     D0        // Led in NodeMCU at pin GPIO16 (D0).
    
    void configModeCallback (WiFiManager *myWiFiManager);
    //void callbackGetState(uint8_t device_id, const char * device_name, bool state);
    void callbackSetState(unsigned char device_id, const char * device_name, bool state);
    
    
    const char *ssid     = "enter SSID";
    const char *password = "enter PW";
    
    int device_state = 0;
    fauxmoESP fauxmo;
    
    bool first_high_command = 1;
    bool first_low_command = 1;
    
    void setup(){
    
      pinMode(LED, OUTPUT);     // LED pin as output.
      digitalWrite(LED, HIGH);  // turn the LED off.
      Serial.begin(9600);
      Serial.println("connecting to wifi..."); // println adds a cr, print doesnt
    
      WiFiManager wifiManager;
      wifiManager.setConfigPortalTimeout(180);  // after 3 mins, device will restart rather than hang on config screen.
      wifiManager.setAPCallback(configModeCallback);
      wifiManager.autoConnect("LED-WIFI-CONFIG", "password");
    //  wifiManager.startConfigPortal("LED-WIFI-CONFIG", "password");   // used to force config portal for testing
    
      // Fauxmo
      fauxmo.enable(true);
    
      fauxmo.addDevice("device 1");
      fauxmo.onSetState(callbackSetState);
    //  fauxmo.onMessage(callback);     // having problems using this
    }
    
    void loop() {
      fauxmo.handle();  // non-blocking apparently, GOOD!
    }
    
    // Called if WiFi has not been configured yet
    void configModeCallback (WiFiManager *myWiFiManager) {
      char ap_name[30] = "";
    
      Serial.println("Wifi manager");
      Serial.println("Please connect to AP");
    
      sprintf(ap_name, "%s", myWiFiManager->getConfigPortalSSID().c_str() );
      Serial.println(ap_name);
    
    }
    
    void callbackSetState(unsigned char device_id, const char * device_name, bool state) {
      Serial.print("Device ");    Serial.print(device_name); 
    //  Serial.print(" Device id "); Serial.print(device_id); 
      Serial.print(" state: ");   Serial.print(state);
    
      if (state) {
        first_low_command =1;
        if (first_high_command) {
          first_high_command = 0;
          // turn led on
          digitalWrite(LED, LOW);  // turn the LED on.      
        }
      } 
      else {
        first_high_command = 1;
        if (first_low_command) {
          first_low_command = 0;
          // turn led off
          digitalWrite(LED, HIGH);  // turn the LED off.
        }
      }
    }
    
  13. Bibi

    Hey @ Curt. You forget fauxmo.onGetState function in your source code.

    In callbackGetState you must invert DigitalRead(LED) result, because you use an inverted logic:

    State = 1 -> LED = LOW and State = 0 -> LED = HIGH.
    

    Thats all !! :)

    /*
        12/29/17
        Curtis Mattull
        nodemcu simple fauxmo base
    
    */
    
    #include <time.h>
    #include <ESP8266WiFi.h>
    
    #include <DNSServer.h>            //Local DNS Server used for redirecting all requests to the configuration portal
    #include <ESP8266WebServer.h>     //Local WebServer used to serve the configuration portal
    #include <WiFiManager.h>          //https://github.com/tzapu/WiFiManager WiFi Configuration Magic
    
    #include <fauxmoESP.h>
    
    #define LED     D0        // Led in NodeMCU at pin GPIO16 (D0).
    
    void configModeCallback (WiFiManager *myWiFiManager);
    //void callbackGetState(uint8_t device_id, const char * device_name, bool state);
    //void callbackSetState(unsigned char device_id, const char * device_name, bool state);
    
    const char *ssid     = "enter SSID";
    const char *password = "enter PW";
    
    int device_state = 0;
    fauxmoESP fauxmo;
    
    bool first_high_command = 1;
    bool first_low_command = 1;
    
    void setup(){
    
      pinMode(LED, OUTPUT);     // LED pin as output.
      digitalWrite(LED, HIGH);  // turn the LED off.
      Serial.begin(9600);
      Serial.println("connecting to wifi..."); // println adds a cr, print doesnt
    
      WiFiManager wifiManager;
      wifiManager.setConfigPortalTimeout(180);  // after 3 mins, device will restart rather than hang on config screen.
      wifiManager.setAPCallback(configModeCallback);
      wifiManager.autoConnect("LED-WIFI-CONFIG", "password");
    //  wifiManager.startConfigPortal("LED-WIFI-CONFIG", "password");   // used to force config portal for testing
    
      // Fauxmo
      fauxmo.enable(true);
    
      fauxmo.addDevice("device 1");
      fauxmo.onSetState(callbackSetState);
      fauxmo.onGetState(callbackGetState);
    //  fauxmo.onMessage(callback);     // having problems using this
    }
    
    void loop() {
      fauxmo.handle();  // non-blocking apparently, GOOD!
    }
    
    // Called if WiFi has not been configured yet
    void configModeCallback (WiFiManager *myWiFiManager) {
      char ap_name[30] = "";
    
      Serial.println("Wifi manager");
      Serial.println("Please connect to AP");
    
      sprintf(ap_name, "%s", myWiFiManager->getConfigPortalSSID().c_str() );
      Serial.println(ap_name);
    
    }
    
    void callbackSetState(unsigned char device_id, const char * device_name, bool state) {
      Serial.print("Device ");    Serial.print(device_name); 
    //  Serial.print(" Device id "); Serial.print(device_id); 
      Serial.print(" state: ");   Serial.print(state);
    
      if (state) {
        first_low_command =1;
        if (first_high_command) {
          first_high_command = 0;
          // turn led on
          digitalWrite(LED, LOW);  // turn the LED on.      
        }
      } 
      else {
        first_high_command = 1;
        if (first_low_command) {
          first_low_command = 0;
          // turn led off
          digitalWrite(LED, HIGH);  // turn the LED off.
        }
      }
    }
    
    bool callbackGetState(unsigned char device_id, const char * device_name)
    {
      return !digitalRead(LED);
    }
    
  14. Bibi

    Hey @ Jezz, I had the same problem with the EchoShow. Alexa reports no devices found. I bought a EchDot 2ndGen. And now it works with Echo Dot and Echo Show. Why? I have no idea. I am happy. :)

  15. Jezz reporter

    @ Bibi. I have a Dot Gen 2 on order from Amazon (I must have ordered while drunk on Friday), It wont be here until the 5th Feb. Will see how things go then. The Strange thing is that it worked the very 1st time i tried it. Then i added a new switch to the code and never been able to discover again, even with the original code that once worked.

  16. Jezz reporter

    @ Bibi. Still not discoverable.
    Serial monitor reports...

    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.0.15:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 444556B75D4400
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: urn:Belkin:device:**
    USN: uuid:Socket-1_0-444556B75D4400::urn:Belkin:device:**
    X-User-Agent: redsonic
    

    The code i am using on the ESP8266/wemosD1/nodeMCU

    #include <Arduino.h>
    #include <ESP8266WiFi.h>
    #include "fauxmoESP.h"
    #include "credentials.h"
    
    #define SERIAL_BAUDRATE                 115200
    #define LED                             2
    
    fauxmoESP fauxmo;
    
    // -----------------------------------------------------------------------------
    // Wifi
    // -----------------------------------------------------------------------------
    
    void wifiSetup() {
    
        // Set WIFI module to STA mode
        WiFi.mode(WIFI_STA);
    
        // Connect
        Serial.printf("[WIFI] Connecting to %s ", WIFI_SSID);
        WiFi.begin(WIFI_SSID, WIFI_PASS);
    
        // Wait
        while (WiFi.status() != WL_CONNECTED) {
            Serial.print(".");
            delay(100);
        }
        Serial.println();
    
        // Connected!
        Serial.printf("[WIFI] STATION Mode, SSID: %s, IP address: %s\n", WiFi.SSID().c_str(), WiFi.localIP().toString().c_str());
    
    }
    
    void setup() {
    
        // Init serial port and clean garbage
        Serial.begin(SERIAL_BAUDRATE);
        Serial.println();
        Serial.println();
    
        // Wifi
        wifiSetup();
    
        // LED
        pinMode(LED, OUTPUT);
        digitalWrite(LED, HIGH);
    
        // You can enable or disable the library at any moment
        // Disabling it will prevent the devices from being discovered and switched
        fauxmo.enable(true);
    
        // Add virtual devices
        fauxmo.addDevice("switch one");
        //fauxmo.addDevice("switch two"); // You can add more devices
        //fauxmo.addDevice("switch three");
    
        // fauxmoESP 2.0.0 has changed the callback signature to add the device_id, this WARRANTY
        // it's easier to match devices to action without having to compare strings.
        fauxmo.onSetState([](unsigned char device_id, const char * device_name, bool state) {
            Serial.printf("[MAIN] Device #%d (%s) state: %s\n", device_id, device_name, state ? "ON" : "OFF");
            digitalWrite(LED, !state);
        });
    
        // Callback to retrieve current state (for GetBinaryState queries)
        fauxmo.onGetState([](unsigned char device_id, const char * device_name) {
            return digitalRead(LED) == HIGH;
        });
    
    }
    
    void loop() {
    
        // Since fauxmoESP 2.0 the library uses the "compatibility" mode by
        // default, this means that it uses WiFiUdp class instead of AsyncUDP.
        // The later requires the Arduino Core for ESP8266 staging version
        // whilst the former works fine with current stable 2.3.0 version.
        // But, since it's not "async" anymore we have to manually poll for UDP
        // packets
        fauxmo.handle();
    
        static unsigned long last = millis();
        if (millis() - last > 5000) {
            last = millis();
            Serial.printf("[MAIN] Free heap: %d bytes\n", ESP.getFreeHeap());
        }
    
    }
    
  17. Bibi

    @ Jezz. The device "switch one" have found and works with Alexa. I changed this line in your source code.:

    return digitalRead(LED) == HIGH;
    

    to

    return !digitalRead(LED);
    

    Can you delete the comment in the line (45) of fauxmoESP.h Save the file an recompile your project. Send me the result of the serial monitor.

    //#define DEBUG_FAUXMO
    

    to

    #define DEBUG_FAUXMO
    

    When your ESP8266/wemosD1/nodeMCU is connected to your homenet, open follow line in your browser and post the content. Replace <your-ip-adress> with the IP address of ESP8266/wemosD1/nodeMCU

    http://<your-ip-adress>:52000/setup.xml
    
  18. Jezz reporter

    Hi there, Happy new year... Thanks for the dropbox link. i did manage to download it but still cant get it to discover anything...

  19. Jezz reporter

    One thing i did notice is even if I change the code to add 2 switches, the output from setup.xml does not change. It still only shows <friendlyName>switch one</friendlyName>.

  20. Bibi

    Hi @ Jezz, Happy New Year ... if you add more than one device, the port number will automatically increase.

    1st Device:

    http://<your-ip-adress>:52000/setup.xml
    

    2nd Device:

    http://<your-ip-adress>:52001/setup.xml
    
  21. Jaime Lopez

    Hi @ Bibi, Happy New Year. Sorry for jumping in on this. I just tested your latest fauxmoESP library 02.01.2018. I have an echo dot 2nd gen, and still the devices are not being found. Here is what I get for the serial monitor and Setup.xml (using same code as above):

    Serial

    [WIFI] STATION Mode, SSID: WiFi-Casa, IP address: 192.168.1.100
    [FAUXMO] Enabled
    [FAUXMO] Device 'switch one' added as #0
    [MAIN] Free heap: 43104 bytes
    [MAIN] Free heap: 42600 bytes
    [FAUXMO] Search request from 192.168.1.136
    [FAUXMO] UDP response for device #0 (switch one)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: urn:Belkin:device:**
    USN: uuid:Socket-1_0-44455602DB3500::urn:Belkin:device:**
    X-User-Agent: redsonic
    
    
    [FAUXMO] Search request from 192.168.1.136
    [FAUXMO] UDP response for device #0 (switch one)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: upnp:rootdevice
    USN: uuid:Socket-1_0-44455602DB3500::upnp:rootdevice
    X-User-Agent: redsonic
    
    
    [FAUXMO] Client #0 connected
    [FAUXMO] Device #0 /setup.xml
    [FAUXMO] Search request from 192.168.1.155
    [FAUXMO] UDP response for device #0 (switch one)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: urn:Belkin:device:**
    USN: uuid:Socket-1_0-44455602DB3500::urn:Belkin:device:**
    X-User-Agent: redsonic
    
    
    [FAUXMO] Search request from 192.168.1.155
    [FAUXMO] UDP response for device #0 (switch one)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: urn:Belkin:device:**
    USN: uuid:Socket-1_0-44455602DB3500::urn:Belkin:device:**
    X-User-Agent: redsonic
    
    
    [MAIN] Free heap: 41176 bytes
    [FAUXMO] UDP response for device #0 (switch one)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: urn:Belkin:device:**
    USN: uuid:Socket-1_0-44455602DB3500::urn:Belkin:device:**
    X-User-Agent: redsonic
    
    
    [FAUXMO] UDP response for device #0 (switch one)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: urn:Belkin:device:**
    USN: uuid:Socket-1_0-44455602DB3500::urn:Belkin:device:**
    X-User-Agent: redsonic
    
    
    [FAUXMO] UDP response for device #0 (switch one)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: urn:Belkin:device:**
    USN: uuid:Socket-1_0-44455602DB3500::urn:Belkin:device:**
    X-User-Agent: redsonic
    
    
    [FAUXMO] Client #1 connected
    [FAUXMO] Client #2 connected
    [FAUXMO] Client #3 connected
    [FAUXMO] Device #0 /setup.xml
    [FAUXMO] Device #0 /setup.xml
    [FAUXMO] Device #0 /setup.xml
    [MAIN] Free heap: 40880 bytes
    [MAIN] Free heap: 40880 bytes
    [MAIN] Free heap: 40880 bytes
    [MAIN] Free heap: 40880 bytes
    [MAIN] Free heap: 40880 bytes
    [FAUXMO] Client #0 disconnected
    [MAIN] Free heap: 41304 bytes
    [FAUXMO] Client #3 disconnected
    [FAUXMO] Client #2 disconnected
    [FAUXMO] Client #1 disconnected
    [MAIN] Free heap: 42600 bytes
    [MAIN] Free heap: 42600 bytes
    [FAUXMO] Search request from 192.168.1.161
    [FAUXMO] UDP response for device #0 (switch one)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: upnp:rootdevice
    USN: uuid:Socket-1_0-44455602DB3500::upnp:rootdevice
    X-User-Agent: redsonic
    
    
    [FAUXMO] UDP response for device #0 (switch one)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: upnp:rootdevice
    USN: uuid:Socket-1_0-44455602DB3500::upnp:rootdevice
    X-User-Agent: redsonic
    
    
    [FAUXMO] UDP response for device #0 (switch one)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: upnp:rootdevice
    USN: uuid:Socket-1_0-44455602DB3500::upnp:rootdevice
    X-User-Agent: redsonic
    
    
    [FAUXMO] UDP response for device #0 (switch one)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: upnp:rootdevice
    USN: uuid:Socket-1_0-44455602DB3500::upnp:rootdevice
    X-User-Agent: redsonic
    
    
    [FAUXMO] UDP response for device #0 (switch one)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: upnp:rootdevice
    USN: uuid:Socket-1_0-44455602DB3500::upnp:rootdevice
    X-User-Agent: redsonic
    
    
    [MAIN] Free heap: 42600 bytes
    [MAIN] Free heap: 42600 bytes
    [MAIN] Free heap: 42600 bytes
    [MAIN] Free heap: 42600 bytes
    [MAIN] Free heap: 42600 bytes
    [MAIN] Free heap: 42600 bytes
    [MAIN] Free heap: 42600 bytes
    [MAIN] Free heap: 42600 bytes
    [MAIN] Free heap: 42600 bytes
    [MAIN] Free heap: 42600 bytes
    [MAIN] Free heap: 42600 bytes
    [MAIN] Free heap: 42600 bytes
    [FAUXMO] Search request from 192.168.1.161
    [FAUXMO] UDP response for device #0 (switch one)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: upnp:rootdevice
    USN: uuid:Socket-1_0-44455602DB3500::upnp:rootdevice
    X-User-Agent: redsonic
    
    
    [FAUXMO] UDP response for device #0 (switch one)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: upnp:rootdevice
    USN: uuid:Socket-1_0-44455602DB3500::upnp:rootdevice
    X-User-Agent: redsonic
    
    
    [FAUXMO] UDP response for device #0 (switch one)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: upnp:rootdevice
    USN: uuid:Socket-1_0-44455602DB3500::upnp:rootdevice
    X-User-Agent: redsonic
    
    
    [FAUXMO] UDP response for device #0 (switch one)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: upnp:rootdevice
    USN: uuid:Socket-1_0-44455602DB3500::upnp:rootdevice
    X-User-Agent: redsonic
    
    
    [FAUXMO] UDP response for device #0 (switch one)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: upnp:rootdevice
    USN: uuid:Socket-1_0-44455602DB3500::upnp:rootdevice
    X-User-Agent: redsonic
    
    
    [MAIN] Free heap: 42600 bytes
    [MAIN] Free heap: 42600 bytes
    [MAIN] Free heap: 42600 bytes
    [MAIN] Free heap: 42600 bytes
    [FAUXMO] Search request from 192.168.1.197
    [FAUXMO] UDP response for device #0 (switch one)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: upnp:rootdevice
    USN: uuid:Socket-1_0-44455602DB3500::upnp:rootdevice
    X-User-Agent: redsonic
    
    
    [FAUXMO] Search request from 192.168.1.197
    [FAUXMO] UDP response for device #0 (switch one)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: upnp:rootdevice
    USN: uuid:Socket-1_0-44455602DB3500::upnp:rootdevice
    X-User-Agent: redsonic
    
    
    [FAUXMO] UDP response for device #0 (switch one)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: upnp:rootdevice
    USN: uuid:Socket-1_0-44455602DB3500::upnp:rootdevice
    X-User-Agent: redsonic
    
    
    [FAUXMO] UDP response for device #0 (switch one)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: upnp:rootdevice
    USN: uuid:Socket-1_0-44455602DB3500::upnp:rootdevice
    X-User-Agent: redsonic
    
    
    [FAUXMO] UDP response for device #0 (switch one)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: upnp:rootdevice
    USN: uuid:Socket-1_0-44455602DB3500::upnp:rootdevice
    X-User-Agent: redsonic
    
    
    [FAUXMO] UDP response for device #0 (switch one)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: upnp:rootdevice
    USN: uuid:Socket-1_0-44455602DB3500::upnp:rootdevice
    X-User-Agent: redsonic
    
    
    [MAIN] Free heap: 42600 bytes
    

    Setup.xml

    urn:Belkin:device:controllee:1switch oneBelkin International Inc.Socket1.0uuid:Socket-1_0-44455602DB3500221703K3443EF000urn:Belkin:service:basicevent:1urn:Belkin:serviceId:basicevent1/upnp/control/basicevent1/upnp/event/basicevent1/eventservice.xmlurn:Belkin:service:metainfo:1urn:Belkin:serviceId:metainfo1/upnp/control/metainfo1
    

    Hope this helps :)

  22. Bibi

    Hi @ Jaime,

    what devices are 192.168.1.136, 192.168.1.155, 192.168.1.161 and 192.168.1.197?

    Here are my results (10.0.0.207 = WemosD1 / 10.0.0.126 =echoDot 2ndGen).

    Search new Device over EchoDot:

    [FAUXMO] UDP server started
    [WIFI] STATION Mode, SSID: FUNKY, IP address: 10.0.0.207
    [FAUXMO] Enabled
    [FAUXMO] Device 'switch one' added as #0
    [MAIN] Free heap: 45312 bytes
    [MAIN] Free heap: 45312 bytes
    [FAUXMO] Search request from 10.0.0.126
    [FAUXMO] UDP response for device #0 (switch one)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://10.0.0.207:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 4445563443EF00
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: urn:Belkin:device:**
    USN: uuid:Socket-1_0-4445563443EF00::urn:Belkin:device:**
    X-User-Agent: redsonic
    
    [FAUXMO] Search request from 10.0.0.126
    [FAUXMO] UDP response for device #0 (switch one)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://10.0.0.207:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 4445563443EF00
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: upnp:rootdevice
    USN: uuid:Socket-1_0-4445563443EF00::upnp:rootdevice
    X-User-Agent: redsonic
    
    [FAUXMO] UDP response for device #0 (switch one)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://10.0.0.207:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 4445563443EF00
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: upnp:rootdevice
    USN: uuid:Socket-1_0-4445563443EF00::upnp:rootdevice
    X-User-Agent: redsonic
    
    [FAUXMO] Client #0 connected
    [FAUXMO] Device #0 /setup.xml
    [FAUXMO] Client #0 disconnected
    [MAIN] Free heap: 45312 bytes
    
    <root xmlns="urn:Belkin:device-1-0">
        <device>
            <deviceType>urn:Belkin:device:controllee:1</deviceType>
            <friendlyName>switch one</friendlyName>
            <manufacturer>Belkin International Inc.</manufacturer>
            <modelName>Socket</modelName>
            <modelNumber>1.0</modelNumber>
            <UDN>uuid:Socket-1_0-4445563443EF00</UDN>
            <serialNumber>221703K3443EF00</serialNumber>
            <binaryState>0</binaryState>
            <serviceList>
                <service>
                    <serviceType>urn:Belkin:service:basicevent:1</serviceType>
                    <serviceId>urn:Belkin:serviceId:basicevent1</serviceId>
                    <controlURL>/upnp/control/basicevent1</controlURL>
                    <eventSubURL>/upnp/event/basicevent1</eventSubURL>
                    <SCPDURL>/eventservice.xml</SCPDURL>
                </service>
                <service>
                    <serviceType>urn:Belkin:service:metainfo:1</serviceType>
                    <serviceId>urn:Belkin:serviceId:metainfo1</serviceId>
                    <controlURL>/upnp/control/metainfo1</controlURL>
                    <eventSubURL>/upnp/event/metainfo1</eventSubURL>
                    <SCPDURL>/metainfoservice.xml</SCPDURL>
                </service>
            </serviceList>
        </device>
    </root>
    
  23. Jaime Lopez

    A couple of amazon echo dot's (all 2nd gen), my phone and strangely enough a google home mini.

    I was performing a search using the Alexa app on my Android.

    I now disconnected the google home mini, and performed the device discovery via the echo dot (instead of the app).

    Still, no devices were discovered, but here is the result:

    [MAIN] Free heap: 42600 bytes
    [FAUXMO] Search request from 192.168.1.136
    [FAUXMO] UDP response for device #0 (switch test)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: urn:Belkin:device:**
    USN: uuid:Socket-1_0-44455602DB3500::urn:Belkin:device:**
    X-User-Agent: redsonic
    
    
    [FAUXMO] Search request from 192.168.1.136
    [FAUXMO] UDP response for device #0 (switch test)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: upnp:rootdevice
    USN: uuid:Socket-1_0-44455602DB3500::upnp:rootdevice
    X-User-Agent: redsonic
    
    
    [FAUXMO] Client #0 connected
    [FAUXMO] Device #0 /setup.xml
    [MAIN] Free heap: 42152 bytes
    [MAIN] Free heap: 42152 bytes
    [MAIN] Free heap: 42152 bytes
    [MAIN] Free heap: 42152 bytes
    [MAIN] Free heap: 42152 bytes
    [MAIN] Free heap: 42152 bytes
    [FAUXMO] Client #0 disconnected
    [MAIN] Free heap: 42600 bytes
    
  24. CLH

    What I found to work best is to watch the IIDE/Serial output. Just before you ask Alexa to discover new devices, restart the esp and wait for it to report it found XXX devices, as soon as it reports that, hit discover on echo and watch the serial readout. It should discover the devices now. Be sure if you're using the web app, refresh the page to show new devices.

  25. Jaime Lopez

    @ Bibi , Alexa says "I couldn't find any new Smart Home devices....."

    When I enter the Alexa app, I only see this:

    alexa.jpg

    Tested a few times, but still get the same result :(

    I am using the esp8266 2.4.0 board library that I downloaded using the boards manager in Arduino. Not sure if this helps

  26. Jaime Lopez

    @ CLH, Tried that out as well, it seems that all my alexa enabled devices try finding the fauxmo device. Still, it doesn't ever register the smart device..

    Here is the output when trying to discover devices via alexa.amazon.com:

    [FAUXMO] Device 'switch test' added as #0
    [MAIN] Free heap: 43104 bytes
    [MAIN] Free heap: 42600 bytes
    [FAUXMO] Search request from 192.168.1.136
    [FAUXMO] UDP response for device #0 (switch test)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: urn:Belkin:device:**
    USN: uuid:Socket-1_0-44455602DB3500::urn:Belkin:device:**
    X-User-Agent: redsonic
    
    
    [FAUXMO] Search request from 192.168.1.136
    [FAUXMO] Client #0 connected
    [FAUXMO] Device #0 /setup.xml
    [FAUXMO] Search request from 192.168.1.155
    [FAUXMO] UDP response for device #0 (switch test)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: urn:Belkin:device:**
    USN: uuid:Socket-1_0-44455602DB3500::urn:Belkin:device:**
    X-User-Agent: redsonic
    
    
    [FAUXMO] UDP response for device #0 (switch test)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: urn:Belkin:device:**
    USN: uuid:Socket-1_0-44455602DB3500::urn:Belkin:device:**
    X-User-Agent: redsonic
    
    
    [FAUXMO] UDP response for device #0 (switch test)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: urn:Belkin:device:**
    USN: uuid:Socket-1_0-44455602DB3500::urn:Belkin:device:**
    X-User-Agent: redsonic
    
    
    [FAUXMO] UDP response for device #0 (switch test)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: urn:Belkin:device:**
    USN: uuid:Socket-1_0-44455602DB3500::urn:Belkin:device:**
    X-User-Agent: redsonic
    
    
    [FAUXMO] UDP response for device #0 (switch test)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: urn:Belkin:device:**
    USN: uuid:Socket-1_0-44455602DB3500::urn:Belkin:device:**
    X-User-Agent: redsonic
    
    
    [FAUXMO] Search request from 192.168.1.155
    [FAUXMO] Client #1 connected
    [FAUXMO] Client #2 connected
    [FAUXMO] UDP response for device #0 (switch test)
    HTTP/1.1 200 OK
    CACHE-CONTROL: max-age=86400
    DATE: Mon, 22 Jun 2015 17:24:01 GMT
    EXT:
    LOCATION: http://192.168.1.100:52000/setup.xml
    OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
    01-NLS: 44455602DB3500
    SERVER: Unspecified, UPnP/1.0, Unspecified
    ST: urn:Belkin:device:**
    USN: uuid:Socket-1_0-44455602DB3500::urn:Belkin:device:**
    X-User-Agent: redsonic
    
    
    [FAUXMO] Device #0 /setup.xml
    [FAUXMO] Device #0 /setup.xml
    [FAUXMO] Client #3 connected
    [FAUXMO] Device #0 /setup.xml
    [FAUXMO] Client #4 connected
    [FAUXMO] Device #0 /setup.xml
    [MAIN] Free heap: 40456 bytes
    [MAIN] Free heap: 40456 bytes
    [MAIN] Free heap: 40456 bytes
    [MAIN] Free heap: 40456 bytes
    [MAIN] Free heap: 40456 bytes
    [MAIN] Free heap: 40456 bytes
    [FAUXMO] Client #0 disconnected
    [FAUXMO] Client #3 disconnected
    [FAUXMO] Client #2 disconnected
    [FAUXMO] Client #1 disconnected
    [FAUXMO] Client #4 disconnected
    [MAIN] Free heap: 42600 bytes
    [MAIN] Free heap: 42600 bytes
    
  27. Bibi

    Hi @ Jaime,

    i have tested with the esp8266 2.4.0 board library and alexa doesn't discover the device. When I used the board library esp8266 2.3.0 alexa finds the new device and works fine.

    This is not a problem from my source code, but from the esp8266 Board library.

  28. Bibi

    Hi @ Jaime,

    yes. I have Arduino v1.8.5 and changed the esp8266 library via the integrated Boards manager. You must search for "esp8266" in the Boards manager to find esp8266 by ESP8266 Community.

    The ESP8266 v2.3.0 is the right version. v2.4.0 is wrong. You can test both to see the difference.

    ESP8266 Version.png

  29. Jezz reporter

    Hi Bibi. Your fauxmoESP_02.01.2018 Library appears to have fixed it. I now have "switch one" working. Thank you very much for your time and effort on the library.

  30. SaucedCowboy

    Bibi, My bad.. I was looking in the library maintenance not the board maintenance. Brain fart. So I’ve tried the latest version for the board 2.4.0 and the latest fauxmo library and your own code and echo gen 2 still does not find the devices although I see the wemos responding to the probes. I’ve also tried about all the other peoples code for turning on/off a wemos switch with the echo and none of them work. I’ve tried the alexa web site app, the android app and telling echo to discover devices.

    If you have this working is there a place we can grab all the libraries and code in one spot so we could test it?

  31. Bibi

    Hi @ SaucedCowboy,

    dont use the Arduino ESP8266 Board Library v2.4.0. This does not work correctly. Just use Arduino ESP8266 Board Library v2.3.0 (see the Boards Manager Screenshot). You must see 2.3.0 INSTALLED

    and Download my new FauxmoESP Library v2.4.0

  32. SaucedCowboy

    Hi Bibi, Thanks for trying to help. I installed the Board library v2.3.0. Then I downloaded your FauxmoESP Library v2.4.0 and installed it. Copied your sample fauxmoESP_Basic to the desktop. Changed the credentials.sample.h to credentials.h and put in my wifi name and password. Compiled and uploaded the program to my wemos D1 mini clone. I saw that it connected ok to my network. Then I told Alexa to discover devices… Nothing found. Used the app to discover… Nothing found. I don’t see the wemos reacting to the probes from the amazon echo gen2.

    [WIFI] Connecting to unavailable ................................................. [WIFI] STATION Mode, SSID: unavailable, IP address: 192.168.1.105 [MAIN] Free heap: 46456 bytes [MAIN] Free heap: 46456 bytes [MAIN] Free heap: 46456 bytes [MAIN] Free heap: 46456 bytes (just keeps repeating the Free heap.)

    Yes my wifi ssid is “unavailable”. It amuses me.

  33. ZeroSebastian

    Hello! I am using the library with the example sketch of @ Bibi, the board library is v2.3.0 but my Echo Plus still doesnt find the devices. Whenever I seek devices this message is shown in the serial monitor: HTTP/1.1 200 OK CACHE-CONTROL: max-age=86400 DATE: Mon, 22 Jun 2015 17:24:01 GMT EXT: LOCATION: http://10.0.0.77:52000/setup.xml OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01 01-NLS: 444556903D8700 SERVER: Unspecified, UPnP/1.0, Unspecified ST: ssdp:all USN: uuid:Socket-1_0-444556903D8700::upnp:rootdevice X-User-Agent: redsonic

    What am I doing wrong, I even tried different ESP8266 modules. Thanks in advance

  34. federico zanetta

    Hi! I'm trying to get an instructables to work. I'm getting the error you discussed above about the command fauxmo.onMessage, I tried to replace it with fauxmo.onGetstate but I'm getting error too. How can I solve please? here's the code:

    #include <Arduino.h>
    #include <ESP8266WiFi.h>
    #include "fauxmoESP.h"
    #include "ESPAsyncWebServer.h"
    #include <ESPAsyncTCP.h>
    #include <Hash.h>
    
    #define WIFI_SSID "TIM-36312017"
    #define WIFI_PASS "veRyYDXZeaXmstEi"
    #define SERIAL_BAUDRATE                 115200
    
    fauxmoESP fauxmo;
    #define RELAY_PIN 13
    const int  buttonPin = 4;    // the pin that the pushbutton is attached to
    int buttonState = 0;         // current state of the button
    int lastButtonState = 0;     // previous state of the button
    
    // -----------------------------------------------------------------------------
    // Wifi
    // -----------------------------------------------------------------------------
    
    void wifiSetup() {
    
        // Set WIFI module to STA mode
        WiFi.mode(WIFI_STA);
    
        // Connect
        Serial.printf("[WIFI] Connecting to %s ", WIFI_SSID);
        WiFi.begin(WIFI_SSID, WIFI_PASS);
    
        // Wait
        while (WiFi.status() != WL_CONNECTED) {
            Serial.print(".");
            delay(100);
        }
        Serial.println();
    
        // Connected!
        Serial.printf("[WIFI] STATION Mode, SSID: %s, IP address: %s\n", WiFi.SSID().c_str(), WiFi.localIP().toString().c_str());
    }
    
    void callback(uint8_t device_id, const char * device_name, bool state) {
      Serial.print("Device "); Serial.print(device_name); 
      Serial.print(" state: ");
      if (state) {
        Serial.println("ON");
        digitalWrite(RELAY_PIN, HIGH);
      } else {
        Serial.println("OFF");
        digitalWrite(RELAY_PIN, LOW);
      }
    }
    
    void setup() {
        pinMode(RELAY_PIN, OUTPUT);
        pinMode(buttonPin, INPUT_PULLUP);
        digitalWrite(RELAY_PIN, LOW);
        // Init serial port and clean garbage
        Serial.begin(SERIAL_BAUDRATE);
        Serial.println("FauxMo demo sketch");
        Serial.println("After connection, ask Alexa/Echo to 'turn <devicename> on' or 'off'");
    
        // Wifi
        wifiSetup();
    
        // Fauxmo
        fauxmo.addDevice("the light");
        fauxmo.onMessage(callback);
    }
    
    void loop() {
      fauxmo.handle();
    
      // read the pushbutton input pin:
      buttonState = digitalRead(buttonPin);
    
      // compare the buttonState to its previous state
      if (buttonState != lastButtonState) {
        // if the state has changed, increment the counter
        if (buttonState == LOW) {
          Serial.println("on");
          digitalWrite(RELAY_PIN, HIGH);
        }
        else {
          // if the current state is LOW then the button
          // went from on to off:
          Serial.println("off");
          digitalWrite(RELAY_PIN, LOW);
        }
        // Delay a little bit to avoid bouncing
        delay(50);
      }
      // save the current state as the last state,
      //for next time through the loop
      lastButtonState = buttonState;
    }
    
  35. Log in to comment