Tried with that build on the pixl and just updating the url to https but it still seems to be making the request over http, this is my code, do I need to do something else?
digitalWrite(D12,1); // enable ESP8266
Serial1.setup(115200, { rx: D2, tx : D3 });
var wifi = require("ESP8266WiFi_0v25").connect(Serial1, function(err) {
if (err) throw err;
console.log("Connecting to WiFi");
wifi.connect(SSID, PASSWORD, function(err) {
if (err) throw err;
console.log("WiFi Connected");
getCharge();
});
});
function getCharge(){
var http = require("http");
http.get("https://192.168.1.127/api/system_status/soe", function(res) {
var contents = "";
res.on('data', function(data) { contents += data; });
res.on('close', function() {
var d = JSON.parse(contents);
var charge = Math.round(d.percentage);
g.clear();
// Use the small font for a title
g.setFontBitmap();
g.drawString("Charge:");
// Use a large font for the value itself
g.setFontVector(40);
g.drawString(`${charge}%`, (g.getWidth()-g.stringWidth(`${charge}%`))/2,10);
// Update the screen
g.flip();
});
});
}
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.
Tried with that build on the pixl and just updating the url to https but it still seems to be making the request over http, this is my code, do I need to do something else?