Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Cannot read properties of undefined (reading 'vid') #103

Open
LazaroFilm opened this issue Nov 10, 2022 · 19 comments
Open

[BUG] Cannot read properties of undefined (reading 'vid') #103

LazaroFilm opened this issue Nov 10, 2022 · 19 comments
Labels
bug Something isn't working

Comments

@LazaroFilm
Copy link

Describe the bug
I have a RP2040-LCD-1.28 board with custom compiled CircuitPython installed. When trying to connect to the port, I get the error Cannot read properties of undefined (reading 'vid')

Desktop (please complete the following information):

  • MacOs Ventura 13.0
  • VsCode 1.73.1
@LazaroFilm LazaroFilm added the bug Something isn't working label Nov 10, 2022
@schwa
Copy link

schwa commented Dec 15, 2022

Same

@LazaroFilm
Copy link
Author

So after some digging, The board in question doesn't have an assigned valid VID/PID in its code yet. I have reached out to Waveshare and they said they were given an ID, but it has not been published yet. Until then, the plugin will not work. It's a shame we can't toggle off the VID/PID checkup from this plugin to use unidentified boards.
adafruit/circuitpython#7153

@codejoeo
Copy link

I'm getting the same error, but my case is a bit different. I'm using a Raspbery Pi Pico W.
The serial monitor will connect when I'm running Circuitpython 7.3.3. But when I upgrade to CircuitPython 8.0.0 Beta 6 I run into this same error.

@gkovacsp
Copy link

I can second that it is not working with Pico W and CP 8.0.0 beta6
Although I'm pretty sure it worked for a while I just can't recall when it stopped.

@byte4c
Copy link

byte4c commented Jan 12, 2023

I had the same issue with my Pico W but I've found a temporary workaround by manually adding it.

The following folder contains all the board-infos known by the extension
C:\Users\<username>\.vscode\extensions\joedevivo.vscode-circuitpython-0.1.19-win32-x64\boards

I copied the content of the Pico folder ( \0x239A\0x80F4) to the Pico W folder (\0x239A\0x8120).
I updated the board.pyi file to reflect it being a Pico W instead of a Pico by updating board name.

Secondly, in the boards folder is a 'metadata.json' file to wich I've added the Pico W data (based on Pico)

{
  "vid": "0x239A",
  "pid": "0x8120",
  "product": "Pico W",
  "manufacturer": "Raspberry Pi",
  "site_path": "raspberry_pi_pico_w",
  "description": "Raspberry Pi Pico W"
},

Once this is done, I can select my COM port and it is detected as the Pico W and I'm able to make a serial connection.

This repo also contains files to generate these board info files and it gets it's information from the circuitpython repository. The repository in question already contains the required information for the Pico W so I'm hoping that with a new release of this extension the new/updated boards information will just be included.. In the meantime, you can add it manually.

I'm assuming these steps could also work for adding other boards. As long as you have the VID/PID info by which the USB device will identify itself, it should work.

@LazaroFilm
Copy link
Author

Thanks! Nice bandaid solution while we wait for a fix.

@gkovacsp
Copy link

gkovacsp commented Jan 13, 2023

You can also use the following in a mac terminal (or probably in the command window of vscode):

screen /dev/tty.usbmodem1301 115200

Your tty.usbmodem1301 might have a different name, just ls /dev/tty* to find it

@djotaku
Copy link

djotaku commented Feb 19, 2023

Interestingly, I looked at @byte4c solution, but when I do Search CircuitPython board - it's there. But might it be there without the vid parameters that the program is expecting?

@LazaroFilm
Copy link
Author

It has been added recently after I emailed Waveshare. I haven't tried it since they added the ID, I have somehow misplaced this board 😅

@wyattbiker
Copy link

I have the same problem. I am using stock circuitpython and adafruit feather rp2040 with I2S on Linux Kubuntu. The info in the .vscode settings is correct. My serial port is dev/ttyACM0 and works with tio . Any workarounds? Works fine with Mu.

image

@LazaroFilm
Copy link
Author

LazaroFilm commented Aug 10, 2023

This error means that the PID (Product ID) of your board is not registered in the Product ID list. You need to go there and ask for your board to be registered with a PID then you will be able to get it to work. Until then, you can use MicroPython or Arduino...

@wyattbiker
Copy link

I am fine with using VSCode and tio as the terminal. Its just weird that the plugin requires this. As you can see in the settings of my screenshot, the PID and VID is available. Not sure why it has to be in another list.

@todbot
Copy link

todbot commented Aug 15, 2023

Also having this problem, on an officially supported CircuitPython board https://circuitpython.org/board/lolin_s3_mini/

Is there a way to turn off VID/PID detection and just have it open the dang serial port?

@wyattbiker
Copy link

Either that or allow programmer to put it in some config file

@LazaroFilm
Copy link
Author

That issue got me out of CircuitPython. I'm now focusing on Cpp and MicroPython.

@todbot
Copy link

todbot commented Aug 17, 2023

That issue got me out of CircuitPython. I'm now focusing on Cpp and MicroPython.

One can also turn just off the CircuitPython extension and use VSCode as a text editor for “code.py” and an open terminal window running “tio” to access the REPL. I find that works pretty well for my purposes.

@wyattbiker
Copy link

You don't have to turn off the circuitpython plugin. Just make sure you name your code.py to main.py to avoid the naming conflict with the python stdlib version. main.py runs at boot same as code.py so no problem there. Then run tio for the REPL part from the vscode terminal. E.g. tio /dev/ttyACM0

@tyeth
Copy link

tyeth commented Sep 3, 2023

To get the latest boards I forked the extension repo, and ran the scripts/build_stubs.sh which gave me an updated stubs and boards folder, copied over the extensions versions gives latest data. I've blocked those folders from gitignore and you can now just download a zip file of my fork, and copy the stubs and boards folders across.

I'm happy to update the fork whenever required, eventually with CI, but ping me if new board added to circuitpython and you want the latest boards/stubs.
https://github.com/tyeth/vscode-circuitpython/

@CombatVolcano
Copy link

bug after bug after bug after problem
circuitpython in VS code does NOT WORK IN 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants