I guess what I am missing is the ability to respond to errors or just get a better feedback based on the connection status. What I mean is something like this:
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);
});
});
}
});
wlan.on('error', function(e){
console.log('Cannot connect to access point');
console.log('Error: ' + e.message);
});
console.log("Done.");
Otherwise, I have no idea what is going on with my module.
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.
This is what I am getting back from the console:
I guess what I am missing is the ability to respond to errors or just get a better feedback based on the connection status. What I mean is something like this:
Otherwise, I have no idea what is going on with my module.