Linux - Incorrect project folder path generation

Hi there,

first of all, thank you for sharing your gread project with us, plattform IO hade my hobby dev-live a lot more convenient when compared to the old arduino IDE days.

I am currently facing a problem regarding project generation when working with core & home on ubuntu 20.4.
When creating a project from within the PlatformIO Home web interface all files will be created into the predefined path. But instead of forward slashes “/” backslashes "" are used to divide the path. This obviously doesnt work on Linux systems. The project structure than is generated with the backslashes on my root directy (e.g. “/data\downloads\test_platform_io_esp_32_project”).

I have installed Platform IO twice.
Once with pip install platformio and the other time with the recommended way Installer Script
Both end up with the same result.

Versions:
Core: 5.1.1
Home 3.3.4

I’m working with Ubuntu 20.04 too and have not experienced problems with this.

Can you show a log of what you mean? Does it create files with the name e.g. "src\main.cpp" instead of creating a file in the path src/main.cpp?

1 Like

Hi Max,

thank you for your quick response.
the issue is occuring when I create a project (and potentially when loading it as well) not when I add a new file.
Which logs do you mean?
I try to give you some more details:

  1. At the beginning the root-directory (“:/”) is not containing any platform-io related folder:
:/$ ls
bin   cdrom  dev  home  lib32  libx32      media  opt   root  sbin  snap  swap.img  tmp  var
boot  data   etc  lib   lib64  lost+found  mnt    proc  run srv   sys       usr
  1. Starting the server with the activated Installer Script virtualenv in the folder data/platform-io-testing:
    (penv) data/platform-io-testing:/$ pio home --host 127.0.0.1 --port 800

  2. open localhost:800/ and create a new project with the name “new_test_project” in the folder “data/platform-io-testing”

  3. It gets created and I recieve the message:

Project has been successfully initialized
Board: esp32doit-devkit-v1, framework: arduino, location: /data\platform-io-testing\new_test_project

Which is right when I now list the content of the root directory I find the directory:

 bin     data                      dev    lib     libx32       mnt    root   SmartHome_Services-backup   swap.img   usr
 boot   'data\platform-io-testing\new_test_project'   etc    lib32   lost+found   opt    run    snap                        sys        var
 cdrom  home   lib64   media        proc   sbin   srv                         tmp

But the folder is no where near to be found in /data/platform-io-testing/new_test_project
If I list the content of this incorrect path all the jucy platform-io files can befound (platformio.ini etc.)


When I copy the folder content in the actual intented path (/data/platform-io-testing/new_test_project) and then try to find the project in the web ui in platform-io home, I am not able to open it.

To make reproducing the problem easier, I have created a docker container (heavily inspired by sglahn:docker-platformio-core/Dockerfile at master · sglahn/docker-platformio-core · GitHub)

FROM python:3.8.5-slim

USER root

RUN pip install -U platformio==5.1.1 && \
    mkdir -p /workspace && \
    mkdir -p /.platformio && \
    chmod a+rwx /.platformio && \
    apt update && \
    apt install -y git && \
    apt-get clean autoclean && \
    apt-get autoremove --yes && \
    rm -rf /var/lib/{apt,dpkg,cache,log}/
    
USER 1000
WORKDIR /workspace
EXPOSE 800

ENTRYPOINT ["pio", "home", "--host", "0.0.0.0", "--port", "800"]
docker build -t platform-io .
docker run -p 8403:800 --name platform-io -v %LOCAL_PATH_TO_PROJECTS%:/Documents/PlatformIO/Projects -d -it platform-io 
docker logs -f platform-io

Here the exact same Problem occures.

Thank you very much,
Tarem

Does this occur too when you execute pio upgrade --dev before issuing any pio commands?

1 Like
PlatformIO has been successfully upgraded to 5.2.0a6

Yes, unfortunately the behaviour has not changed
Board: esp32doit-devkit-v1, framework: arduino, location: /data\platform-io-testing\new_test_project

Please report this to Issues · platformio/platformio-core · GitHub along with the output of pio system info in the environment where it fails o_o.

1 Like

Thank you for your support!

I have created a new issue.