• The conversation is moved from here http://forum.espruino.com/conversations/­293517/

    I know how to integrate Espruino with Amazon Alexa (using existent Belkin smart-device protocol). It will be a huge advance for Espruino as a common smart-device platform.

    For that main part is UDP support because Alexa is making "device discovering" by sending UDP package and waint UDP answer with device specific details.

    Espruino latest builds have UDP support built in.
    To test it there are 3 scripts impelemented.
    https://github.com/espruino/Espruino/blo­b/master/tests/test_dgram_socket.js
    https://github.com/espruino/Espruino/blo­b/master/tests/test_dgram_multi.js
    https://github.com/espruino/Espruino/blo­b/master/tests/test_dgram_reuseAddr.js

    I've finally tried the master build today. Unfortunatelly it does not work when Espruino flashed directly on ESP8266 board.
    Notes: I m sure using correct cutting edge build http://www.espruino.com/binaries/travis/­master/.
    Because when used the official v1.94, the command "require('dgram')" was just failing, now it works.

    I tried 3 tests and nothing worked. Please help with traicing the cause.

    *** 1. test_dgram_reuseAddr.js - error returned
    Flash map 4MB:512/512, manuf 0xc8 chip 0x4014

    Uncaught InternalError: Unable to create socket
    at line 1 col 15
    srv2.bind(port);
    =undefined

    *** 2. test_dgram_socket.js - nothing returned (expected msg on send and receive)
    Flash map 4MB:512/512, manuf 0xc8 chip 0x4014

    =undefined
    server disconnected
    client disconnected

    Notes: I ve tested some extra msg-logs and removed srv.close and client.close.... IMHO, still seams that network.c fails and returns into networkGetFromVarIfOnline();

    *** 3. test_dgram_multi.js - nothing returned (expected msg on send and receive)
    Flash map 4MB:512/512, manuf 0xc8 chip 0x4014

    =undefined
    server 1 disconnected
    server 2 disconnected
    =undefined

    Notes: also very strange that msg "server 1/2 disconnected" received but msg "client disconnected" is not received

    p.s. I've tried to get connected to wifi at first, changed client.send(.... IP) to 127.0.0.1 and also to the wifi real IP after ESP is connected. Nothing changed. Would love to debug but do not know how.

About

Avatar for Vasily @Vasily started