Suddenly I get this error

I’ve been running for a while, working okay,
Then this happens …
Whats wrong, I did not touch anything :slight_smile:

Processing esp-wrover-kit (framework: arduino; platform: espressif32; board: esp-wrover-kit)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
LibraryManager: Installing webthing-arduino
git version 2.20.1.windows.1
Cloning into 'c:\Users\Lars-Göran Lindström\Documents\PlatformIO\Projects\thingsExampleESP21\.piolibdeps\_tmp_installing-dk8cpn-package'...
remote: Enumerating objects: 44, done.
remote: Counting objects: 100% (44/44), done.
remote: Compressing objects: 100% (34/34), done.
remote: Total 44 (delta 5), reused 23 (delta 1), pack-reused 0
Unpacking objects: 100% (44/44), done.
LibraryManager: Installing id=64
Error: Traceback (most recent call last):
  File "c:\.platformio\penv\lib\site-packages\platformio\__main__.py", line 120, in main
    cli(None, None, None)
  File "c:\.platformio\penv\lib\site-packages\click\core.py", line 700, in __call__
    return self.main(*args, **kwargs)
  File "c:\.platformio\penv\lib\site-packages\click\core.py", line 680, in main
    rv = self.invoke(ctx)
  File "c:\.platformio\penv\lib\site-packages\click\core.py", line 1027, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\.platformio\penv\lib\site-packages\click\core.py", line 873, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\.platformio\penv\lib\site-packages\click\core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "c:\.platformio\penv\lib\site-packages\click\decorators.py", line 16, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "c:\.platformio\penv\lib\site-packages\platformio\commands\run.py", line 107, in cli
    result = (envname, ep.process())
  File "c:\.platformio\penv\lib\site-packages\platformio\commands\run.py", line 207, in process
    result = self._run()
  File "c:\.platformio\penv\lib\site-packages\platformio\commands\run.py", line 302, in _run
    self.verbose)
  File "c:\.platformio\penv\lib\site-packages\platformio\commands\run.py", line 325, in _autoinstall_libdeps
    ctx.invoke(cmd_lib_install, libraries=[lib], silent=not verbose)
  File "c:\.platformio\penv\lib\site-packages\click\core.py", line 508, in invoke
    return callback(*args, **kwargs)
  File "c:\.platformio\penv\lib\site-packages\click\decorators.py", line 26, in new_func
    return f(get_current_context().obj, *args, **kwargs)
  File "c:\.platformio\penv\lib\site-packages\platformio\commands\lib.py", line 103, in lib_install
    library, silent=silent, interactive=interactive, force=force)
  File "c:\.platformio\penv\lib\site-packages\platformio\managers\lib.py", line 352, in install
    force=force)
  File "c:\.platformio\penv\lib\site-packages\platformio\managers\package.py", line 723, in install
    pkg_dir = self._install_from_piorepo(name, requirements)
  File "c:\.platformio\penv\lib\site-packages\platformio\managers\lib.py", line 213, in _install_from_piorepo
    if app.get_setting("enable_ssl") else dl_data['url'], requirements)
  File "c:\.platformio\penv\lib\site-packages\platformio\managers\package.py", line 508, in _install_from_url
    dlpath = self.download(url, tmp_dir, sha1)
  File "c:\.platformio\penv\lib\site-packages\platformio\managers\package.py", line 178, in download
    dst_path = join(dest_dir, fname)
  File "c:\.platformio\penv\lib\ntpath.py", line 85, in join
    result_path = result_path + p_path
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf6 in position 13: ordinal not in range(128)

============================================================

An unexpected error occurred. Further steps:

* Verify that you have the latest version of PlatformIO using
  `pip install -U platformio` command

* Try to find answer in FAQ Troubleshooting section
  https://docs.platformio.org/page/faq.html

* Report this problem to the developers
  https://github.com/platformio/platformio-core/issues

============================================================

The terminal process terminated with exit code: 1

There seems to be a problem with the string conversion here: If I encode Lars-Göran Lindström using UTF16, the ö will be converted to a sequence containing 0xf6, so the error makes kindof sense. Is your PIO up-to-date?

Yes, everything is up to date. It worked last evening and when trying today, I got this error.

Can you pio run -t clean the project and retry? Well as another work-around I’d suggest cloning the ArduinoJSON library from GitHub - bblanchon/ArduinoJson: 📟 JSON library for Arduino and embedded C++. Simple and efficient. directly to your lib folder so that PIO doesn’t attempt to install it :confused:

My work around was to move the project into another place on my computer with no international characters in the file path.

Doing this move I noticed another “error” in Platformio. PlatformIO places projects in a folder under “current user” called Documents. That should be the system folder “Documents” but in my case PlatformIO are not using the system folder. It creates a folder by it own, called “Documents” placed under current user. So effectivly I have two folders called Documents, one system folder Documents and the other Documents created by PlatformIO.

As I said, it compiles, but it is not loading the firmware to the board. See below.

Linking .pioenvs\esp-wrover-kit\firmware.elf
Retrieving maximum program size .pioenvs\esp-wrover-kit\firmware.elf
Building .pioenvs\esp-wrover-kit\firmware.bin
Checking size .pioenvs\esp-wrover-kit\firmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [=         ]  12.1% (used 39768 bytes from 327680 bytes)
PROGRAM: [======    ]  60.2% (used 788566 bytes from 1310720 bytes)
esptool.py v2.6
Configuring upload protocol...
AVAILABLE: esp-prog, esptool, ftdi, 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...
Auto-detected: COM9
Uploading .pioenvs\esp-wrover-kit\firmware.bin
esptool.py v2.6
Serial port COM9
Connecting........_____....._____....._____....._____....._____....._____....._____

A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header
*** [upload] Error 2
========================================================================================================================================================================================================================= [ERROR] Took 35.86 seconds =========================================================================================================================================================================================================================
The terminal process terminated with exit code: 1

The wrover kit has two COM ports, one for JTAG and one for serial comms (and the serial bootloader). You shuold have two COM ports. The upper COM port is the correct one.

ahhh… as I often says… :slight_smile:

When you are digging your head into something you are often blind ( at least I am ) to the obvious.
I’ve have not set the upload_port in the platform.ini file. It have been working nicely for me because the auto detect have done a good job.

I have a 3D printer that mostly is turned off. It is using serial interface via USB. Now the printer was on and the auto detect chooses that port for upload …

When setting the correct port in the platform.ini, it started to work directly.

Thanks for putting my mind in the correct direction, and your patience :slight_smile:

Still, something happened with the international character stuff, old version of python ?

I open this case again because I have another error that seems be connected to international characters.
( Trying to run ESP-PROG according to this example ESP-Prog — PlatformIO latest documentation )

Processing esp32dev (framework: arduino; platform: espressif32; board: esp32dev)
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 > Espressif ESP32 Dev Module
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)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 30 compatible libraries
Scanning dependencies...
No dependencies
Retrieving maximum program size .pioenvsesp32devirmware.elf
Checking size .pioenvsesp32devirmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA: [ ] 4.1% (used 13336 bytes from 327680 bytes)
PROGRAM: [== ] 19.4% (used 253856 bytes from 1310720 bytes)
[SUCCESS] Took 3.74 seconds

undefinedError: Traceback (most recent call last):

File "<string>", line 70, in main
File "c:\.platformio\penv\lib\site-packages\click\core.py", line 700, in __call__
return self.main(*args, **kwargs)
File "c:\.platformio\penv\lib\site-packages\click\core.py", line 680, in main
rv = self.invoke(ctx)
File "c:\.platformio\penv\lib\site-packages\click\core.py", line 1027, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\.platformio\penv\lib\site-packages\click\core.py", line 873, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\.platformio\penv\lib\site-packages\click\core.py", line 508, in invoke
return callback(*args, **kwargs)
File "c:\.platformio\penv\lib\site-packages\click\decorators.py", line 16, in new_func
return f(get_current_context(), *args, **kwargs)
File "<string>", line 90, in cli
File "<string>", line 446, in spawn
File "<string>", line 336, in spawn
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf6 in position 886: ordinal not in range(128)

============================================================
An unexpected error occurred. Further steps:
* Verify that you have the latest version of PlatformIO using
`pip install -U platformio` command
* Try to find answer in FAQ Troubleshooting section
http://docs.platformio.org/page/faq.html
* Report this problem to support@pioplus.com
============================================================

What is your exact platformio.ini and the path to your project?

Path: C:\experimentalProjects\PlatformIO\Projects\debug_test

Platformio.ini
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
upload_port = COM6
monitor_port = COM6
monitor_speed = 115200
debug_tool = esp-prog
debug_port = com12

But the PlatformIO installation itself is in a different path?

I am not sure where platformIO is installed , default installation from VsCode.
In the project directory, there us a .pioenvs and a .vscode folder.
There is also a C:.platformio on my drive.

Referring to earlier problems with international characters, I am not sure if platformio have installed something under my user directory besides project folder.

Right this is where PlatformIO should be installed according to the above log

So, installation seem correct, no international characters in the project path, so why this error?

Best to open an issue at Issues · platformio/platformio-core · GitHub so that the devs can help you