Hi - thank you for any help you might provide. Dev board is running other code, so I pulled this from notes, not a working board.
const SURLAPI = 'https://i66toll.firebaseio.com/eb/belt/washington/tolls.json?orderBy=%22$key%22&limitToLast=1'; const HTTP = require("http"); //ESP32.enableBLE(false); function onInit() { //console.log("main"); //loadTolls(); } var options = { host: 'i66toll.firebaseio.com', // host name port: 443, // (optional) port, defaults to 80 path: '/eb/belt/washington/tolls.json', // path sent to server method: 'GET', // HTTP command sent to server (must be uppercase 'GET', 'POST', etc) protocol: 'https:', // optional protocol - https: or http: headers: { orderBy : "%22$key%22", limitToLast : 1 } // (optional) HTTP headers }; function loadTolls() { //getting weather now, so allow another process to get weather HTTP.get(options, function(res) { res.on('data', function(wunderString) { loadTolls.val = wunderString; console.log(wunderString); memUsage(); }); res.on('close', function(fLoaded) { memUsage(); }); res.on('error', function(e){console.log("error getting URL details");}); //TODO: test, and handle by saving values? }); } function memUsage() { console.log(process.memory().usage); }
@Will 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.
Hi - thank you for any help you might provide. Dev board is running other code, so I pulled this from notes, not a working board.