Go Down

Topic: is there a simple sketch for weather underground? (Read 2488 times) previous topic - next topic

dgncsk

i have nodemcu for wether station. i added a BME280 sensor to read temp and pressure. i also integrated an i2c oled screen and this can work locally. it reads values and prints on OLED screen.

i checked and read lots of projects which involve DHT sensors to read values and uploads to weather undergorund.

i need a very basic code to upload realtime values i get from my sensor.

is there a such basic tutorial and a code to enter wunderground personal weather station id and password and wifi name and password?

here is working code to read temp and pressure if needed.

Code: [Select]

#include <Adafruit_BMP085.h>
Adafruit_BMP085 bmp;

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET LED_BUILTIN  //4
Adafruit_SSD1306 display(OLED_RESET);

#if (SSD1306_LCDHEIGHT != 32)
#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif

void setup()
{
  Serial.begin(57600);
  //Wire.begin (4, 5);
  if (!bmp.begin())
  {
    Serial.println("Could not find BMP180 or BMP085 sensor at 0x77");
    while (1) {}
  }
  //vvvvvvvvv

  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);

  // Clear the buffer.
  display.clearDisplay();
  display.display();
}
void loop()
{
  display.setTextSize(2);
  display.setTextColor(WHITE);
  // Clear the buffer.
  display.clearDisplay();

  display.setCursor(0, 0);
  display.print("T: ");
  display.print(bmp.readTemperature());
  display.print(" C");
  display.print("P: ");
  display.print((bmp.readPressure()) / 100);
  display.print(" mb");
  display.display();

  delay(5000);
}



rw950431

A quick google using the terms "arduino weather underground" gives

https://create.arduino.cc/projecthub/Dan/arduino-weather-station-4ed7a7

https://apicommunity.wunderground.com/weatherapi/topics/display-weather-on-small-lcd-using-an-esp8266-arduino

Amongst many others.

dgncsk

i saw these. first one is for spark funs's weather shield. i need wemos specific codes. all i found is to obtain data form wundergorund not to upload it to it like the second link. most of workign projects are uploading values to thingspeak.com.

i am new to wemos and wifi on arduino,that is why need help.

wildbill

#3
Jul 01, 2017, 03:00 pm Last Edit: Jul 01, 2017, 03:01 pm by wildbill
Start with getting your wifi working. Does the sketch here help with that?

rw950431

Wemos is a generic ESP8266 board so just about all ESP code will run without modification.

dgncsk

is that normal to upload sketches veeeery slowly on wemos? on arduino nano it is a matter of seconds for blink code. but on wemos it is dead slow.


Start with getting your wifi working. Does the sketch here help with that?
i will do so.

rw950431

Its usually quite slow to compile (the arduino layer is a wrapper around the Expressif ESP8266 SDK so the executable is much larger) although the actual upload is normally only a few seconds.
 

dgncsk

today i received d-duino from aliexpress (integrated oled on it). it is may be 10 times faster than normal wemos board.

Tayethin

I finally found one that works very well. I have my weather station up and running now but it's only using an esp8266 and a BME280 sensor.

Uploads to Wunderground every 10 minutes. msg me if you want the code and I'll email it to you for free.

Go Up