Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wokwi emulator responds to the rfc2217 connections only when vs code is in the foreground #899

Open
petrarce opened this issue Oct 19, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@petrarce
Copy link

I am using rpi pico w configured setup for running the wokwi emulator in VS code based on the mycropython firmware 1.23.0. However, i would like to be able to connect to repl and also perform the filesystem operations with the running emulator using the mpremote tool. This is right now problematic, since the serial communication with the emulator over the rfc2217 tcp port is not working properly, unless the VS code plugin is moved on the foreground. More specifically:

  1. I connect to the emulator with mpremote using this command:
mpremote connect rfc2217://localhosta:4000 repl
  1. Typing anything to the console doesn't produce any echo from the serial port
  2. Switching to the VS code seems to flush the serial communication buffers.

Within the wire-shark i can see this picture:
image
It seems to me, that when the VS code is not on the foreground the wokwi simulator is somehow paused.

Is it an expected behavior? Is it possible to somehow configure the wokwi VS code plugin to run on the background instead of pausing when the VS code is not on the foreground?

@petrarce petrarce added the bug Something isn't working label Oct 19, 2024
@djedu28
Copy link

djedu28 commented Oct 21, 2024

Is it an expected behavior?

Yes, it is expected behavior.

Is it possible to somehow configure the wokwi VS code plugin to run on the background instead of pausing when the VS code is not on the foreground?

As a hack I highlight the wokwi tab in VSCode, this way it remains “active” even though it is not in the foreground.
The automatic translation may not be great, so I leave a GIF of the process.

_diagram.json.-.djcarV3_3_seguidor.-.djWokWi.-.Visual.Studio.Code.2024-10-21.02-12-14.mp4

@urish
Copy link
Contributor

urish commented Oct 28, 2024

Is it an expected behavior? Is it possible to somehow configure the wokwi VS code plugin to run on the background instead of pausing when the VS code is not on the foreground?

Yes, this is the expected behavior - simulation is usually CPU intensive, and it would be very frustrating to find out you ran out of laptop battery because you forgot it running in the background. That being said, it's a good idea to have a way to tell Wokwi to keep running even while the tab in hidden, for use cases like yours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants