vintlabs / fauxmoESP

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

Doesn't show up in WeMo app #22

Closed pvint closed 5 years ago

pvint commented 7 years ago

Original report by Kevin Ghadyani (Bitbucket: Sawtaytoes, GitHub: Sawtaytoes).


Hi! The FauxMo ESP8266 module doesn't show up in the WeMo app on my Android phone. I'm assuming this is because it's not truly emulating a WeMo device.

I use a wemo-client Node.js library to control WeMo devices using Flic buttons and HTTP requests which is why I need some way to find these custom devices on the network using the standard WeMo protocols.

Is it possible to add full WeMo emulation such that I would be able to see these ESP8266 devices when searching for available WeMo devices on the network?

pvint commented 7 years ago

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


I'm testing some changes in the library in the dev branch to make it compatible with some third party "wemo" clients like wemo-client (https://github.com/timonreinhard/wemo-client) and ouimeaux (https://github.com/syphoxy/ouimeaux). Maybe you can give it a try. Still cannot make it work with the official app :(

pvint commented 7 years ago

Original comment by Kevin Ghadyani (Bitbucket: Sawtaytoes, GitHub: Sawtaytoes).


Thanks! That'll allow writing custom software to control devices outside of the local network!

pvint commented 7 years ago

Original comment by Kevin Ghadyani (Bitbucket: Sawtaytoes, GitHub: Sawtaytoes).


After converting my Lua to C, I was able to pull the latest from dev and got it working. It showed up among my other official WeMo devices in the Node.js wemo-client!

pvint commented 7 years ago

Original comment by Kevin Ghadyani (Bitbucket: Sawtaytoes, GitHub: Sawtaytoes).


While the device shows up, it isn't able to be controlled via wemo-client. BinaryState isn't coming back so setting the device to a specific value isn't working.

TypeError: Cannot read property 'BinaryState' of undefined
    at D:\Projects\Personal\WeMo-Controller\node_modules\wemo-client\client.js:230:18
pvint commented 7 years ago

Original comment by Kevin Ghadyani (Bitbucket: Sawtaytoes, GitHub: Sawtaytoes).


After more research, the difference in services provided by fauxmoESP vs an official WeMo device are the services provided:

  services:                                                
   { 'urn:Belkin:service:WiFiSetup:1': [Object],           
     'urn:Belkin:service:timesync:1': [Object],            
     'urn:Belkin:service:basicevent:1': [Object],          
     'urn:Belkin:service:firmwareupdate:1': [Object],      
     'urn:Belkin:service:rules:1': [Object],               
     'urn:Belkin:service:metainfo:1': [Object],            
     'urn:Belkin:service:remoteaccess:1': [Object],        
     'urn:Belkin:service:deviceinfo:1': [Object],          
     'urn:Belkin:service:smartsetup:1': [Object],          
     'urn:Belkin:service:manufacture:1': [Object] } },     

    services:
   { 'urn:Belkin:service:basicevent:1': [Object],
     'urn:Belkin:service:metainfo:1': [Object] } } }

I wonder if the missing one is deviceinfo; although, based on the log messages, it may be something different.


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

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

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


Can you share the code you are using with wemo-client. It works for me with this code (simple blink):

#!javascript
var Wemo = require('wemo-client');
var wemo = new Wemo();

wemo.discover(function(err, deviceInfo) {

  console.log('Wemo Device Found: %j', deviceInfo);

  // Get the client for the found device
  var client = wemo.client(deviceInfo);

  // Blink the lights
  var state = 1;
  var interval = setInterval(function() {
      console.log("State = " + state)
      client.setBinaryState(state);
      state = 1-state;
  }, 1000);

});

On the ESP8266 I have the default example, blinking the built in LED.

pvint commented 7 years ago

Original comment by Kevin Ghadyani (Bitbucket: Sawtaytoes, GitHub: Sawtaytoes).


The code I'm using is located here: https://github.com/Sawtaytoes/WeMo-Controller/tree/develop

pvint commented 7 years ago

Original comment by Houba 28 (Bitbucket: houba28, GitHub: houba28).


Hi, wanted to follow this and use dev branch, but it seems that after downloading a zip, including in Arduino IDE as zip repo and uploading the script to ESP it wont connect to wifi... Does anybody have the same problem? tried to remove imported folder and reimport old one... does not fix anything also tried second esp I got here, seems to be a problem of the first board

pvint commented 5 years ago

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


Closing since this no longer applies to v3