Need an Help to to read the Laptops/TAB's VID and PID using STM32F103 Series MCU Via Type C usb
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-20 2:47 AM
Hi Team,
We are using the STM32F103RDT6 microcontroller in one of our projects. The end-user application of our project is a laptop vending machine. Simply put, students can acquire laptops/tablets by using their IDs. However, we are facing difficulties in verifying whether the laptops/tablets returned by the students are the same devices they took. All of the devices are Type-C only.
Therefore, we are planning to automatically read the Vendor ID (VID) and Product ID (PID) of the devices (laptops/tablets) using the STM32 microcontroller. Can you suggest or help us with the procedure to make this happen? Is it possible to read the Product ID using STM32?
- Labels:
-
STM32F1 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-20 2:53 AM
Surely, the VID & PID are properties of the USB Device (ie, your STM32) - not the Host (ie, the laptop) ?
:thinking_face:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-20 10:58 PM
It sounds like, you have a misunderstanding about USB VID and PID:
as Andrew Neil has pointed out: the VID and PID are provided by a USB Device:
If you connect a laptop with an USB Device - this USB device (your STM32 MCU) will send the VID and PID:
- but these VID and PID are usually associated with a driver which the laptop has to activate (in order to talk to the STM32 MCU): the laptop needs to get the USB Enumeration from the device, e.g. if is it a Mass Storage Device (USB memory stick), a VCP UART, a HID device (mouse and keyboard) or something else.
- and "hijacking" an USB VID is not "legal":
every vendor of USB Devices (e.g. Memory Sticks) has a VID: this is registered, and these companies might pay for the database entry. You cannot simply "fake" or "hijack" a vendor ID (it is not legal; it belongs to a company "following the rules" for USB product registration)
So, I assume this use case:
- all the laptops are connected on an STM32 MCU which should "assign" a unique ID to every laptop (before rented or taken away)
- if a student grabs a laptop - you want to verify later, when they return the laptop, if is the "same" one.
What you could do:
- all the laptops are connected to an STM32 MCU (via USB)
- but the laptop "talks" to the STM32 MCU (e.g. via VCP UART)
- and every laptop receives a Unique ID from STM32 MCU - check out what UUID is!
- Such a UUID can be a combination of time, data, a random number...
- store this UUID, assigned by a STM32 MCU somewhere on the laptop (e.g. in registry): you need a special application running on laptop, the users have to start, e.g. a "RentMeApp"
- this stores such an UUID, generated by a STM32 MCU (when connected via USB to it)
- Later, when returning the laptops: you start a SW App again, on laptop, which looks for the stored UUID
and displays it (e.g. an App "ReturnMeApp": it will display (and maybe decode) the UUID assigned and stored - now you can check which laptop was returned - You need SW on your laptop: STM32 with USB cannot "solve" your issue.
(all laptops would connect to the same STM32 MCU with the same VID and PID - you need other means to realize which laptop is which, e.g. via UUID, generated by the STM32 MCU)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-02-21 1:10 AM - edited ‎2024-02-21 1:23 AM
@tjaekel wrote:
- You need SW on your laptop: STM32 with USB cannot "solve" your issue [alone].
^^^ This! ^^^
Some other things often used for creating a "Unique ID" for a computer include:
- Hard driver serial number
- Ethernet / WiFi / BT MAC(s)
https://stackoverflow.com/questions/99880/generating-a-unique-machine-id
I guess, on a modern PC, the TPM could be used?
