how the world gets its weather

26
HOW THE WORLD GETS ITS WEATHER

Upload: ravi-yadav

Post on 13-Apr-2017

144 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: How the world gets its weather

HOW THE WORLDGETS ITS WEATHER

Page 2: How the world gets its weather

Developer Evangelist @ The Weather

Channel and Weather Underground

@RaaveYadav | ryadav88 on Github

Ravi Yadav

Page 3: How the world gets its weather
Page 4: How the world gets its weather

195,000 Personal Weather Stations

2.2 Billion forecast locations | 180 M Consumers /month

Page 5: How the world gets its weather
Page 6: How the world gets its weather

Uptime: 99.95%Latency ~ 25ms

Global Coverage

(US. East, US. West, EU, Asia)

AutoScale to +20Billion requests

per day

Scalability

Average 10’s of Billions requests per day

Versioned artifacts

and rollbacks

Partial deployments

Logging

Faster code-to-prod:

Less dependency b/w teams

Your favorite tech/language here

Page 7: How the world gets its weather

ARCHITECTURE: STORAGE POLYGLOTARCHITECTURE: STORAGE POLYGLOT

Real time dataand caching

- Historical Weather Data

- Data Migration

Gateway Data

Analytics

Archives

Images

Videos

AnalyticsInformatica

Drupal

Page 8: How the world gets its weather

PERSONAL WEATHER STATIONPERSONAL WEATHER STATION

www.wunderground.com/weatherstation/whatispws.asp

www.wunderground.com/weatherstation/buyingguide.asp

Page 9: How the world gets its weather

WHAT YOU NEEDWHAT YOU NEED

1. Particle Photon

2. BME 280 MultiSensor (temperature, pressure, humidity)

3. USB to Micro cable

4. Prototyping board

5. Wires

Page 10: How the world gets its weather

fritzing.org

Page 11: How the world gets its weather
Page 12: How the world gets its weather

DEVICE MODES -DEVICE MODES -PHOTONPHOTON

Looking for Internet

Listening Mode OTA Firmware Update

Page 13: How the world gets its weather

BME 280Multi Sensor

Page 14: How the world gets its weather
Page 15: How the world gets its weather
Page 16: How the world gets its weather

www.wunderground.com

Page 17: How the world gets its weather
Page 18: How the world gets its weather
Page 19: How the world gets its weather

PARTICLE WEB IDEPARTICLE WEB IDE

build.particle.io

Page 20: How the world gets its weather

#include "SparkFunBME280/SparkFunBME280.h"

//Global sensor objectBME280 mySensor;

float humidity = 999;float tempF = 999;float pascals = 999;float inches = 999;

char SERVER[] = "rtupdate.wunderground.com"; char WEBPAGE [] = "GET /weatherstation/updateweatherstation.php?";

//Station Identificationchar ID [] = "KCASANFR741"; //Your station ID herechar PASSWORD [] = "xxxxxxxx"; //your Weather Underground password here

TCPClient client;

void setup(){}

void loop(){}

Page 21: How the world gets its weather

void setup(){ //***Driver settings********************************// mySensor.settings.commInterface = I2C_MODE; mySensor.settings.I2CAddress = 0x76;

//***Operation settings*****************************// mySensor.settings.runMode = 3; //Normal mode

mySensor.settings.tStandby = 0; mySensor.settings.filter = 4;

//OverSample can be: 0, skipped - 1 through 5 mySensor.settings.tempOverSample = 5; mySensor.settings.pressOverSample = 5; mySensor.settings.humidOverSample = 5;

Serial.begin(57600); Serial.print("Program Started\n"); delay(10); //Make sure sensor had enough time to turn on. //BME280 requires 2ms to start up. mySensor.begin(); //Calling .begin() causes the settings to be loaded}

Page 22: How the world gets its weather

void loop() {tempF = mySensor.readTempF();humidity = mySensor.readFloatHumidity();pascals = mySensor.readFloatPressure();inches = pascals * 0.0002953; // Calc for converting Pa to inHg (Wunderground expects inHg)}

Serial.println("connecting...");

if (client.connect(SERVER, 80)) {Serial.println("Connected");client.print(WEBPAGE);client.print("ID=");client.print(ID);client.print("&PASSWORD=");client.print(PASSWORD);client.print("&dateutc=now"); //can use 'now' instead of time if sending in real timeclient.print("&tempf=");client.print(tempF);client.print("&humidity=");client.print(humidity);client.print("&baromin=");client.print(inches);//for sending multiple times per minute, specify frequency in secondsclient.print("&softwaretype=Particle-Photon&action=updateraw&realtime=1&rtfreq=5"); client.println();Serial.println("Upload complete");delay(200); // Without the delay it is unreliable}else{ Serial.println(F("Connection failed")); return;}

Page 23: How the world gets its weather

https://github.com/ryadav88/photon-weather-demo

Page 24: How the world gets its weather
Page 25: How the world gets its weather

www.wunderground.com/personal-weather-station/dashboard?ID=YourId

Page 26: How the world gets its weather

api.wunderground.com/api/APIKey/conditions/q/pws:KCASANFR741.json

Register for the API:api.wunderground.com/api

To get data for your station: