How the world gets its weather

Preview:

Citation preview

HOW THE WORLDGETS ITS WEATHER

Developer Evangelist @ The Weather

Channel and Weather Underground

@RaaveYadav | ryadav88 on Github

Ravi Yadav

195,000 Personal Weather Stations

2.2 Billion forecast locations | 180 M Consumers /month

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

ARCHITECTURE: STORAGE POLYGLOTARCHITECTURE: STORAGE POLYGLOT

Real time dataand caching

- Historical Weather Data

- Data Migration

Gateway Data

Analytics

Archives

Images

Videos

AnalyticsInformatica

Drupal

PERSONAL WEATHER STATIONPERSONAL WEATHER STATION

www.wunderground.com/weatherstation/whatispws.asp

www.wunderground.com/weatherstation/buyingguide.asp

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

fritzing.org

DEVICE MODES -DEVICE MODES -PHOTONPHOTON

Looking for Internet

Listening Mode OTA Firmware Update

BME 280Multi Sensor

www.wunderground.com

PARTICLE WEB IDEPARTICLE WEB IDE

build.particle.io

#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(){}

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}

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;}

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

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

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

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

To get data for your station:

Recommended