10

I'm trying to control an ESP8266 using fauxmo. The programme compiles correctly, but when I run the Alexa app to find devices the ESP doesn't show up.

The ESP is definitely connected to my home network, and the programme is running (I've checked the serial output). Also other networked devices, like my Nest thermostat are showing up.

Any ideas as why it might not be showing up, greatly appreciated.

Here's the code on my wemos d1 mini

#include <Arduino.h>
#include <ESP8266WiFi.h>
#include "fauxmoESP.h"

#define WIFI_SSID "..."
#define WIFI_PASS "..."
#define SERIAL_BAUDRATE                 115200

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 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");
  } else {
    Serial.println("OFF");
  }
}

void setup() {
    // 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("relay");
    fauxmo.addDevice("pixels");
    fauxmo.onMessage(callback);
}

void loop() {
  fauxmo.handle();
}
  • 1
    Your code looks fine. Is UPnP enabled on your router? – Optinaut Jul 24 '17 at 18:26
  • 2
    Start from OSI stack, are they using the same Frequency? Protocol 802.11 a b g n ? I mean, start bottom up from the OSI stack to troubleshoot – Snake Sanders Jul 25 '17 at 11:07
  • 1
    I'm using Alexa on Fire TV stick, not Echo. Could that be the problem? – llewmihs Jul 25 '17 at 11:24
  • 1
    Is the Fire TV in same wifi network as your esp? – mico Jul 25 '17 at 17:33
4

So I found a solution to the problem.

I was originally going to connect the Fire TV stick Alexa to the esp. I bit the bullet and bought an Echo dot.

Problem solved.

Fauxmo in its current state doesn't seem to work with Fire TV.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.