General

Application Tutorials of uPyCraft-micropython Know the Weather

userHead Account cancelled 2017-07-15 02:17:28 1661 Views0 Replies

Application Tutorials of uPyCraft-micropython Know the Weather
Wow, now is already 3:30 pm! 
Let us begin our study about get and post of http, trying making a weather application with get.
Hardware in need:
FireBeetle ESP32 board *1

Operation Procedure
Step 1: Register an account in the web: https://www.seniverse.com, choosing free service. 
You can request data in this web for 400 times per hour. This is the source of basic weather data.

Step 2: Save your API-Key and ID.

Step 3: Prepare for necessities.
1. FireBeetle ESP32 ×1
2. uPyCraft 0.21

Step 4: Begin the test.
1. Drag urequests.py of uPy_Lib to lib of the board.
Caution: I have modified the file, the official web do not support params.
2. Use the code as below and save as py file, download to the board and run.

Step 5: Test result

Check weather in Beijing, it is raining.
Change LOCATION to your own city and you can get the updating in reality.