CLI to determine platform type

I am wondering if anyone knows of a way to use the CLI to determine the platform type. Let’s say you connect a Boron to the USB port. Is there a way to know it’s a Boron? And then let’s say you connect a P2 to the USB port. Is there a way to know if its a P2 using the CLI?

I am looking at a way to automate our programming based on the platform type.

You can try particle serial identify.
But even without CLI you can find out via the USB VID/PID combination.
Vendor ID 2B04 stands for Particle and Product ID C0xy denotes the product where xy reflects the hex value of platform ID as found here (e.g. C006 indicates a Photon, C00D would be Boron)

1 Like

Thanks I tried the serial Identify but returns the below.
image

When I have 2 devices plugged in, it does recognize the device types, particle serial identify seems to have an issue possibly.

image

Not entirely sure what seems to be the issue :confused:
In both screenshots it appears CLI is giving you the device/platform type as expected.

  1. image

  2. image

Sorry I don’t think I explained this well.

The types are only given if I have 2 or more devices connected at a time to only select as options. When I select a device as an option I get the below.

If I only have one device connected I also get the below.

image

That’s odd. Maybe particle serial inspect will work better.

Alternatively you could go with my other suggestion and let Windows tell you what it knows about the attached devices. For this you won’t even need to put the device into a particular mode as it will list the USB endpoints provided by Particle devices.

wmic path CIM_LogicalDevice where "DeviceID like 'USB\\VID_2B04%'" get DeviceID, Name

(giving you multiple responses for one device - you can refine the where clause tho’)

I like the windows approach, its very fast. Thanks for your help!

Here are some more details for incorporation at a later date.

Using this (Electron):
wmic path CIM_LogicalDevice where "DeviceID like 'USB\\VID_2B04&PID_C00A&MI_02%'" get DeviceID, Name

Returns:

Using this (E SoM X):
wmic path CIM_LogicalDevice where "DeviceID like 'USB\\VID_2B04&PID_C00F&MI_02%'" get DeviceID, Name

Returns:

If it's not detected the return is:

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.