Skip to content

provide serial upoload port setting from VSC to PIO#23436

Merged
Jason2866 merged 1 commit into
arendst:developmentfrom
Jason2866:vsc_port_set
May 17, 2025
Merged

provide serial upoload port setting from VSC to PIO#23436
Jason2866 merged 1 commit into
arendst:developmentfrom
Jason2866:vsc_port_set

Conversation

@Jason2866
Copy link
Copy Markdown
Collaborator

Description:

The serial Port setting in VSC is not always used in Platformio. Only used when flashing the firmware. The provided Pio script in this PR reads the VSC database state.vscdb and searches for a port set and if found, it is populated to Platformio by setting the env["UPLOAD_PORT"]. So it is ensured that no random serial port is used (caused by autodetection) for any command possible with Platformio.
No change of behaviour if no setting is done in VSC or VSC is not used at all.

Checklist:

  • The pull request is done against the latest development branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • The code change is tested and works with Tasmota core ESP8266 V.2.7.8
  • The code change is tested and works with Tasmota core ESP32 V.3.1.3.250504
  • I accept the CLA.

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass

@Jason2866 Jason2866 merged commit a088c87 into arendst:development May 17, 2025
94 of 120 checks passed
@Jason2866 Jason2866 deleted the vsc_port_set branch May 17, 2025 17:59
@arendst
Copy link
Copy Markdown
Owner

arendst commented May 18, 2025

This is expected?

Tool Manager: Installing https://github.com/pioarduino/registry/releases/download/0.0.1/mklittlefs-3.2.0.zip
Unpacking  [####################################]  100%
Tool Manager: tool-mklittlefs@3.2.0 has been installed!
Verbose mode can be enabled via `-v, --verbose` option
Nothing more to solidify
-DCONFIG_TASMOTA_FLASHMODE_QIO
*** use provided user_config_override.h as planned ***
*** use provided platformio_override.ini as planned ***
*** use provided platformio_tasmota_cenv.ini as planned ***
PIO called from VS Code extension
OS Platform: Linux
OperationalError: unable to open database file:
  File "/home/arendst/.platformio/penv/lib/python3.12/site-packages/platformio/builder/main.py", line 167:
    env.SConscript(env.GetExtraScripts("pre"), exports="env")
  File "/home/arendst/.platformio/packages/tool-scons/scons-local-4.8.1/SCons/Script/SConscript.py", line 620:
    return _SConscript(self.fs, *files, **subst_kw)
  File "/home/arendst/.platformio/packages/tool-scons/scons-local-4.8.1/SCons/Script/SConscript.py", line 280:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "/home/arendst/tasmota/DevProdTasmota/pio-tools/port-vsc.py", line 26:
    conn = sqlite3.connect(db_path)
=========================================================================== [FAILED] Took 0.74 seconds ===========================================================================

@Jason2866
Copy link
Copy Markdown
Collaborator Author

@arendst No, can you provide the path from the state.vscdb?
From my research it should be ~/.config/Code/User/globalStorage/state.vscdb for Linux

echo-bravo-yahoo pushed a commit to echo-bravo-yahoo/Tasmota that referenced this pull request Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants