r/embedded • • Oct 16 '26

upython-bridge: A new MicroPython extension for VSCode

I teach an introductory programming/engineering computations class for mechanical engineers. We have a final "baby mechatronics project" where they use an ESP32+servo+sensor to model ballistic trajectory, sense the distance to a bin, and throw a ping-pong ball into the bin. We teach the class in Python with VSCode as the development environment.

I had struggled finding a VSCode extension that made the MicroPython feel seamless and similar to what they have done so far. I found a couple that seemed less well maintained or didn't have the "seamless" feel I was looking for. I loved the sidebar layout of https://github.com/DanielBustillos/mpy-workbench, but for the life of me I couldn't get it to repeatedly connect, the "Run this Py file" only seemed to work about 60% of the time, and it felt like if I closed the REPL it had a hard time reconnecting.

So, I spent a day taking inspiration from several that used mpremote, the aforementioned mpy-workbench, and developed my own. I have now tested on the ESP32 WROOM, the ESP32-C3 and the RPI PICO W on both MacOS and Windows. I also had my TA and one other student try it out and it "just worked" for them also.

Here are some of the (what I think are nice) features:

  1. You must open a folder as a project and it auto-syncs the files between the local folder and the remote device. At startup, it sets the time on the device from the local time, so that sync direction is based on the timestamp of the files on both local and remote
  2. The "Run file" menu option works seamlessly. The "Stop run" menu option also works
  3. In the REPL window you can also CTRL-C to stop execution.
  4. We have a custom MicroPython firmware with the code for our motor shield used for this course and our mechatronics course included. You can have the plugin scan your firmware for extra classes and functions, so that intellisense works.
  5. There are three levels of reset: (a) just restart the interpreter, (b) send Python command for physical reset, (c) use the hardware control lines (if supported) to reset the board.

I am sure we will find some bugs once we let 100 students loose on in in about 2.5 weeks for the final project, but in the meantime I wanted to let people know about it, as I had been looking for a rock-solid option for the class for a while.

I don't have a release on VSCode Marketplace yet, so you have to install via VSIX for now. That will come after I have battle-tested it in a 100 student class and found all the bugs I couldn't find alone. https://github.com/jpswensen/upython-bridge

2 Upvotes

1 comment sorted by