Skip to main content

IoT HTTP Web Server on STM32U5

The stock firmware IOT_HTTP_WebServer (1.1.0) corresponds to the B-U585I-IOT02A demonstration program at st.com/resource/en/compiled_demos/b-u585i-iot02a_demo.zip.

The example runs a web-server on the device displaying the readings from its environmental on-board sensors. The device uses its on-board WiFi module to connect to the specified WLAN SSID, and then its web-server can be accessed remotely from a web-browser. The example source code is available in the STM32Cube Firmware Package for U5 and can be obtained as "IOT_HTTP_WebServer" example from the STM32Cube.

Creating your device

To create your device, do the following:

  1. Create an STM32U5 device with the IOT_HTTP_WebServer (1.1.0) stock firmware. If you have any questions, please refer to our STM32U5 quickstart guide

    Create an STM32U5 board running IOT_HTTP_Webserver (1.1.0) firmware

  2. On the Confirm Details screen you can specify the device name and verify your selections. Keep the advanced boot options unchecked and then click CREATE DEVICE.

    Confirmation screen

  3. The device will then be created. It takes a few moments.

    Creating devices

  4. Your STM32U5 IoT Discovery Kit is now ready to go!

Running the example

To run the example, we need to join the board to a virtual WiFi network first:

  1. Click Console tab in the device's menu, if it is not open by default. Type SSID from the list (Arm in this case) and anything as a password (Arm in this case).

    Type SSID

    note

    The SSID and password are case-sensitive.

    Now the STM32U5 IoT Discovery Kit virtual device is running a sensor web-server.

  2. To access the web-server on the virtual board we need to join its LAN. To do this from a local machine follow the steps in Connecting to the VPN and ensure the VPN connection is established.

  3. In the Connect tab find the LAN IP address for the virtual board.

    Type SSID

  4. Enter http://<LAN_IP> LAN IP in a web-browser on your local machine. For example, if your LAN IP is 10.11.0.1, enter http://10.11.0.1 in your web browser. Observe the ST web page as below:

    Web-server default page

  5. On the web-server go to Temperature menu and click Start button to capture the temperature sensor reading. Then on your AVH device page go to Sensors tab - Environmental and change the value for the temperature sensor from default 25 degrees. On the web-server page you can see the changes captured.

    Capturing temperature changes

Next steps

For next steps see STM32U5 IoT Discovery Kit overview page with references to more usage examples.