pyControl / code

pyControl GUI and framework code
https://pycontrol.readthedocs.io
GNU General Public License v3.0
22 stars 20 forks source link

Can't setup the connection #121

Open ChangQing-SH opened 6 months ago

ChangQing-SH commented 6 months ago

Hi,

I try to use the v2.0.1, and it always shows no setup found. 微信图片_20240418100339

but I can use the putty to connect the pyboard, 微信图片_20240418100600

my os is win11 home version, and the pyboard usb driver is always Microsoft generic one, and I can't update with the pybcdc.inf

How can figure it out?

alustig3 commented 6 months ago

Hi @ChangQing-SH,

Can you go to the Windows Device Manager and check what appears in the under the COM ports? This is what it looks like on our computer:

SCR-20240417-tkdu
ChangQing-SH commented 6 months ago

Hi @alustig3 image

alustig3 commented 6 months ago

Try editing line 195 of source/gui/GUI_main.py

replace "USB Serial Device" with the characters you have. Save the file and then restart pyControl.

please let us know if that fixes the problem.

ChangQing-SH commented 6 months ago

thanks, it can connect the hardware now. so it is because of the Chinese characters. but I got a new error when I try to upload the blinker task, there is no more debug info, image

alustig3 commented 6 months ago

great glad the hardware is connecting. Could you please share your solution by pasting or attaching your new code?

for the error, let's check if your error log has helpful information. You can view the error log by going to View->Error Log or pressing Ctrl + e

ThomasAkam commented 6 months ago

Hi @ChangQing-SH,

Regarding your first problem of not being able to connect to the pyboard due to the pyboard name in the Device Manager being different when the computer language is not English, annother way to resolve this issue without modifying the code is to install the Micropython USB drivers rather than using the generic windows USB serial device drivers, this should cause the pyboard to appear in the device manager as a 'Pyboard USB Comm port' irrespective of what language the computer operating system is set to. For more information see the troubleshooting docs here: https://pycontrol.readthedocs.io/en/latest/user-guide/troubleshooting/#board-does-not-show-up-in-gui

ChangQing-SH commented 6 months ago

@ThomasAkam Right,actually I tried to install the micropython USB drivers, but the windows always show that the current driver is the best for the device, so I can't update the driver from the pyboard. @alustig3 , when I click the error log, it shows Error: uncaught exception of type: <class 'UnicodeDecodeError'>,

alustig3 commented 6 months ago

hmm, my guess is that the UnicodeDecodeError problem is still related to the computer's OS language. I'm not sure what the solution is. Hopefully @ThomasAkam has some more insight. Somehow getting the Micropython Drivers installed is my best suggestion. Sorry if this isn't much help

ThomasAkam commented 6 months ago

Hi @ChangQing-SH,

I think the solution to this is to get the Micropython USB drivers installed and then revert the pycontrol code back to its original state before you edited it. To do this you need to do the following:

  1. The micropython USB driver is unsigned so to be able to install it you need to use the windows advanced boot menu to disable driver signature enforcement as detailed here: https://www.maketecheasier.com/install-unsigned-drivers-windows10/
  2. Plug in the pyboard. If it does not appears in the computer filesystem as a flash drive (e.g. because you have disabled the pyboard flash drive using the pycontrol board config menu), reset the pyboard filesystem by following the instruction here: https://docs.micropython.org/en/latest/pyboard/tutorial/reset.html#factory-reset-the-filesystem
  3. Open the windows device manager and locate the pyboard under 'Ports COM&LTP', right click it and select 'Update driver'. Select: 'Browse my computer for drivers' -> 'Let me pick from a list of available drivers on my computer' -> 'Have Disk'.
  4. In the 'Locate file' dialog navigate the the pyboard flash drive PYBFLASH, select the file 'pybcdc.inf' and click 'Open', then select the Model 'Pyboard USB Comm Port' and install the driver.
ChangQing-SH commented 6 months ago

@ThomasAkam Thanks, actually I did it this way, I don't why it doesn't work, When I did the last step, select the file 'pybcdc.inf', the system always shows : Best Driver Software Is Already Installed. anyway, I tested the pycontrol on my VMware with ubuntu. and it works well.
@alustig3 thanks, you are right, it should be still related to the computer's OS language.