• @Vasily,
    Till the time @PaddeK receives his Echo Dot, I will test the code on my dot.
    So here are the details of error that I was talking about.

    Firmware flashed : From here "espruino_1v94_esp8266_4mb.tgz"

    Test 1: I first tried file with name "alexa_ok4done.js" from your attachment.

                         Got a warning popup - Module dgram not found. But compiles without any issue.
                         Result: Error in device discovery. So I fixed the code 
    
     msg += "USN: uuid:Socket-1_0-"+getSerialNumber()+"::urn:Belkin:device:**\r\n";
    

    Test 2: I have modified the code and now device is discovered. But when I tried to turn it on/off using Alexa app.

    onPageRequest
    ******************************************************
    Header
    Req ( POST  req.url=  /upnp/control/basicevent1
    Req=
    httpSRs {  }
    Post length=
    Post url=
    {
      "method": "GET",
      "host": "",
      "path": "/upnp/control/basicevent1",
      "pathname": "/upnp/control/basicevent1",
      "search": null, "port": null, "query": null }
    ******************************************************
    Post (/upnp/control/basicevent1) received, start special handling doPost_handleUpnpControl
    pdata.length == length67 / 299
    pdata.length == length299 / 299
    ERROR: Error processing Serial data handler - removing it.
    Execution Interrupted during event processing.
    at line 340 col 31
          pinf("pdata == " + pdata);
                                  ^
    in function called from system
    New interpreter error: CALLBACK,MEMORY
    onPageRequest
    ******************************************************
    Header
    Req ( POST  req.url=  /upnp/control/basicevent1
    Req=
    httpSRs {  }
    Post length=
    Post url=
    {
      "method": "GET",
      "host": "",
      "path": "/upnp/control/basicevent1",
      "pathname": "/upnp/control/basicevent1",
      "search": null, "port": null, "query": null }
    ******************************************************
    Post (/upnp/control/basicevent1) received, start special handling doPost_handleUpnpControl
    Uncaught SyntaxError: Got return expected '}'
    at line 415 col 4
      });
       ^
    in function "doPost_handleUpnpControl" called from line 170 col 41
            doPost_handleUpnpControl(req,res);
                                            ^
     at line 171 col 9
            break;
            ^
    in function called from system
    server.on UDP message received
    ---
    

    And via Alexa Ask

    onPageRequest
    ******************************************************
    Header
    Req ( POST  req.url=  /upnp/control/basicevent1
    Req=
    httpSRs {  }
    Post length=
    Post url=
    {
      "method": "GET",
      "host": "",
      "path": "/upnp/control/basicevent1",
      "pathname": "/upnp/control/basicevent1",
      "search": null, "port": null, "query": null }
    ******************************************************
    Post (/upnp/control/basicevent1) received, start special handling doPost_handleUpnpControl
    pdata.length == length366 / 299
    ERROR: Error processing Serial data handler - removing it.
    Execution Interrupted during event processing.
    at line 336 col 66
    ...ata.length + " / " + length);
    

    I will try @PaddeK module share the results.
    EDIT: Just tried the Alexa module. It is not working. I gave saved the alexa.js in my local disk in SandBox folder. My other modules are loaded from the same location, so seems there is no issue with loading of the module from disk.

     _____                 _
    |   __|___ ___ ___ _ _|_|___ ___
    |   __|_ -| . |  _| | | |   | . |
    |_____|___|  _|_| |___|_|_|_|___|
              |_| http://espruino.com
     1v94 Copyright 2017 G.Williams
    Espruino is Open Source. Our work is supported
    only by sales of official boards and donations:
    http://espruino.com/Donate
    Flash map 4MB:512/512, manuf 0xe0 chip 0x4016
    >Uncaught SyntaxError: Got UNFINISHED STRING expected EOF
     at line 1 col 27
    Modules.addCached("alexa","'use strict';\n\nconst\n    Defau...
                              ^
    New interpreter error: LOW_MEMORY,MEMORY
    Uncaught Error: Module "alexa" not found
     at line 1 col 28
    var alexa = require('alexa');
                               ^
    =undefined
    

    1 Attachment

About

Avatar for Abhigkar @Abhigkar started