The 3-Day Weather Forecast Feed provides a comprehensive 3-day weather forecast in your desired location or based on the location of your IP address. The project uses the Wunderground Weather API service that provides JSON format responses whenever you provide a GET request. The weather forecast includes the forecast for the day it was requested and the succeeding 3 days.
To be able to autonomously request and update the weather forecast, we added an NTP time requesting function that uses UDP connection. The time information that was requested is used internally by the code to automatically perform a time request every hour. Then, based on the hour information, the project automatically request for a weather update every 6AM, 12PM, and 6PM.
How it Works- 10 Way Flat Flex Cable
- uSD Card
- uUSB Cable
- External Power Supply
- First, open the Arduino IDE, then go to the “File” tab, select “Preferences”
- On the text box, “Additional Boards Manager URLs:”, paste this line and hit the “OK” button:
http://arduino.esp8266.com/stable/package_esp8266com_index.json
- Then, on the “Tools” tab, under the “Board” drop-down menu, open the “Board Manager”. After loading, scroll down and look for the “esp8266 by ESP8266 Community” board installer, remember to install the latest version.
- Manual modifications to add the esp8266 boards are required since the stable Arduino build does not include changes since mid-2016. First, navigate to this location on your desktop PC, and open the file “boards.txt using an application such as Notepad++ or Wordpad (Notepad is not recommended):
C:\Users\[YOUR USERNAME]\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0”
- At the end of the file, copy and paste the following text by starting a new line:
############################################################ gen4iod.name=4D Systems gen4 IoD Range gen4iod.upload.tool=esptool gen4iod.upload.speed=921600 gen4iod.upload.resetmethod=nodemcu gen4iod.upload.maximum_size=434160 gen4iod.upload.maximum_data_size=81920 gen4iod.upload.wait_for_upload_port=true gen4iod.serial.disableDTR=true gen4iod.serial.disableRTS=true gen4iod.build.mcu=esp8266 gen4iod.build.f_cpu=80000000L gen4iod.build.board=GEN4_IOD gen4iod.build.core=esp8266 gen4iod.build.variant=generic gen4iod.build.flash_mode=dio # flash chip: AT25SF041 (512 kbyte, 4Mbit) gen4iod.build.flash_size=512K gen4iod.build.flash_ld=eagle.flash.512k0.ld gen4iod.build.flash_freq=40 gen4iod.build.debug_port= gen4iod.build.debug_level= gen4iod.menu.CpuFrequency.80=80 MHz gen4iod.menu.CpuFrequency.80.build.f_cpu=80000000L gen4iod.menu.CpuFrequency.160=160 MHz gen4iod.menu.CpuFrequency.160.build.f_cpu=160000000L gen4iod.menu.UploadSpeed.115200=115200 gen4iod.menu.UploadSpeed.115200.upload.speed=115200 gen4iod.menu.UploadSpeed.9600=9600 gen4iod.menu.UploadSpeed.9600.upload.speed=9600 gen4iod.menu.UploadSpeed.57600=57600 gen4iod.menu.UploadSpeed.57600.upload.speed=57600 gen4iod.menu.UploadSpeed.256000.windows=256000 gen4iod.menu.UploadSpeed.256000.upload.speed=256000 gen4iod.menu.UploadSpeed.230400.linux=230400 gen4iod.menu.UploadSpeed.230400.macosx=230400 gen4iod.menu.UploadSpeed.230400.upload.speed=230400 gen4iod.menu.UploadSpeed.460800.linux=460800 gen4iod.menu.UploadSpeed.460800.macosx=460800 gen4iod.menu.UploadSpeed.460800.upload.speed=460800 gen4iod.menu.UploadSpeed.512000.windows=512000 gen4iod.menu.UploadSpeed.512000.upload.speed=512000 gen4iod.menu.UploadSpeed.921600=921600 gen4iod.menu.UploadSpeed.921600.upload.speed=921600
- Save the file and re-open the Arduino IDE, you should now see the new entry “4D Systems gen4-IoD Range” under the “Board” drop-down menu. Select the board to start.
- Using any web browser, open the 4D systems github page using this link.
https://github.com/4dsystems/GFX4d
- Clone or download the repository.
- Install all the library to the Arduino IDE by going to the “Sketch” Tab, under the “Include Library” drop-down menu, select the “Add .ZIP Library” option.
- Go to the website, https://www.apixu.com and follow the process in creating an account.
- Get the free membership or upgrade, if desired. Record and take note of the key that will be provided.
- Go to the “Dashboard” page of the website and then click on the “Fields: Change Response Fields”.
- It will open a check-box which corresponds to the data you only need from the API, remove or uncheck other parameters and leave only the DATE, TEXT and CODE.
- This will filter out the data and leave only the date, weather condition summary and the weather code, this will ensure that the data we will save to the module before reading/parsing it is small, as embedded systems have limited memory storage.
- You can test the API by using this automatically generated URL on your web browser, however, you need to edit the URL to determine your current location and the number of forecast days you desire.
- Build the circuit as shown in the diagram.
- Download the code here.
- Open the Visi project using Workshop 4. This project uses the Visi Environment.
- You can modify the properties of each widgets and buttons.
- Click on the “Compile” button.
Note: This step could be skipped. However, compiling is essential for debugging purposes.
Step 4: Comp’n Load- Connect the display to the microUSB cable. Make sure that you are connected to the right port. Red Button indicates that the device is not connected, Blue Button indicates that the device is connected to the right port.
- Now click on the “(Build) Copy/Load” button.
- Workshop 4 will prompt you to select a drive to copy the image files to a uSD Card. After selecting the correct drive, click OK.
- The module will prompt you to insert the uSD card.
- Unmount the uSD Card properly from the PC and insert it to the uSD Card slot of the display module.
- After inserting your uSD card to the gen4 display, the graphics will be immediately loaded.
This weather information codes are downloadable through this link: http://www.apixu.com/doc/Apixu_weather_conditions.json
Please note that in the project, we removed some of the codes as they are not applicable in our location/country.
[
{
"code" : 1000,
"day" : "Sunny",
"night" : "Clear",
"icon" : 113
},
{
"code" : 1003,
"day" : "Partly cloudy",
"night" : "Partly cloudy",
"icon" : 116
},
{
"code" : 1006,
"day" : "Cloudy",
"night" : "Cloudy",
"icon" : 119
},
{
"code" : 1009,
"day" : "Overcast",
"night" : "Overcast",
"icon" : 122
},
{
"code" : 1030,
"day" : "Mist",
"night" : "Mist",
"icon" : 143
},
{
"code" : 1063,
"day" : "Patchy rain possible",
"night" : "Patchy rain possible",
"icon" : 176
},
{
"code" : 1066,
"day" : "Patchy snow possible",
"night" : "Patchy snow possible",
"icon" : 179
},
{
"code" : 1069,
"day" : "Patchy sleet possible",
"night" : "Patchy sleet possible",
"icon" : 182
},
{
"code" : 1072,
"day" : "Patchy freezing drizzle possible",
"night" : "Patchy freezing drizzle possible",
"icon" : 185
},
{
"code" : 1087,
"day" : "Thundery outbreaks possible",
"night" : "Thundery outbreaks possible",
"icon" : 200
},
{
"code" : 1114,
"day" : "Blowing snow",
"night" : "Blowing snow",
"icon" : 227
},
{
"code" : 1117,
"day" : "Blizzard",
"night" : "Blizzard",
"icon" : 230
},
{
"code" : 1135,
"day" : "Fog",
"night" : "Fog",
"icon" : 248
},
{
"code" : 1147,
"day" : "Freezing fog",
"night" : "Freezing fog",
"icon" : 260
},
{
"code" : 1150,
"day" : "Patchy light drizzle",
"night" : "Patchy light drizzle",
"icon" : 263
},
{
"code" : 1153,
"day" : "Light drizzle",
"night" : "Light drizzle",
"icon" : 266
},
{
"code" : 1168,
"day" : "Freezing drizzle",
"night" : "Freezing drizzle",
"icon" : 281
},
{
"code" : 1171,
"day" : "Heavy freezing drizzle",
"night" : "Heavy freezing drizzle",
"icon" : 284
},
{
"code" : 1180,
"day" : "Patchy light rain",
"night" : "Patchy light rain",
"icon" : 293
},
{
"code" : 1183,
"day" : "Light rain",
"night" : "Light rain",
"icon" : 296
},
{
"code" : 1186,
"day" : "Moderate rain at times",
"night" : "Moderate rain at times",
"icon" : 299
},
{
"code" : 1189,
"day" : "Moderate rain",
"night" : "Moderate rain",
"icon" : 302
},
{
"code" : 1192,
"day" : "Heavy rain at times",
"night" : "Heavy rain at times",
"icon" : 305
},
{
"code" : 1195,
"day" : "Heavy rain",
"night" : "Heavy rain",
"icon" : 308
},
{
"code" : 1198,
"day" : "Light freezing rain",
"night" : "Light freezing rain",
"icon" : 311
},
{
"code" : 1201,
"day" : "Moderate or heavy freezing rain",
"night" : "Moderate or heavy freezing rain",
"icon" : 314
},
{
"code" : 1204,
"day" : "Light sleet",
"night" : "Light sleet",
"icon" : 317
},
{
"code" : 1207,
"day" : "Moderate or heavy sleet",
"night" : "Moderate or heavy sleet",
"icon" : 320
},
{
"code" : 1210,
"day" : "Patchy light snow",
"night" : "Patchy light snow",
"icon" : 323
},
{
"code" : 1213,
"day" : "Light snow",
"night" : "Light snow",
"icon" : 326
},
{
"code" : 1216,
"day" : "Patchy moderate snow",
"night" : "Patchy moderate snow",
"icon" : 329
},
{
"code" : 1219,
"day" : "Moderate snow",
"night" : "Moderate snow",
"icon" : 332
},
{
"code" : 1222,
"day" : "Patchy heavy snow",
"night" : "Patchy heavy snow",
"icon" : 335
},
{
"code" : 1225,
"day" : "Heavy snow",
"night" : "Heavy snow",
"icon" : 338
},
{
"code" : 1237,
"day" : "Ice pellets",
"night" : "Ice pellets",
"icon" : 350
},
{
"code" : 1240,
"day" : "Light rain shower",
"night" : "Light rain shower",
"icon" : 353
},
{
"code" : 1243,
"day" : "Moderate or heavy rain shower",
"night" : "Moderate or heavy rain shower",
"icon" : 356
},
{
"code" : 1246,
"day" : "Torrential rain shower",
"night" : "Torrential rain shower",
"icon" : 359
},
{
"code" : 1249,
"day" : "Light sleet showers",
"night" : "Light sleet showers",
"icon" : 362
},
{
"code" : 1252,
"day" : "Moderate or heavy sleet showers",
"night" : "Moderate or heavy sleet showers",
"icon" : 365
},
{
"code" : 1255,
"day" : "Light snow showers",
"night" : "Light snow showers",
"icon" : 368
},
{
"code" : 1258,
"day" : "Moderate or heavy snow showers",
"night" : "Moderate or heavy snow showers",
"icon" : 371
},
{
"code" : 1261,
"day" : "Light showers of ice pellets",
"night" : "Light showers of ice pellets",
"icon" : 374
},
{
"code" : 1264,
"day" : "Moderate or heavy showers of ice pellets",
"night" : "Moderate or heavy showers of ice pellets",
"icon" : 377
},
{
"code" : 1273,
"day" : "Patchy light rain with thunder",
"night" : "Patchy light rain with thunder",
"icon" : 386
},
{
"code" : 1276,
"day" : "Moderate or heavy rain with thunder",
"night" : "Moderate or heavy rain with thunder",
"icon" : 389
},
{
"code" : 1279,
"day" : "Patchy light snow with thunder",
"night" : "Patchy light snow with thunder",
"icon" : 392
},
{
"code" : 1282,
"day" : "Moderate or heavy snow with thunder",
"night" : "Moderate or heavy snow with thunder",
"icon" : 395
}
]
Comments
Please log in or sign up to comment.