Description
In this video demonstration, you will use the MPLAB® Harmony TCP/IP and the USB middleware libraries to create a simple HTTPS client application which communicates with the Yahoo! Weather Service in order to retrieve and display the temperature of a specific location on earth. The retrieved weather data (temperature) is sent to the PC via a USB CDC-class connection (emulating RS-232) and displayed in a terminal emulator such as CoolTerm.
The application is developed from scratch using the MPLAB Harmony Configurator (MHC) plug-in within MPLAB X IDE.
The Yahoo! Weather Service API
This service provides an RSS feed containing the current weather conditions for a specific region or city. To use the API, you will need to obtain the Where On Earth Identifier (WOEID) for the specific region/city of interest. This site provides the WOEID codes for all regions.
For more details on how to use the API, please visit the Yahoo! Weather API Documentation page.
The hardware for this project uses the PIC32 Ethernet Starter Kit which contains a PIC32MX795F512L microcontroller, incorporating the USB Host and Device interfaces as well as a 10/100 Ethernet interface. The board features a built-in programmer/debugger, enabling a direct connection to MPLAB X IDE.
Instructions
The video below guides you through all the steps required to create and run this demonstration. You will need to download the application files as well as the required software tools and MPLAB Harmony framework if you wish to follow along.
- Download the relevant application files from the list given below. Unzip to your C:\ drive (you should see C:\YAHOO_WEATHER).
- Download MPLAB X IDE, MPLAB XC32, and MPLAB Harmony from the download section given below.
- Download the CoolTerm Terminal Emulator software.
- Watch the video and when prompted, copy the application files into the harmony project folder.
Download Application Files
The ZIP file includes the four application files you will need to build the demonstration: app.c, app.h, App_Yahoo.c, and certs.h.
Download and unzip to your C:\ drive. You should see a new folder C:\YAHOO_WEATHER containing these files.
Download MPLAB Software
Download CoolTerm Terminal Emulator Software
CoolTerm is a cross-platform terminal emulator that runs on Apple OS X®, Microsoft Windows®, and Linux®. It is available for download here.
Video
The video demonstration below is presented by Luc Archambault, Principal Field Applications Engineer, Microchip Technology Inc: