ESP32 Bit Pirate home
  • Python
  • Beginner
  • 3 min
  • Web Serial

Recipe · Beginner · Python

How to run Python Scripting Lab in the browser

Use Pyodide and Web Serial to run small ESP32 Bit Pirate Python workflows directly from the Web Tools page.

Browser tools connected to hardware.
Python Scripting Lab is for quick browser automation: no local Python install, no pyserial setup and no COM or tty path to type.
Step 1

Open the Lab

Open Python Scripting Lab from Web Tools, then click Connect and choose the ESP32 Bit Pirate serial port. For CLI scripts, the Bit Pirate should be available as the normal serial terminal. Scripts that target Wi-Fi or BPIO2 need the matching firmware workflow first.

Step 2

Run the starter script

The default Code View script wakes the CLI, enters I2C mode and runs a scan. It is intentionally small so you can edit it before moving to a fetched repo script.

Result

What success looks like

The Output panel shows Python prints and Bit Pirate replies. If a script writes a file, Python Scripting Lab lists it under Generated files so it can be downloaded from the browser.

Troubleshooting

  • Use a Chromium browser with Web Serial support over HTTPS or localhost.
  • Close other serial terminals before clicking Connect.
  • For CLI scripts, connect to the normal serial terminal port, not a Wi-Fi-only workflow.
  • If a repo script expects BPIO2, switch the Bit Pirate to USB adapter/BPIO2 mode first.
  • Long scripts can be stopped at the next serial wait or sleep point.

Next steps

  • Select a script from the Scripts menu.
  • Use Import and Save to round-trip local Python files.
  • Move stable workflows to normal local Python when you need desktop automation.

Python Scripting Lab FAQ

When should I use Python Lab instead of the terminal?

Use Python Lab when a workflow needs repeated commands, parsing, simple loops or saved snippets. Use the terminal for quick manual exploration.

Is Python Lab the same as desktop pyserial scripts?

No. Python Lab targets a browser workflow, while desktop automation uses a serial port and the BusPirate Python class. The command ideas are similar, but the host environment differs.

What is a good first Python Lab test?

Start with connect, start, change_mode and a simple scan command. That proves the browser can control the device before you automate a longer hardware check.

Go deeper