iTranslated by AI
Connecting to MicroCat.1 (MECHATRAX) using VSCode and MicroPico
What this is about
I immediately purchased the MicroCat.1 (pre-release version) from MECHATRAX, which went on sale on 2025/12/15, and have been serving as a "human guinea pig."
I was able to run MicroPython using Thonny, but I really wanted to run it in VS Code, so this is a record of my attempts. Specifically, I solved the issue where I could not connect when using the VS Code extension "MicroPico" for the MicroCat.1 (RP2350 series) MicroPython environment, even though the serial port was not occupied by tools like screen. I also noted how to deal with some parts that were not stable even after the port was recognized.
Quick Start
-
Connect microcat.1 via USB


-
Confirm that you can access the REPL using
screen /dev/cu.usbmodem1101 115200or similar.

-
Open a new window in VS Code, create a project folder, and open it.


-
Install the MicroPico extension.


-
Execute the micropico initialization
Open the Command Palette withcmd + shift + pand runMicroPico: Initialize micropico project.

-
You will have a folder structure like this

-
In this state, you cannot connect even if you click the MicroPico icon in the bottom left.
(The reason will be explained later)

-
Download and execute patch_micropico.sh to patch the extension.
chmod +x patch_micropico.sh
./patch_micropico.sh
Execution example:
takao@TakaonoMacBook-Pro files % ./patch_micropico.sh
Found extensions:
/Users/takao/.vscode/extensions/paulober.pico-w-go-4.3.4-darwin-arm64
Patching /Users/takao/.vscode/extensions/paulober.pico-w-go-4.3.4-darwin-arm64/dist/extension.js
Backup will be saved to /Users/takao/.vscode/extensions/paulober.pico-w-go-4.3.4-darwin-arm64/dist/extension.js.bak.20251218233200
Patched successfully.
Done. Backup saved as /Users/takao/.vscode/extensions/paulober.pico-w-go-4.3.4-darwin-arm64/dist/extension.js.bak.20251218233200
-
Reload the workspace.
Open the Command Palette withshift + cmd + pand runDeveloper: Reload Window.

-
REPL connection to the actual device becomes possible.

-
Naturally, the display in the bottom left will also change.

-
For example, if you type:
from machine import Pin
pin = Pin("LED", Pin.OUT)
pin.high()
the LED will light up.

before

after

For example, if you save a script like the one introduced on this site:
from machine import Pin
from utime import sleep
pin = Pin("LED", Pin.OUT)
print("LED starts flashing...")
while True:
try:
pin.toggle()
sleep(1) # sleep 1sec
except KeyboardInterrupt:
break
pin.off()
print("Finished.")
as blink.py and click the Run button in the bottom left while the file is open, you can execute it.

-
If you want to write it to microCat.1 as a program that runs automatically
save the file asmain.py, open the Command Palette withShift + Cmd + P, and executeMicroPico: Upload file to Pico.

