Weather

Spring 2020

The questions below are due on Tuesday March 02, 2021; 11:59:00 PM.
 
You are not logged in.

If you are a current student, please Log In for full access to the web site.
Note that this link will take you to an external site (https://shimmer.csail.mit.edu) to authenticate, and then you will be redirected back to this page.

1) Weather Commands

Develop a system that will display weather characteristics based on what the user requests on their ESP32 system. The system should use a button-based state machine (limit of two buttons)

Starting from a blank LCD, the system should prompt the user for one of six options:

  • Current local temperature
  • Current local time
  • Current date
  • Current local visibility (or weather)...your choice
  • Current local humidity
  • Current local pressure

Following the selection, using a combination of server-based information and either direct or proxy-server based requests sent to the Open Weather API (which you'll need to sign up for a free account with), your device will perform a GET request to retrieve the appropriate information.

It should then display information in a building-list like way. For example, if someone first asks for the temperature, it should display something on the LCD like:

The temp is 37.3 deg F

Then if someone asks for the time, it should display:

The time is 7:30 PM
The temp is 37.3 deg F

Note, please display local time, not GMT!

Then if someone asks for the visibility, it should display:

The visibility is Clear
The time is 7:30 PM
The temp is 37.3 deg F

Then if someone asks for the time again, it should display:

The time is 7:32 PM
The visibility is Clear
The time is 7:30 PM
The temp is 37.3 deg F

Then if someone asks for the humidity, it should display:

The humidity is 55%
The time is 7:32 PM
The visibility is Clear
The time is 7:30 PM
The temp is 37.3 deg F

And so on.

Get the pattern? New requests are displayed at the top, pushing old requests downwards. When the list of data gets too long you should throw away old responses.

You may utilize the time server from the earlier design exercise. You may implement an intermediate API on the 608dev-2.net server which your device acceses or the ESP32 may access the above resources directly. The choice is up to you, but please discuss your decision in your report. Your report should list where those resources are located on the server.

The original specification asked for "Visibility" as one of the things you can deploy. This term has gotten a little vague with the API it seems so you can either have Visibility refer to the actual "visibility" that comes back or the "main" "Weather" value (which is what we did above). Either one is fine.

External C libraries must be kept to a minimum. You can use C standard libraries as well as code we've been using in 6.08 labs. You should check before using other libraries. You cannot use the Arduino String class.

To upload your code, place all of your ESP32 code into a single functioning containing folder. Place that folder in the same folder as any Python/server code you might have. Then zip and upload the containing project folder. A hierarchy looks like the following:

  • Project Folder:

    • ESP32 Code:
      • main_file.ino
      • any_supporting_files.ino
    • Python Code (if you have code, and even if they live on the server):
      • File 1
      • File 2
  • You must submit a Design Exercise Write-up. Use (the template file provided here). Read this file since it has some instructions about what to include.

  • You must upload all of your code that you used in your design. Failure to upload code will result in significant point loss. This includes if you just forgot. Screenshots of your file's last modified date in My Computer are not evidence that the file has not been changed. They must be uploaded.

  • You must also upload your video to YouTube or any other site that has a timestamp associated with it and is accessible by the staff. Do not upload it to a private video sharing thing where the staff can't see it. Youtube, Google Drive, TikTok (shudder) will all work. Just test the link. Enter the link in the third box below.

Submit your writeup here: No file selected

Submit all of your code here as a zip file: No file selected

Enter the url for the video

Problem Status:
A Python Error Occurred:

Error on line 2 of Python tag (line 159 of source):
    kerberos = cs_user_info['username']

KeyError: 'username'

This problem will not be marked as done until graded by the staff. If you have filled it out, it will appear as with a note saying "Work Submitted" on the main ex03 page.
Back to Exercise 03