Multiple simultaneous device connections in one project #24
Closed
lukaskremla
started this conversation in
Ideas
Replies: 2 comments 1 reply
-
Hello Lukas,
Happy Easter!
It was only wishful thinking, and I made the wish before I did what I did
below.
The way I have it configured right now in ONE Project:
Project\
|-shared\
|-master\ (com3)
-master_main.py
-master_boot.py
|-slave\ (com4)
-slave_main.py
-slave_boot.py
|-stubs\
I asked chatgpt to cook up some batch files that deploy shared\ into
esp\shared\ and master\master_main into esp\main.py etc... This seems to
work and so far I haven't mixed up the files. All i have to do is double
click on the icons on my desktop. I also tried pycharm external tools, but
got all fouled up.
I chose ONE project to not have to worry about duplicating the shared all
the time and having to fight two identical environments (other than the com
port).
to monitor the slave on com4, I use Thonny, which allows me to occasionally
intervene...
BTW, the ChatGPT external to PyCharm is waaaay smarter than PyCharm's AI
(haven't tried 25.1 yet). To top it off, when I remarked to PyAI that his
external twin was smarter than it, he/it hung up on me! Such a thin skin.
Cheers
JR
ᐧ
…On Sat, 19 Apr 2025 at 16:38, Lukas Kremla ***@***.***> wrote:
@Trilife <https://github.com/Trilife>
TriLife
<https://plugins.jetbrains.com/author/39168616-0270-41c9-9680-13118ad6c96e>
Here's a suggestion though: I'm developing code for multiple ESPs, master
and slave... It would be great to be able to connect to more than 1 at a
time...
https://plugins.jetbrains.com/plugin/26227-micropython-tools/reviews#115837
Currently the plugin only supports connecting to one device at a time in a
single project. Developing master/slave firmware either means switching
between devices in a single project or opening a separate project for every
device.
Supporting simultaneous connections of more than one device at a time
would require a lot of work, most of the codebase would have to be
rewritten and it also comes with several considerations. The main
consideration affects run configurations, context menu actions and stubs -
there would have to be a concept of an active device and the aforementioned
features have to be aware of this active device and change their behavior
accordingly. This is both very hard to code and introduces potential for
complicated edge-cases and ambiguity.
An additional consideration that concerns both supporting multiple
simultaneous connections and using two projects at a time is how modality
works in JetBrains IDEs. Whenever the plugin communicates with a device it
does so in a modal context, to prevent users from modifying files that are
being uploaded, launching multiple uploads at once etc.
This means that you wouldn't be able to upload to two devices at once.
This also applies to all open projects of the IDE, if one is running a REPL
action the other project will be blocked too until the REPL action
finishes. However, most projects are rather small in size, so uploads are
fast and 0.5.0 will introduce new features and improvements to upload
speeds that will bring upload times down even further. Though modality is
still something to keep in mind when working with multiple devices.
Conclusion
I would strongly recommend using a separate project for every device and
switching between them. This allows you to connect to as many devices at
once as you need and it provides clear separation of concerns. Each project
has separate source code, run configurations and stubs, avoiding ambiguity.
—
Reply to this email directly, view it on GitHub
<#24>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFQXPNX6LCDGM23KLTPARZT22K63LAVCNFSM6AAAAAB3O63V5KVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZYGIZDCOJXHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Support for multiple simultaneously connected devices remains unplanned. An explanation of the reasons for this decision and some tips on how to work with multiple devices even without official support in this plugin can be found here |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
@Trilife
Currently the plugin only supports connecting to one device at a time in a single project. Developing master/slave firmware either means switching between devices in a single project or opening a separate project for every device.
Supporting simultaneous connections of more than one device at a time would require a lot of work, most of the codebase would have to be rewritten and it also comes with several considerations. The main consideration affects run configurations, context menu actions and stubs - there would have to be a concept of an active device and the aforementioned features have to be aware of this active device and change their behavior accordingly. This is both very hard to code and introduces potential for complicated edge-cases and ambiguity.
An additional consideration that concerns both supporting multiple simultaneous connections and using two projects at a time is how modality works in JetBrains IDEs. Whenever the plugin communicates with a device it does so in a modal context, to prevent users from modifying files that are being uploaded, launching multiple uploads at once etc.
This means that you wouldn't be able to upload to two devices at once. This also applies to all open projects of the IDE, if one is running a REPL action the other project will be blocked too until the REPL action finishes. However, most projects are rather small in size, so uploads are fast and 0.5.0 will introduce new features and improvements to upload speeds that will bring upload times down even further. Though modality is still something to keep in mind when working with multiple devices.
Conclusion
I would strongly recommend using a separate project for every device and switching between them. This allows you to connect to as many devices at once as you need and it provides clear separation of concerns. Each project has separate source code, run configurations and stubs, avoiding ambiguity.
Beta Was this translation helpful? Give feedback.
All reactions