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.
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.
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.