Avatar for Filip

Filip

Member since Jun 2016 • Last active Jun 2016
  • 2 conversations
  • 9 comments

Most recent activity

  • in ESP8266
    Avatar for Filip

    The following is my output. It still does not work despite the fact that I'm connected to different router right now. Obviously there is bug somewhere, which is very discouraging

    >var ESP8266=require("ESP8266");
    =function () { [native code] }
    >var Wifi = require("Wifi")
    =function () { [native code] }
    >Wifi.getIP();
    ={
      "ip": "192.168.2.203",
      "netmask": "255.255.255.0",
      "gw": "192.168.2.1",
      "mac": "5c:cf:7f:80:0c:86"
     }
    >ESP8266.setLog(2);
    =undefined
    > 60000> Thu Jan 01 00:01:00 1970, heap: 10600
    ESP8266.ping("192.168.2.1", function(e){ console.log(e);});
    =undefined
    >111956> Received a ping response!
    { "totalCount": 0, "totalBytes": 0, "totalTime": 0, "respTime": 0,
      "seqNo": 0, "timeoutCount": 0, "bytes": 0, "error": -1 }
    >113081> Received a ping response!
    { "totalCount": 0, "totalBytes": 0, "totalTime": 0, "respTime": 0,
      "seqNo": 0, "timeoutCount": 0, "bytes": 0, "error": -1 }
    >114256> Received a ping response!
    { "totalCount": 0, "totalBytes": 0, "totalTime": 0, "respTime": 0,
      "seqNo": 0, "timeoutCount": 0, "bytes": 0, "error": -1 }
    >115406> Received a ping response!
    { "totalCount": 0, "totalBytes": 0, "totalTime": 0, "respTime": 0,
      "seqNo": 0, "timeoutCount": 0, "bytes": 0, "error": -1 }
    >116531> Received a ping response!
    116532> ping 5, timeout 5, total payload 0 bytes, 5703 ms 
    { "totalCount": 0, "totalBytes": 0, "totalTime": 0, "respTime": 0,
      "seqNo": 0, "timeoutCount": 0, "bytes": 0, "error": -1 }
    >120000> Thu Jan 01 00:02:00 1970, heap: 10600
    
  • in ESP8266
    Avatar for Filip

    yes I'm connected to wifi see the require("Wifi").getIP() result below. I'm able to ping to my board from my PC but not the other way around.

    { "ip": "192.168.1.29", "netmask": "255.255.255.0", "gw": "192.168.1.1", "mac": "5c:cf:7f:80:0c:86"
     }
    
  • in ESP8266
    Avatar for Filip

    Hi All,
    I'm simply trying to send a ping request to my router with ESP8266.ping function, my callback gets called but the result is always negative as if my router is not alive but it is. I have the latest nodeMCU board with espruino 1v85. Any idea?

    The code I'm running :

    var ESP8266=require("ESP8266");
    
    ESP8266.ping("192.168.1.1", function(e){
    
      console.log(e);
    
    });
    

    and the result :

    { "totalCount": 0, "totalBytes": 0, "totalTime": 0, "respTime": 0, 
      "seqNo": 0, "timeoutCount": 0, "bytes": 0, "error": -1 }
    
  • in General
    Avatar for Filip

    @DrAzzy thanks for the tip it has worked when I called the pinMode beforehand.

    Hi @Gordon, it seems also newer versions need pinMode call because I have a nodeMCU ESP-12E with espruino_1v85

  • in General
    Avatar for Filip

    hi @allObjects , thanks for your quick response and recommendations. I just want to clarify two things.

    1. The code below runs perfectly, but it does not run in the form I described above.

      var toggle=1;
      setInterval(function() {
      toggle=!toggle;
      digitalWrite(D5, toggle);
        
      console.log(toggle);
      }, 1000);
      
    2. As you assumed, I write my code in the right pane and upload it. Then I say save() in the left pane. I can see onInit() gets called and the console logs true, false.... I mean everything works as expected except digitalWrite()

  • in General
    Avatar for Filip

    The following code seems valid but the led is not blinking. The console output is correct. It is as if digitalWrite is not working.
    When I run the code without save() and onInit() functions, inside simple setInterval the led is blinking. Any iade?

    var toggle=1;
    
    
    function start(){
      
    setInterval(function() {
      toggle=!toggle;
      digitalWrite(D5, toggle);
      
      console.log(toggle);
    }, 1000);
    
    }
    
    function onInit() {
      start();
    }
    
  • in ESP8266
    Avatar for Filip

    I tried the baud rate 57600 unfortunately with no success :( In the meantime; I played with arduino IDE and everything is working. I do not really understand why I can't get Espruino worked, which is a little bit discouraging...
    BTW; when I try to connect, web IDE is giving the following messages. Does it ring a bell?

    >>> Connecting...
    Set Slow Write = true
    Unable to open device (connectionInfo=undefined)
    ERROR: Unable to open device (connectionInfo=undefined)
    >>> Connection Failed.
    

    Update :
    I have solved my problem. It seems Web IDE needs some special authorizations when it is working under linux. I can't still make it connect to the port but it works via TCP port. I followed the tutorial here .

    • 5 comments
    • 3,638 views
  • in ESP8266
    Avatar for Filip

    I have already done what you said couple of times but still IDE shows me an error saying "connection failed!"

Actions