Avatar for cmo

cmo

Member since Nov 2017 • Last active Nov 2017
  • 2 conversations
  • 4 comments

Most recent activity

    • 7 comments
    • 97 views
  • in Pico / Wifi / Original Espruino
    Avatar for cmo

    Thank you. I agree, I put this in the wrong forum.

  • in Pico / Wifi / Original Espruino
    Avatar for cmo

    Thanks for the reply Gordon. Yes it's for an ESP32 (ESP-WROOM-32) with Espruino build 1v94. Here's the full example where I get an error.

    var http = require('http');
    
    var server=http.createServer(function(req, res){
        res.writeHead(200);
        res.end("Hello World");
        console.log("res sent");
    }).listen(80);
    
    setTimeout(function(){
        server.close();
    },5000);
    

    And the error message I get

    Uncaught Error: Field or method "close" does not already exist, and can't create it on undefined
     at line 1 col 7
    server.close();
          ^
    

    The webserver continues to work before and after the error. I tried this on an ESP8226 and get the same error also.

    Again, any help is very much appreciated.

  • in Pico / Wifi / Original Espruino
    Avatar for cmo

    Hello,

    Is there an event to turn off an http server?

    var server=http.createServer(...)
    

    This doesn't seem to work even though it looks documented (httpSrv class):

    server.close();
    

    Any help is appreciated. Thanks.

  • in ESP32
    Avatar for cmo

    Hello all!

    Is there an event or a way to trigger an event when an ESP32 looses it's wifi connection? I'm referring to the state when it's connected as a station, not a AP.

    I'm looking for something more elegant then polling the wifi to check for an ip or other.

    Thanks for your help.

    • 1 comment
    • 34 views
Actions