Did the thing mentioned last in previous post: tried with firmware 1v59 and 1v60,... no success... but did not give up yet, flashed back (to present) 1v71 and run it again: guess what: it made it through! My fruit needed obviously some time to really wake up and get whipped into working mood... ;)
This is the code I'm using:
var SSID = "MyNetworkId";
var WPA2Key = "MyWPA2Key";
var log = function(s,e) {
console.log(((e) ? "E: " : "-: ") +
(Math.round((getTime() * 1000)) / 1000) + ": " +
s
);
};
log("Connecting to CC3000...");
var wlan = require("CC3000").connect();
if (wlan) {
log("Connecting to wifi access point...");
wlan.connect( SSID, WPA2Key, function (s) {
log("Connected with " + s);
if (s == "dhcp") {
require("http").get("http://www.pur3.co.uk/hello.txt", function(res) {
res.on('data', function(data) {
log(">" + data);
});
});
}
});
} else {
log("Did not get wlan object / not connected to CC3000.",1);
}
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.
Did the thing mentioned last in previous post: tried with firmware 1v59 and 1v60,... no success... but did not give up yet, flashed back (to present) 1v71 and run it again: guess what: it made it through! My fruit needed obviously some time to really wake up and get whipped into working mood... ;)
This is the code I'm using:
And this is the console output:
Interesting is that the callback is obviously called multiple times:
Now moving on to receive realtime online departure train info... see the cool thread of @russdx at Is Espruino right for my project?
...what a rhetorical question for an Espruino fan... ;) --- I have a very good hammer - you got nails?