raspberrypi / pico-project-generator

Tool to automatically generate a Pico C SDK Project
BSD 3-Clause "New" or "Revised" License
297 stars 75 forks source link

Can't get gui to work Ubuntu 20.04 #37

Closed thegreenalien closed 3 years ago

thegreenalien commented 3 years ago

after running the following code -

sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential libssl-dev tk python3-tk

git clone https://github.com/raspberrypi/pico-project-generator.git

cd pico-project-generator

export PICO_SDK_PATH="/mnt/c/Users/john/pico/pico-sdk"

export DISPLAY=127.0.0.1:0

./pico_project.py --gui

fails - Traceback (most recent call last): File "./pico_project.py", line 1245, in RunGUI(sdkPath, args) # does not return, only exits File "./pico_project.py", line 242, in RunGUI root = tk.Tk() File "/usr/lib/python3.8/tkinter/init.py", line 2270, in init self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use) _tkinter.TclError: couldn't connect to display "127.0.0.1:0"

Any suggestions?

JamesH65 commented 3 years ago

Why have you set DISPLAY? IS that part of the instructions? (which instructions are you following?)

thegreenalien commented 3 years ago

I'm following https://github.com/garyexplains/examples/tree/master/Raspberry%20Pi%20Pico/C but I've used the latest version of Ubuntu so that the version of cmake is suitable and doesn't need to be built separately. I have noted that the WSL Ubuntu install defaults to WSL 2, I'll try converting WSL to version 1 and see if that makes any difference. Yes it does! All working fine under WSL v1.

lurch commented 3 years ago

Just as an FYI, there's not strictly any need to use WSL, as https://datasheets.raspberrypi.org/pico/getting-started-with-pico.pdf contains native instructions for Windows.