Skip to content

About

Yet another OpenWeather App for UNO R4 WiFi and ESP32

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

ArduinoOpenWeather

What is this?

OpenWeather for UNO R4 WiFi

This is yet another OpenWeather App for UNO R4 WiFi and ESP32.

Inspired by the cool screen design of OpenWeahter by Bodmer, the creator of TFT_eSPI, I migrated it for my UNO R4 WiFi.

Software Requirements

Libraries

UNO R4 WiFi

Package Version
Platform / Board Arduino UNO R4 Boards by Arduino 1.6.0
NTP Client NTPClient 3.2.1
HTTP Client (experimental) ArduinoHttpClient 0.6.1

ESP32

Package Version
Board Platform esp32 by Espressif Systems 3.3.12

Software Configuration

  1. Open config.h and configure the following:

    Item Configuration Parameters
    OpenWeather API LANGUAGE, LATITUDE and LONGITUDE
    Timezone NTP_TIMEZONE_OFFSET (UNO R4 WiFi) or NTP_TIMEZONE_STRING (ESP32)
  2. Create your secrets.h for WiFi credential and OpenWeather API key:

    #define SECRET_SSID "***** Your SSID *****"
    #define SECRET_PASS "***** Your password *****"
    #define API_KEY     "***** your OpenWeather key *****"
  3. Open rtcntp.cpp and configure nearby NTP servers:

    static const char *ntpServers[] = {
      "ntp.nict.jp",
      "ntp.jst.mfeed.ad.jp",
      "pool.ntp.org",
      "time.google.com",
      //"europe.pool.ntp.org",
      //"time.cloudflare.com",
      //"time.aws.com",
    };
  4. Open gfx.cpp and check and modify the LCD driver IC number to suit your device:

    //-------------------------------------------------------------------------------------
    // Configuration
    // 93410 and 77890 are for MCUFRIEND-type LCDs.
    //-------------------------------------------------------------------------------------
    #define USE_TFT_DRIVER  9341  // Select Driver : 9341[0], 7789[0], 9486, 7796
    #define USE_OPERATION   2     // Init operation: type 1 (default) or type 2 (variant)

ILI9341 for CYD and UNO R4 WiFi

  1. Open gfx_config.hpp and check and modify the GPIO pin assignment to suit your device:

    //-------------------------------------------------------------------------------------
    // SPI GPIO pin assignment
    //-------------------------------------------------------------------------------------
    #if defined(ARDUINO_ARCH_RENESAS_UNO) || defined(ARDUINO_ARCH_AVR)
      // Arduino UNO R4 WiFi
      // https://github.com/arduino/ArduinoCore-renesas/blob/main/variants/UNOWIFIR4/pins_arduino.h
      // TFT_RST and TFT_DC should be configured based on your wiring
      #define TFT_RST       8         // D8
      #define TFT_DC        9         // D9
      #define TFT_CS        10        // CS
      #define TFT_MOSI      MOSI      // 11
      #define TFT_MISO      MISO      // 12
      #define TFT_SCLK      SCK       // 13
      #define TFT_BL        -1        // Connect directly to 3.3V
      #define SPI_FREQUENCY 24000000  // RA4M1: 24MHz, SPI: 12MHz
    
    #else  // ESP32
      // ESP32-2432S028R (CYD)
      // https://github.com/espressif/arduino-esp32/blob/master/variants/jczn_2432s028r/pins_arduino.h
      #define TFT_RST       -1
      #define TFT_DC        2
      #define TFT_MISO      12
      #define TFT_MOSI      13
      #define TFT_SCLK      14
      #define TFT_CS        15
      #define TFT_BL        21
      #define SPI_FREQUENCY 80000000  // ILI9341 for ESP32 (40MHz or 80MHz)
    #endif

ToDo List

  • Fix the day of the week from 21:00 through midnight.
  • Display progress on the opening splash screen.
  • Make weather icons multi-colorizing.
  • Make lunar phase images reverse for the Northern and Southern Hemispheres.
  • Verify Daylight Saving Time by timezone returned from OpenWeather.
  • Supress debug printing to the Serial Monitor.

Acknowledgement

Icon Fonts

I would like to express my gratitude to the creators of these cool icon fonts:

About

Yet another OpenWeather App for UNO R4 WiFi and ESP32

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages