yahboom
HomeTutorialsProduct
Solution
Blog
Online Store
About Us
EN/中文
Store
ESP32 Core Board📖
1. ESP32 Introduction
  • 1. ESP32S3 Overview
  • 2. Environment Setup Introduction
  • 3. Dev Board Introduction
2. ESP-IDF Development Tutorial
1. Before Development
  • 1. Environment Setup (Windows)
  • 2. Environment Setup (Linux)
  • 3. Build and Flash
2. Basic Peripherals
  • 1. LED Control
  • 2. Button Detection
  • 3. Peripheral Interrupts
  • 4. ESP_TIMER
  • 5. GPTIMER
  • 6. Watchdog Timer
  • 7. DMA
  • 8. ADC
  • 9. PWM Breathing LED
  • 10. RGB LED Effects
3. Serial Communication and Storage System
  • 1. Serial UART Communication Experiment
  • 2. I2C_OLED Display Experiment
  • 3. SPI Bus Communication Experiment
  • 4. PSRAM External Memory Experiment
  • 5. Flash Read and Write Experiment
  • 6. USB Emulated Mass Storage Experiment
4. FreeRTOS operating system
  • 1.FreeRTOS Core Concepts Theory
  • 2.Task Creation and Management
  • 3.Queue
  • 4.Binary Semaphore
  • 5.Mutex
  • 6.Event Groups
  • 7.Software Timer
  • 8.Task Scheduler
  • 9.Low Power Mode
  • 10.Deadlock
  • 11.Priority Inversion
5. Network Protocols and Wireless Communication
  • 1. WIFI Network Basics
  • 2. WIFI STA Mode
  • 3. WIFI AP Mode
  • 4. UDP Client Experiment
  • 5. UDP Server Experiment
  • 6. TCP Client Experiment
  • 7. TCP Server Experiment
  • 8. Socket Programming Basics
  • 9. HTTP Client Experiment
  • 10. HTTP Server Experiment
  • 11. MQTT IoT Communication Protocol
  • 12. WIFI OTA Upgrade
  • 13. Bluetooth Fundamentals
  • 14. Bluetooth Slave Mode
  • 15. Bluetooth Master Mode
6. Audio Applications
  • 1.I2S Microphone Recording and U-Disk Playback
  • 2.I2S Audio Playback Experiment
  • 3.Repeater Experiment
7. Xiaozhi AI Voice
  • 1. Burn Xiaozhi Firmware
  • 2. Network and Configuration
  • 3. AI Agent Settings
  • 4. Program Analysis
  • 5. Free Chat
3. Arduino Development Course
1. Before Development
  • 1. Environment Setup
  • 2. Build and Flash
2. Basic Peripherals
  • 1. LED Control
  • 2. Button Detection
  • 3. Peripheral Interrupts
  • 4. ESP_TIMER
  • 5. GPTIMER
  • 6. Watchdog Timer
  • 7. ADC
  • 8. PWM Breathing LED
  • 9. RGB LED Effects
3. Serial Communication and Storage System
  • 1. Serial UART Communication
  • 2. I2C OLED Display
  • 3. SPI Bus Communication
  • 4. Flash Read and Write
  • 5. USB Emulated Mass Storage
4. Network Protocols and Wireless Communication
  • 1. WIFI Network Basics
  • 2. WIFI STA Mode
  • 3. WIFI AP Mode
  • 4. UDP Server Experiment
  • 5. UDP Client Experiment
  • 6. TCP Client Experiment
  • 7. TCP Server Experiment
  • 8. HTTP Client Experiment
  • 9. HTTP Server Experiment
  • 10. MQTT IoT Communication Protocol
  • 11. WIFI OTA Upgrade
  • 12. Bluetooth Fundamentals
  • 13. Bluetooth Slave Mode
  • 14. Bluetooth Master Mode
5. Audio Applications
  • 1.I2S Microphone Recording and U-Disk Playback
  • 2.I2S Audio Playback Experiment
  • 3.Repeater Experiment
4. MicroPython Development Course
1. Before Development
  • 1. Environment Setup
  • 2. Build and Flash
  • 3. Thonny IDE
2. Basic Peripherals
  • 1. LED Control
  • 2. Button Detection
  • 3. Peripheral Interrupts
  • 4. TIMER_IT
  • 5. Watchdog Timer
  • 6. ADC
  • 7. PWM Breathing LED
  • 8. RGB LED Effects
3. Serial Communication and Storage System
  • 1. Serial UART Communication Experiment
  • 2. I2C_OLED Display Experiment
  • 3. SPI Bus Communication Experiment
  • 4. Flash Read and Write Experiment
  • 5. Print Storage
