Tuesday, 12 September 2017

MeteoLecce (8): added some further informations and improved UI.

Little steps, but I'm glad I got here. I added informations about temperature and humidity for the next three days and improved the alignment of textView in both of the activities.
This is the restult:

MeteoLecce main UI 
MeteoLecce secondary UI 


ESPertino: my new shield to program something about electronics

Today I received by courier a packet containing an electronic card whose name was ESPertino. It is a card for those who have subscribed to the EOS magazine (Elettronica Open Source). The price was good (20€ considerating the characteristic of the card: a WIFI shield. 6€ less than the price of the MKR1000 WIFI:

MKR1000 WIFI
Like a little Arduino but with WIFI chip.
In the same pack I found something else: the magazine (usually online) printed! (Wow! :D)

EOS #37
But after tried to create a full working circuit I have chose to search something more simple on the web. So on the same magazine's page there was the configuration page from scratch:


A page in italian where you can find antything about the first installation (follow every single!) and in the end also the code to try the card working.


void setup() { 
 //Initialize serial and wait for port to open: 
 pinMode(13, OUTPUT);
Serial.begin(115200); 
 Serial.println("Hello ESP32 World!"); 
  
void loop() { 
 digitalWrite(13, HIGH); 
 delay(2000);
 digitalWrite(13, LOW);
 delay(500);

Everything was connected and I started to control and then to build the code...
In the following video and pictures you can see what I abotained: 
  • lightning of the output led;
  • writing something on the serial monitor.







Friday, 8 September 2017

MeteoLecce (7): new source to obtain free Weather Forecast

Navigating up and down the net I found a new source to abtain free weather forecast (OpenWeatherMap is great only for the actual situation, but not for the next days):
metcheck logo.

...and excactly this address:
https://www.metcheck.com/NOLOCATION.asp?LastURL=/OTHER/json_data.asp
Insert your location of interest (as I did):

Hoe to search your location weather informations.

 I received the address to call the service:

JSON URL


http://ws1.metcheck.com/ENGINE/v9_0/json.asp?lat=40.4&lon=18.2&lid=22553

 ...and I received informations in Json format.
Simple and brilliant! 

MeteoLecce (6): To-Do List

I try to make a to-do list for next things I want to insert in the app:


  1. weather forecast for the next 3 days;
  2. possibility to take pictures and send to the official email account;
  3. re-call infos from a remote database (past weather: saving day-by-day actual weather situation);
  4. ...and so on

MeteoLecce (5): how to manage a json array

Extract a parameter from the json array.
Below the json string:

{"coord":{"lon":18.17,"lat":40.36},"weather":[{"id":801,"main":"Clouds","description":"few clouds","icon":"02d"}],"base":"stations","main":{"temp":299.93,"pressure":1013,"humidity":69,"temp_min":299.15,"temp_max":301.15},"visibility":10000,"wind":{"speed":8.7,"deg":120},"clouds":{"all":20},"dt":1504862100,"sys":{"type":1,"id":5749,"message":0.0227,"country":"IT","sunrise":1504844509,"sunset":1504890427},"id":6542124,"name":"Lecce","cod":200}

If I want to obtain the weather "description" I have to use array method on the previous string like this:

Extraction of the weather descprition from the json array.