I just tested something else and noticed, that it works if i wrap all the wifi code in a function like this:
var wlan; function init(){ wlan = require("CC3000").connect(); wlan.connect( "AccessPointName", "WPA2key", function (s) { if (s=="dhcp") { require("http").get("http://www.pur3.co.uk/hello.txt", function(res) { res.on('data', function(data) { console.log(">" + data); }); }); } }); } init();
It would be good if this gets reflected in the CC3000 manual.
@dervondenbergen started
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.
I just tested something else and noticed, that it works if i wrap all the wifi code in a function like this:
It would be good if this gets reflected in the CC3000 manual.