wokwi / wokwi-vscode-micropython

MicroPython in Wokwi for VS Code
MIT License
29 stars 9 forks source link

Visual Studio Code: It seems like WOKWI simulator doesn't run main.py file #1

Closed ikostan closed 6 months ago

ikostan commented 6 months ago

Hi all.

I am new here and it seems like I am doing something wrong here. I have 2 simple project on my WOKWI:

Blink with MicroPython PiPico W Blinking LED and Terminal

The main purpose is just to run some simple python code in order to make LED blink. It dose work on wokwi.com. However, I have some difficulties running same code from Visual Studio Code.

I followed step by step procedure from here.

As a result I have a WOKWI simulator running but LED doesn't work, see screenshots here:

  1. venv is activated: image

  2. "Wokwi: Start Simulator" selected: image

  3. Run following command from CMD -> python -m mpremote connect port:rfc2217://localhost:4000 run main.py image

A little help will be much appreciated, thanks.

My code on github:

wokwi pico led wokwi pico w led

Visual Studio Code info:

Version: 1.89.1 (user setup) Commit: dc96b837cf6bb4af9cd736aa3af08cf8279f7685 Date: 2024-05-07T05:13:33.891Z Electron: 28.2.8 ElectronBuildId: 27744544 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Windows_NT x64 10.0.19045

WOKWI simulator extention is installed and activated:

image

urish commented 6 months ago

Hello, thanks for the detailed report!

Can you try removing the following lines from your diagram.json and see if it helps?

    [ "pico:GP0", "$serialMonitor:RX", "", [] ],
    [ "pico:GP1", "$serialMonitor:TX", "", [] ],
ikostan commented 6 months ago

Hi @urish,

I did exactly that and now it works like a charm. Not sure how that serial monitor got there...

Thank you a lot.