• Kind of a "quick" project to get comfortable with the ESP32.

    It connects to the wunderground API, and pulls the latest forecast string, and displays across SSD1306 (I also wrote a version with the HD44780 I2C).

    See the code here:
    https://github.com/wga22/esp8266/blob/master/espurino/ESP32_drawforecast.js

    Interesting part of the code is the parsing of the JSON from wunderground. Not my best code, just slopping something together to see how it works. Love the ESP32, has right level of performance for doing real level of work. Hoping ESPRUINO team continues to get it love! A special thanks to the brilliance of the "loadModule" versatility!

    function drawForecast()
    {
    	//getting weather now, so allow another process to get weather
    	setTime.val = "";
    	var ZIP= '22182';
    	HTTP.get((SURLAPI + ZIP + ".json"), function(res) 
    	{
    		res.on('data', function(wunderString) {   drawForecast.val += wunderString;   });
    		res.on('close', function(fLoaded) 
    		{
    			console.log("Connection to wunder closed");
    			drawForecast.obj = JSON.parse( drawForecast.val );
    			drawForecast.val = "";
    			writeStringToLCD(drawForecast.obj.forecast.txt_forecast.forecastday[0].fcttext);
    		});
    		res.on('error', function(e){console.log("error getting wunderground details");});	//TODO: test, and handle by saving values?
    	});
    }
    drawForecast.val = "";
    drawForecast.obj = null;
    

    1 Attachment

    • IMG_20180318_145436.jpg
About

Avatar for Will @Will started