• @DrAzzy,
    This is good ... so let's follow this through ... and thanks for the names of wiznet and cc3k, I didn't know where to start. If we look here: http://www.espruino.com/WIZnet

    We find a bootstrapping of:

    var eth = require("WIZnet").connect();
    

    Now ... for an ESP8266 (or a board with native WiFi), I would not imagine we need to require a module ... I would imagine it would "just be present". So I'm imagining an object called "WIFI" being already present in the JS context.

    So where in the example for WIZnet we next do things like "eth.getIP()" we might do things like "WIFI.getIP()".

    Looking at the CC3000 this looks close to a WiFi story. See:
    http://www.espruino.com/CC3000

    there we have

    var wlan = require("CC3000").connect();
    

    and I imagine that the ESP8266 WIFI object would be a predefined instance of something like that.

    But then we get into interesting notions such as the ESP8266 not only being able to be a station ... but also be able to be an access point that other WiFi stations can connect to.

    ... and all of a sudden ... we start entering the world of "architecture" and "specifications". What I would like to avoid is the notion that ESP8266 does it one way, CC3000 does it another way and un-named devices yet to come do it other ways. Ideally we define the capabilities of an abstract WiFi device and then define the functions on a representative class such that a concrete implementation can "just be" dropped in... where boards such as the ESP8266 already have concrete implementations already present for use without any require() statements.

    And this is where we as a community and project owners need to come together and put our heads together. I think progress on ESP8266 networking will have to be suspended until we can figure this one out as the decisions made here will reverberate down the line. Ive internally tested WiFi and TCP/IP working concurrently on the ESP8266 with Espruino and no issues ... so we are literally at the stage now of deciding how to externalize for consumption.

    Neil

About

Avatar for Kolban @Kolban started