4. Network Protocols and Wireless Communication
  • 1. WIFI Network Basics
  • 2. WIFI STA Mode
  • 3. WIFI AP Mode
  • 4. UDP Client Experiment
  • 5. UDP Server Experiment
  • 6. TCP Client Experiment
  • 7. TCP Server Experiment
  • 8. HTTP Client Experiment
  • 9. HTTP Server Experiment
  • 10. MQTT
  • 11. Bluetooth Fundamentals
  • 12. Bluetooth Slave Mode
  • 13. Bluetooth Master Mode
5. Audio Applications
  • 1. I2S Audio Playback Experiment
  • 2. Repeater Experiment
Download
  • Code
  • Hardware_Info
  • 3D_Model_File
  • Software_Tools
  • VMware
  • VM_File
Download ZIP

Welcome to ESP32 Core Board repository

3. Thonny IDE

Thonny IDE Detailed Features


Thonny IDE Detailed Features1. Interface Layout1.1 Open the File Management Panel2. Editor Features2.1 Common Shortcuts2.2 Syntax Highlighting2.3 Code Completion2.4 Code Folding3. REPL / Shell Usage Tips3.1 Basic Operations3.2 Tab Completion3.3 Command History3.4 Pasting Multi-line Code Blocks3.5 View Object Information4. Interpreter Options and Settings4.1 Switching Interpreters4.2 Common Preferences4.3 MicroPython Connection Options5. File Management5.1 File Operations Reference5.2 Startup Scripts5.3 File System Capacity6. Common Problems


1. Interface Layout

The Thonny interface is divided into five areas:

┌──────────────────────────────────────────────────────┐
│ ① Menu bar  File Edit View Run Tools Help            │
├──────────────────────────────────────────────────────┤
│ ② Toolbar  ▶ ■ ⬇ ...                                 │
├──────────────────────────┬───────────────────────────┤
│                          │                           │
│ ③ Editor                  │ ④ Shell (REPL)            │
│    (code editing area)    │   (interactive console)    │
│                          │                           │
├──────────────────────────┴───────────────────────────┤
│ ⑤ Status bar     Interpreter: MicroPython (ESP32)  |  COM3       │
└──────────────────────────────────────────────────────┘
No.AreaDescription
①Menu barFile (file operations), Edit (editing operations), View (view toggles), Run (run/debug), Tools (tool menu), Help (help)
②ToolbarRun scriptRun script、Stop programStop program、Step IntoStep Into、Step OverStep Over、Step OutStep Out、Resume executionResume execution
③EditorMulti-tab code editing area with syntax highlighting, line numbers, bracket matching, and auto-indentation
④ShellMicroPython REPL console for interactive Python execution; shows print output and exception messages
⑤Status barShows the line/column number on the left, and the current interpreter type and COM port on the right

1.1 Open the File Management Panel

Menu bar View → check Files, and a file panel appears on the left, divided into an upper and a lower part:

File manager 1

Left panel area

PanelPathDescription
This computerLocal hard driveBrowse and select local files
MicroPython device/flashESP32 internal file system

2. Editor Features

2.1 Common Shortcuts

ShortcutFunction
Ctrl + SSave the current file
Ctrl + OOpen a file
Ctrl + NCreate a new file
Ctrl + /Comment/uncomment
Ctrl + DDuplicate the current line (or the selected region)
Ctrl + ZUndo
Ctrl + Shift + ZRedo
TabIndent (4 spaces)
Shift + TabUnindent
Ctrl + ASelect all
Ctrl + FFind
Ctrl + HFind and replace
F5Run the current script (upload to the device, then execute)
F6Debug run (breakpoint mode)
F7Step into a function
F8Step over

2.2 Syntax Highlighting

Thonny automatically syntax-highlights Python code:

  • Purple — keywords (import, while, def)

  • Blue — built-in functions (print, range)

  • Green — strings

  • Orange — comments

2.3 Code Completion

Press Ctrl + Space while typing, or let the completion list pop up automatically; it contains module names, function names, and variable names.

Completion for MicroPython built-in modules (machine, network, socket, etc.) depends on whether Thonny is connected to the device; after connecting, it loads the device's module list.

2.4 Code Folding

In the line number area on the left of the editor, click - to fold function bodies / loop bodies / conditional branches, and click + to expand them.


3. REPL / Shell Usage Tips

3.1 Basic Operations

OperationKeyDescription
Interrupt a programCtrl + CStop the currently executing script and return to >>>
Soft resetCtrl + DSoft-reset the ESP32, equivalent to machine.soft_reset(), keeps the RAM contents
Clear ShellCtrl + LClear the Shell panel display (does not affect the device)
Paste multiple linesCtrl + VPaste a multi-line code block directly; Thonny feeds it to the REPL line by line

3.2 Tab Completion

Type a partial name after >>> and press Tab:

xxxxxxxxxx
>>> import machine
>>> machine.Pin.      # press Tab to pop up the completion list
OUT          IN           OPEN_DRAIN   PULL_UP
PULL_DOWN    IRQ_FALLING  IRQ_RISING   ...
>>> machine.Pin(48, machine.Pin.OUT)   # continue typing after completion

