Skip to content

Latest commit

 

History

History

example_HTTPrequest

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

About

This example use ESP32 to connect to WiFi and then make HTTP Get Requests.
What is covered:

  • ESP32 connection To WiFi (With S-Function);
  • HTTP Requests.

Requeriments

Software

  • MATLAB Version 9.13 (R022b)
  • Simulink R2022b 10.6 (R022b)
  • MATLAB Support Package for Arduino Hardware (version 22.2.2)
  • Simulink Support Package for Arduino Hardware (version 22.2.4)
    Maybe work with newer versions.

Hardware

  • x1 - ESP32 WROOM

Files:

  • main.slx: Model with the main model/logic of the example.

Blocks

  • Dealing_With_Strings: Commented block that shows to deal with texts between blocks. You can go to Simulation > Run to see the result, don't need to deplay to arduino.
  • WiFi_Handler: This block enable connection to WiFi and pass a signal as output[uint8]:
    • 0 == offline
    • 1 == connected
    • 2 == connecting
    • 3 == fail to connect
  • API_Request: This block make the HTTP request only if WiFi connection is enabled.
  • Serial_Start: This block enables Serial Communication. It is possible to pass messages with the wifi_status input.

How to use

  • Check How to Use Section and make all initial config.
  • Open main.slx.
  • Change SSID and Password.
  • Hardware > Build, Deploy & Start.