Micropython for XIAO ESP32S3 Sense(Camera, Wi-Fi)
MicroPython is a lean and efficient implementation of the Python 3 programming language that includes a small subset of the Python standard library and is optimised to run on microcontrollers and in constrained environments.
Since its first initiation in 2014, micropython has already supported many microcontrollers including the ESP32S3 which is the main brain in the Xiao ESP32S3 Sense development board.
In this page I will guide on how to use the the Xiao ESP32S3 Sense capability using the simple and easy syntax from micropython
Hardware Preparation
I am using Seeed Studio XIAO ESPS3 Sense board here.
Seeed Studio XIAO ESP32S3 |
---|
Software Preparation
In this guide I will be using windows 10 alongside with Thonny IDE and esptool. In order to use esptool make sure to install Python 3 environment on your windows OS. Before getting started make sure to download the firmware and Install Thonny
Thonny IDE | Firmware and Sample Code |
---|---|
👍 Greatly Thanks
The firmware designed for XIAO ESP32S3 Sense board, using in this wiki is made by our friend: shariltumin, whom we are really greatful for.Getting Started
The firmware is designed only for XIAO ESP32S3 MicroPython programming. We will first flash the firmware and then use the example on it.
Step 1. Flashing the firmware
Locate the usb to serial port address by opening the device manager
Extract the downloaded zip file and navigate to the folder.
click On the path box then type "CMD" and press enter
You will be directed to cmd terminal.
Install esptool using pip command (make sure python 3 is already installed)
pip install esptool
Erase the flash memory on the Xiao ESP32S3 using this command
esptool.py --port COMXX erase_flash
Now proceed to install the micropython firmware using this command
esptool.py --port COMXX --baud 460800 --before default_reset --after hard_reset --chip esp32s3 write_flash --flash_mode dio --flash_size detect --flash_freq 80m 0x0 firmware.bin
change the COMXX with port COM number on your PC
Step 2. Upload the example code
Now we will upload the example code to Xiao ESP32S3 sense internal flash memory.
For this part I am using thonny IDE first I configure the port
then on the view menu check mark the file option
Navigate to the folder where the example code is extracted then upload the files by right clicking on the file and choose the option like the picture below
after all the example code uploaded to xiao esp32s3 board, change the wifi credential on both the streamin_server.py file and the Wifi.py file based on your local wifi configuration
Step 3. Testing the streaming example
Before testing the streaming make sure to install the opencv python library using pip
pip install opencv-python
after the opencv python library installed successfully I go back to thonny and run the streamin_server.py and copy the IP address of the xiao ESP32S3 board
then go back to the extracted zip folder and open the steamin_client.py using python's IDLE and change the IP address part to be the same with the xiao ESP32S3 board
Then try to run the file and you should see a new windows displaying the streaming image from the Xiao ESP32S3 sense board
When launching the streaming example, the Xiao ESP32S3 Sense Board could get quite hot.
What's More
By using this examples you can make a fast and simple CCTV project and since the Xiao ESP32S3 sense is small in size the project could be seamless
Troubleshooting
If the camera is not initialized successfully(display a frame then freeze) or can't reconnect to the wifi try to unplugged the board and relaunch Thonny IDE.
✨ Contributor Project
- This project is supported by the Seeed Studio Contributor Project.
- Thanks Hendra and shariltumin efforts and your work will be exhibited.
Tech Support & Product Discussion
Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs.