VScode installieren für Sonoff Tasmota Flashen

  • So wie ich sehe haben einige sowie ich auch Probleme Atom mit PlatformIO zu betreiben da es wie es aussieht nicht mehr Unterstütz wird.

    Daher versuche ich mal zu erklären wie ich das nun gemacht habe mit VScode.

    sorry für die Schreibfehler aber ich muss das auf der schnelle hier rein Tippern.

    VSCode herunter Laden

    https://code.visualstudio.com/

    und ausführen nach der Installation

    auf Erweiterungen klicken

    in der Suche Platform eingeben

    und dann auf Installieren gehen.

    Sollte nun so aussehen

    Nun im browser aktuellen Tasmota Source code Zip runter laden und entpacken

    https://github.com/arendst/Sonoff-Tasmota/releases

    In VScode icon Explorer Klicken

    Ordner Öffnen anklicken


    Entpackten Tasmota Ordner auswählen


    Datei platformio.ini auswählen

    Com Schnittstelle angeben die die Flash Hardware hat

    Weiter unten werden die Flash Versionen aufgeführt die zur Verfügung stehen.

    Eine Auswählen und die restlichen Blöcke entfernen.

    auf Datei Speichern gehen

    nun im Verzeichniss Sonoff gehen und die Datei user_config.h aufrufen und die Einstellungen für das Wlan vornehmen


    nun strg + Alt + B für Build ausführen

    nun stellt VScode die Daten zum Flashen zusammen wenn man es so nennen möchte.

    Es erscheint ein Fenster wo der vorgang angezeigt wird

    Einmal editiert, zuletzt von Buko (25. August 2018 um 13:19)

  • Am COM Port muss man nix machen, wenn der Flasher auf 5 erkannt wird, ist absolut das selbe wie bei Atom. Ich hab's ja schon im anderen Thread geschrieben, da die Oberfläche von VSCode der von Atom recht ähnlich ist (Buttons sind unten nicht mehr links) ist es auch keine große Umstellung sich an den Rest zu gewöhnen.

    Vorgehensweise zum Ordner importieren, compilieren und flashen ist gleich und die Anleitung wie man VSCode installiert, seht ja auch im Link den Nils im andern Thread gepostet hat. Also alles schon bekannt hier ;)

  • Hallo, und was bedeutet diese Meldung, weil einen Upload kann ich nicht machen. :(

    File "C:\Users\mymey\.platformio\penv\lib\site-packages\serial\__init__.py", line 88, in serial_for_url

    instance.open()

    File "C:\Users\mymey\.platformio\penv\lib\site-packages\serial\serialwin32.py", line 62, in open

    raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))

    serial.serialutil.SerialException: could not open port '/dev/cu.SLAB_USBtoUART': FileNotFoundError(2, 'Das System kann den angegebenen Pfad nicht finden.', None, 3)

    *** [upload] Error 1

    ============================================================================================= [FAILED] Took 66.84 seconds =============================================================================================

    Environment Status Duration

    ------------- -------- ------------

    tasmota IGNORED

    tasmota-DE IGNORED

    tasmota-debug IGNORED

    tasmota32 IGNORED

    tasmota32-DE FAILED 00:01:06.839

    ======================================================================================== 1 failed, 0 succeeded in 00:01:06.839 ========================================================================================

    The terminal process "C:\Users\mymey\.platformio\penv\Scripts\platformio.exe 'run', '--target', 'upload'" terminated with exit code: 1.

    Terminal will be reused by tasks, press any key to close it.

    Gruß

    MyMeyer

  • Dann eben der übliche Rest, nicht im Flashmodus, RX TX passt nicht, USB Kabel defekt, USB Konverter abgeraucht. Eins davon ist es immer zu 100%.

    Alternativ ist der ESP hin.

    Tja das kann nicht sein, da ich mit dem gleichen Kabel und RX/TX Einstellungen usw. über FLASHESP eine fertige Bin flashen kann. Leider brauche ich eine angepasste Version deswegen nutz ich VSCode. Benötige ich damit meinen Stromzähler SML auslesen kann. Ausser jemand hat eine Fertige Version für mich.

    Achja gleicher Fehler auf zwei verschiedene Windows Rechner.

    Gruß

    MM

  • Was hindert Dich dann daran, mit VSCode nur zu kompilieren und dann das bin wie gewohnt mit FLASHESP zu zu flashen, wobei ich das Tool noch nie gehört habe und man das am besten mit dem Tasmotizer und vorherigen Löschen des Flash erledigt.

  • Wo siehst Du, dass der nicht fertig kompiliert? Der Fehler bezieht sich doch auf den Upload. OK, da fehlt die Hälfte vom Log und wenn er bei mir mal das Kompilieren nicht auf die Reihe bekommt, sieht das etwas anders aus.

  • tasmota32-DE FAILED 00:01:06.839

    War der Meinung dass da zumindest OK stehen würde. Kann gut sein dass ich mich da irre. Schon lange keinen Upload mit VSC mehr gemacht.

    Was mich jetzt irritiert ist die "32" im Dateinamen ...

    Ich glaube nicht dass die Script (und somit die Zähler) Geschichte in Tasmota32 (ESP32) schon funktioniert.

  • Wo siehst Du, dass der nicht fertig kompiliert? Der Fehler bezieht sich doch auf den Upload. OK, da fehlt die Hälfte vom Log und wenn er bei mir mal das Kompilieren nicht auf die Reihe bekommt, sieht das etwas anders aus.

    Hi, also so sieht das komplette Log aus:

    Nach strg-alt+b

    Nach strg-alt+b

    > Executing task: C:\Users\mymey\.platformio\penv\Scripts\platformio.exe run <

    Processing tasmota32-DE (framework: arduino; platform: espressif32@1.12.4; board: esp32cam)

    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    ...

    |-- <Joba_Tsl2561> 2.0.10

    | |-- <Wire> 1.0.1

    |-- <Unishox Compressor Decompressor highly customized and optimized for ESP8266 and Tasmota> 1.0

    |-- <Wire> 1.0.1

    Building in release mode

    *** use provided user_config_override.h as planned ***

    Compiling .pioenvs\tasmota32-DE\src\tasmota.ino.cpp.o

    In file included from C:/Sonoff-Tasmota-universal8/tasmota/tasmota.ino:41:0:

    tasmota\my_user_config.h:39:0: warning: "USE_CONFIG_OVERRIDE" redefined

    #define USE_CONFIG_OVERRIDE // Uncomment to use user_config_override.h file. See README.md

    ^

    <command-line>:0:0: note: this is the location of the previous definition

    In file included from tasmota\my_user_config.h:807:0,

    from C:/Sonoff-Tasmota-universal8/tasmota/tasmota.ino:41:

    tasmota\user_config_override.h:24:2: warning: #warning **** user_config_override.h: Using Settings from this File **** [-Wcpp]

    #warning **** user_config_override.h: Using Settings from this File ****

    ^

    C:/Sonoff-Tasmota-universal8/tasmota/xdrv_10_scripter.ino:116:17: note: #pragma message: script compression option used

    #pragma message "script compression option used"

    ^

    Linking .pioenvs\tasmota32-DE\firmware.elf

    Retrieving maximum program size .pioenvs\tasmota32-DE\firmware.elf

    Building .pioenvs\tasmota32-DE\firmware.bin

    Checking size .pioenvs\tasmota32-DE\firmware.elf

    Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"

    RAM: [== ] 17.9% (used 58696 bytes from 327680 bytes)

    Flash: [====== ] 57.9% (used 1177058 bytes from 2031616 bytes)

    esptool.py v2.8

    bin_map_copy([".pioenvs\tasmota32-DE\firmware.bin"], [".pioenvs\tasmota32-DE\firmware.elf"])

    bin_gzip([".pioenvs\tasmota32-DE\firmware.bin"], [".pioenvs\tasmota32-DE\firmware.elf"])

    ========================================================================== [SUCCESS] Took 76.92 seconds ==========================================================================

    Environment Status Duration

    ------------- -------- ------------

    tasmota IGNORED

    tasmota-DE IGNORED

    tasmota-debug IGNORED

    tasmota32 IGNORED

    tasmota32-DE SUCCESS 00:01:16.920

    =========================================================================== 1 succeeded in 00:01:16.920 ===========================================================================

    Terminal will be reused by tasks, press any key to close it.

  • Wo siehst Du, dass der nicht fertig kompiliert? Der Fehler bezieht sich doch auf den Upload. OK, da fehlt die Hälfte vom Log und wenn er bei mir mal das Kompilieren nicht auf die Reihe bekommt, sieht das etwas anders aus.

    Hier der zweite Teil von strg-alt-u

    Spoiler anzeigen

    > Executing task: C:\Users\mymey\.platformio\penv\Scripts\platformio.exe run --target upload <

    Processing tasmota32-DE (framework: arduino; platform: espressif32@1.12.4; board: esp32cam)

    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    Verbose mode can be enabled via `-v, --verbose` option

    CONFIGURATION: https://docs.platformio.org/page/boards/es…2/esp32cam.html

    PLATFORM: Espressif 32 1.12.4 > AI Thinker ESP32-CAM

    HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash

    DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)

    PACKAGES:

    - framework-arduinoespressif32 3.10004.200129 (1.0.4)

    - tool-esptoolpy 1.20800.0 (2.8.0)

    - tool-mkspiffs 2.230.0 (2.30)

    - toolchain-xtensa32 2.50200.80 (5.2.0)

    Converting tasmota.ino

    LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf

    LDF Modes: Finder ~ chain, Compatibility ~ soft

    Found 85 compatible libraries

    Scanning dependencies...

    Dependency Graph

    |-- <ESP32-to-ESP8266-compat> 0.0.2

    .

    .

    .

    |-- <Unishox Compressor Decompressor highly customized and optimized for ESP8266 and Tasmota> 1.0

    |-- <Wire> 1.0.1

    Building in release mode

    *** use provided user_config_override.h as planned ***

    Compiling .pioenvs\tasmota32-DE\src\tasmota.ino.cpp.o

    In file included from C:/Sonoff-Tasmota-universal8/tasmota/tasmota.ino:41:0:

    tasmota\my_user_config.h:39:0: warning: "USE_CONFIG_OVERRIDE" redefined

    #define USE_CONFIG_OVERRIDE // Uncomment to use user_config_override.h file. See README.md

    ^

    <command-line>:0:0: note: this is the location of the previous definition

    In file included from tasmota\my_user_config.h:807:0,

    from C:/Sonoff-Tasmota-universal8/tasmota/tasmota.ino:41:

    tasmota\user_config_override.h:24:2: warning: #warning **** user_config_override.h: Using Settings from this File **** [-Wcpp]

    #warning **** user_config_override.h: Using Settings from this File ****

    ^

    C:/Sonoff-Tasmota-universal8/tasmota/xdrv_10_scripter.ino:116:17: note: #pragma message: script compression option used

    #pragma message "script compression option used"

    ^

    Linking .pioenvs\tasmota32-DE\firmware.elf

    Retrieving maximum program size .pioenvs\tasmota32-DE\firmware.elf

    Building .pioenvs\tasmota32-DE\firmware.bin

    Checking size .pioenvs\tasmota32-DE\firmware.elf

    Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"

    RAM: [== ] 17.9% (used 58696 bytes from 327680 bytes)

    Flash: [====== ] 57.9% (used 1177058 bytes from 2031616 bytes)

    esptool.py v2.8

    bin_map_copy([".pioenvs\tasmota32-DE\firmware.bin"], [".pioenvs\tasmota32-DE\firmware.elf"])

    bin_gzip([".pioenvs\tasmota32-DE\firmware.bin"], [".pioenvs\tasmota32-DE\firmware.elf"])

    Configuring upload protocol...

    AVAILABLE: esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa

    CURRENT: upload_protocol = esptool

    Looking for upload port...

    Use manually specified: /dev/cu.SLAB_USBtoUART

    Uploading .pioenvs\tasmota32-DE\firmware.bin

    esptool.py v2.8

    Serial port /dev/cu.SLAB_USBtoUART

    Traceback (most recent call last):

    File "C:\Users\mymey\.platformio\packages\tool-esptoolpy\esptool.py", line 3201, in <module>

    _main()

    File "C:\Users\mymey\.platformio\packages\tool-esptoolpy\esptool.py", line 3194, in _main

    main()

    File "C:\Users\mymey\.platformio\packages\tool-esptoolpy\esptool.py", line 2889, in main

    esp = chip_class(each_port, initial_baud, args.trace)

    File "C:\Users\mymey\.platformio\packages\tool-esptoolpy\esptool.py", line 237, in __init__

    self._port = serial.serial_for_url(port)

    File "C:\Users\mymey\.platformio\penv\lib\site-packages\serial\__init__.py", line 88, in serial_for_url

    instance.open()

    File "C:\Users\mymey\.platformio\penv\lib\site-packages\serial\serialwin32.py", line 62, in open

    raise SerialException("could not open port {!r}: {!r}".format(self.portstr, ctypes.WinError()))

    serial.serialutil.SerialException: could not open port '/dev/cu.SLAB_USBtoUART': FileNotFoundError(2, 'Das System kann den angegebenen Pfad nicht finden.', None, 3)

    *** [upload] Error 1

    =========================================================================== [FAILED] Took 98.74 seconds ===========================================================================

    Environment Status Duration

    ------------- -------- ------------

    tasmota IGNORED

    tasmota-DE IGNORED

    tasmota-debug IGNORED

    tasmota32 IGNORED

    tasmota32-DE FAILED 00:01:38.738

    ====================================================================== 1 failed, 0 succeeded in 00:01:38.738 ======================================================================

    The terminal process "C:\Users\mymey\.platformio\penv\Scripts\platformio.exe 'run', '--target', 'upload'" terminated with exit code: 1.

    Terminal will be reused by tasks, press any key to close it.

  • irgendwie sieht das anders aus wie wenn ich was kompiliere, wobei im ersten Teil noch "tasmota32-DE SUCCESS 00:01:16.920" und im zweiten wird das FAIL.

    Liegt denn eine bin im entsprechenden Ordner wenn er fertig ist und hast mal nur kompiliert ohne gleich zu flashen? Dann siehst ja wo es klemmt.