Just tried a board @MaBe supplied with no USB on it, and it works great. You just need to stop the Ap first with stopAP:
var wifi = require("Wifi");
wifi.stopAP()
WIFI_NAME="xx";
WIFI_OPTIONS={password:"xxx"};
function get(url) {
var http = require("http");
http.get(url, function(res) {
res.on('data', function(data) {
console.log(data);
});
});
}
wifi.connect(WIFI_NAME, WIFI_OPTIONS, function(err) {
if (err) {
console.log("Connection error: "+err);
return;
}
console.log("Connected!");
get("http://www.pur3.co.uk/hello.txt");
});
Or once you've done wifi.save() to save the wifi state, the automatic AP won't start.
... but I've now pushed a change which automatically stops the AP if connect is called (on C3) and vice versa, so normal code should work on the C3 now.
assuming you don't have a broken ESP32C3 supermini board
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.
And these two as well, also blaming faulty supermini boards which I was using:
Just tried a board @MaBe supplied with no USB on it, and it works great. You just need to stop the Ap first with stopAP:
Or once you've done
wifi.save()
to save the wifi state, the automatic AP won't start.... but I've now pushed a change which automatically stops the AP if
connect
is called (on C3) and vice versa, so normal code should work on the C3 now.assuming you don't have a broken ESP32C3 supermini board