3.3 Command History

Use the ↑ and ↓ keys to browse previously entered commands, avoiding retyping.

3.4 Pasting Multi-line Code Blocks

Paste multi-line code directly after >>>; Thonny automatically recognizes the indentation and executes it as a block:

xxxxxxxxxx
>>> for i in range(3):
...     print(i)
...
0
1
2

3.5 View Object Information

xxxxxxxxxx
>>> import machine
>>> dir(machine)          # list all attributes of the module
>>> help(machine.Pin)     # view the help documentation for the Pin class

4. Interpreter Options and Settings

4.1 Switching Interpreters

Click the interpreter selection area in the bottom-right corner; a menu with several options pops up:

InterpreterApplicable Scenario
MicroPython (ESP32)Connect to the ESP32-S3 via the serial port
MicroPython (SSH)Remote connection via Wi-Fi WebREPL
Local Python 3Run local Python scripts on the computer
MicroPython (generic)Connect to other MicroPython boards via the serial port

4.2 Common Preferences

Menu bar Tools → Options:

TabRecommended Setting
GeneralLanguage: Simplified Chinese or English; UI mode: regular
EditorFont size 14; indent 4 spaces; show line numbers
Theme & Font"Syntax theme" can be set to a dark theme (Dark)
Run & DebugUncheck "Interrupt working program on connect" (to avoid accidental interruption on connect)
FilesDefault file path can be set to the local project directory

4.3 MicroPython Connection Options

Click Install or update MicroPython in the interpreter selection dialog to call esptool directly to flash the firmware (an alternative to the manual command line).

When connecting the ESP32 for the first time, the Port in the interpreter options must be manually set to the correct COM port. Thonny remembers the last selection and auto-connects next time.


5. File Management

5.1 File Operations Reference

OperationMethod
Upload to ESP32Right-click a local file → Upload to /
Download to computerRight-click a device file → Download to /
DeleteRight-click a file → Delete
Create a directoryRight-click blank space in the device panel → New directory
RenameSelect the file → F2 (or right-click → Rename)

5.2 Startup Scripts

Execution order after the ESP32 is powered on: after the MicroPython firmware is flashed, the board automatically looks for two scripts on power-up, running boot.py first and then main.py.

As the initialization script, boot.py fully resets the Wi-Fi adapter first to avoid state issues from a soft restart, then blocks and waits until it connects to the router.

Only after the network is established does the system run main.py, which is only responsible for importing business modules and starting the application.

There is a risk to note: whether in boot or main, if an infinite loop or an exception hangs the program, you can quickly press Ctrl+C at the moment of power-up to interrupt the script and enter the command-line REPL to fix the code.

​x
# boot.py — runs first on boot
import network, time

wlan = network.WLAN(network.STA_IF)
wlan.active(False); time.sleep_ms(500)
wlan.active(True);  time.sleep_ms(200)
wlan.connect("SSID", "PASSWORD")
while not wlan.isconnected():
    time.sleep(0.5)
print("Wi-Fi OK:", wlan.ifconfig())
xxxxxxxxxx
# main.py — runs after boot.py
import my_app

my_app.run()

The firmware is just the MicroPython runtime environment; these two startup scripts must be manually uploaded to the ESP32 file system. After the board powers on, the kernel automatically searches for these two files; if found, it runs them in sequence; if not, it directly enters the serial-interactive REPL.

5.3 File System Capacity

xxxxxxxxxx
>>> import os
>>> fs_stat = os.statvfs('/flash')
>>> fs_stat[0] * fs_stat[3] // 1024    # free space (KB)
>>> fs_stat[0] * fs_stat[2] // 1024    # total space (KB)

File system capacity

The MicroPython firmware takes up about 1~2MB; the rest of the Flash is available as the file system.


6. Common Problems

SymptomCauseSolution
No >>> prompt in ShellInterpreter not connected correctlyMake sure MicroPython (ESP32) is selected at the bottom-right and the correct COM port is chosen
Running a script shows Save file, then nothing happensThe file cannot be written to the deviceCheck whether the device file system is full; or use Ctrl + C in the REPL to interrupt a stuck program
IOError when saving a file to the device from the editorFlash file system corruptedRe-flash the firmware, or format with import os; os.VfsLfs2.mkfs(bdev)
Chinese file names display as garbled in the device panelMicroPython file names only support ASCIIChange the file name to English or pinyin
The device program keeps running after closing ThonnyMicroPython executes continuously on power-up; disconnecting the IDE does not affect itNormal behavior; interrupt with Ctrl + C or reset with EN
Existing files not visible in the device panelThonny not refreshedRight-click blank space in the device panel → Refresh
Not sure which file a multi-file project starts fromThe device boots in the boot.py → main.py orderimport other modules in main.py

Build and Flash
LED Control

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文