-
After writing, it will reset, and
main.pywill run automatically.
Explanation
Environment Used
- Board: MechaTracks MicroCat.1
- Firmware:
mtxbranch ofmechatrax/micropython - Extension:
paulober.pico-w-go-4.3.4(MicroPico) - OS: macOS (installed under
~/.vscode/extensions)
Symptoms and Environment Confirmation
-
Symptom 1:
/dev/cu.usbmodem1101is visible, but MicroPico cannot connect because the VID/PID differ from the standard Pico.- Remedy:
Apply a patch to absorb the VID/PID difference.
- Remedy:
-
Symptom 2:
Even after accounting for the VID/PID difference,getSerialPortsfires continuously, causing aRangeErrorto persist.- Remedy:
Apply a patch to stop enumeration when a specific port is provided.
- Remedy:
-
Symptom 3:
When "Toggle Mpy FS" is enabled,stat/readFileerrors occur frequently, making it impossible to retrieve the file list and rendering it impractical.- Remedy:
Give up (For MicroCat.1, do not use "Toggle Mpy FS" and stick to manual connection + upload operation).
- Remedy:
Isolation and Observation
1. Physical/Firmware Confirmation
- Change cables and ports, reconnect, and confirm whether you can enter the REPL with
screen /dev/cu.usbmodem1101 115200. - Confirm that
picotool info -dis visible in BOOTSEL mode (the board is responding).
2. Confirming VID/PID Mismatch
-
ports/rp2/boards/MTX_MICROCAT1/mpconfigboard.hhas the following definitions:MICROPY_HW_USB_VID (0x388B)MICROPY_HW_USB_PID (0xCA71)
- Since it differs from the standard Pico (0x2E8A series), it is excluded from the extension's automatic enumeration.
3. Confirming MicroPico Behavior
- Even after absorbing the VID/PID difference,
getSerialPortsruns every 1.5 seconds, causing continuousRangeErrorissues, and connection is not established. - With "Toggle Mpy FS,"
stat/readFileerrors occur frequently, and the virtual FS is essentially unusable.
Log Sample (Excerpt)
RangeError: offset is out of bounds # When getSerialPorts hits repeatedly
Error: Failed to read file: stat/readFile error # When Toggle Mpy FS is on
Policy for Response and Resolution
- Do not change the VID/PID on the firmware side; handle it on the extension side.
- When a port is manually specified, stop port enumeration and the automatic connection timer.
- Since "Toggle Mpy FS" is unstable, do not use it and stick to manual connection + upload operation.
Provisional Remedy (Configuration only, unresolved)
- Even if
micropico.manualComDevicewas specified andautoConnectwas set tofalse, the enumeration timer remained, and theRangeErrordid not stop. - Just grasping the VID/PID difference did not resolve the issue, as it could not suppress the repeatedly firing
getSerialPorts.
Root Cause Fix (Extension Patch)
- Modified
setupAutoConnect()to directlyopenSerialPort()without callinggetSerialPorts()or starting a timer when a port is manually specified. - This stopped the
RangeError, allowing stable operation by sticking to manual connection + upload.
Patch Overview
- Target file:
~/.vscode/extensions/paulober.pico-w-go-4.3.4-darwin-arm64/dist/extension.js - Changes:
- Changed the behavior of processing equivalent to
setupAutoConnect().- If
micropico.manualComDeviceis set, do not callgetSerialPorts(), directlyopenSerialPort()with the specified port, and exit. Do not start the automatic connection timer. - Only perform port enumeration as before if the manual specification is empty and
micropico.autoConnectistrue.
- If
- This prevents
RangeErroreven in custom VID/PID environments, ensuring stable manual connections.
- Changed the behavior of processing equivalent to
Patch Application Procedure
- Confirm that the MicroPico extension is installed.
- Execute the patch script at the repository root.
cd /Users/takao/Project/MicroPico-1
./scripts/patch_micropico.sh
# Specify the path if you have multiple extensions installed
# ./scripts/patch_micropico.sh ~/.vscode/extensions/paulober.pico-w-go-4.3.4-darwin-arm64
- Upon execution,
dist/extension.js.bak.<timestamp>will be created, and the target extension will be patched directly. Since this will revert if you reinstall the extension, reapply it as necessary.
VS Code Settings Example (Stable Operation)
An example of settings.json. It connects only via the manually specified port and does not use the automatic connection timer.
{
"micropico.manualComDevice": "/dev/cu.usbmodem1101",
"micropico.autoConnect": false,
"micropico.openOnStart": false
}
Validation Results
- After patching,
RangeErrordid not reoccur with the manually specified port, and connection/upload became stable. - Resetting after upload started
main.py, confirming operations like LED blinking.
Recurrence Prevention and Notes for Updates
- If
extension.jsis overwritten by an extension update, it will revert, so executepatch_micropico.shagain after updates. - Treat "Toggle Mpy FS" as unsupported (unstable) and operate under the premise of not using it.
- If the path differs for other OSs or versions, specify the extension directory explicitly to
patch_micropico.sh.
Summary
- I can now use it without much stress.
- The problem where MicroPico's automatic enumeration fails due to the MicroCat.1's custom VID/PID can be solved by simply making the extension "not enumerate if a manual port is specified."
- It can be easily applied with
scripts/patch_micropico.sh, and it became stable with manual connection + upload operation. - Reapply after confirming the backup when updating the extension.
Discussion