require("CC3000") itself returning a blank function is expected. When you run the code from http://www.espruino.com/CC3000 nothing gets printed until the result is received... Try:
console.log("Initialising CC3000");
var wlan = require("CC3000").connect();
console.log("Connecting...");
wlan.connect( "AccessPointName", "WPA2key", function (s) {
console.log(s);
if (s=="dhcp") {
require("http").get("http://www.pur3.co.uk/hello.txt", function(res) {
res.on('data', function(data) {
console.log(">" + data);
});
});
}
});
console.log("Done.");
And see what happens. It's possible that your Access Point's name or key isn't being recognized.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
require("CC3000")
itself returning a blank function is expected. When you run the code from http://www.espruino.com/CC3000 nothing gets printed until the result is received... Try:And see what happens. It's possible that your Access Point's name or key isn't being recognized.