Websocket Viewer

Materials

Example

This example demonstrates how the AMB82 Mini acts as a WebSocket server to stream live camera video to a web browser.

It provides a low-latency video streaming suitable for real-time applications.

In the highlighted code snippet, fill in the ssid with your WiFi network SSID and pass with the network password.

../../../_images/image01143.png

By default, the WebSocket Viewer file is loaded from htdocs.h.

Alternatively, the file can be loaded from a SD card. To load it from the SD card,

  1. Set this value to 1 to load the WebSocket Viewer file.

../../../_images/image02139.png
  1. Format the SD card as FAT32 using Windows OS.

  2. Copy htdocs.bin to the root directory of the SD card.

  3. Insert the SD card into the board.

Compile the code and upload it to Ameba. After pressing the Reset button, wait for the Ameba Pro 2 board to connect to the WiFi network. The board’s IP address will be shown in the Serial Monitor.

../../../_images/image03120.png

Open Google Chrome or any web browser of your choice and enter http://{your_ip_address}/ to connect to the AmebaPro2 mini.

../../../_images/image0481.png

Code Reference

You may adjust the video bitrate based on your WiFi network quality.

../../../_images/image0561.png