RfidResearchGroup / ChameleonUltra

The new generation chameleon based on NRF52840 makes the performance of card emulation more stable. And gave the chameleon the ability to read, write, and decrypt cards.
https://chameleonultra.com
GNU General Public License v3.0
922 stars 153 forks source link

Port autodetect does not work on WSL1 #20

Closed gentilkiwi closed 1 year ago

gentilkiwi commented 1 year ago

https://github.com/RfidResearchGroup/ChameleonUltra/blob/939df3f0aa9525d9754a011228cc6c0bda087d8b/software/script/chameleon_cli_unit.py#L200

Chameleon Connect fail: 'NoneType' object has no attribute 'startswith'

Not working on WSL1, it seems @iceman1001 use a PowerShell hack to detect it under Windows env. then pass results to scripts

xianglin1998 commented 1 year ago

This looks like there's no manufacturer information available

xianglin1998 commented 1 year ago

I have installed wsl&&ubuntu and used usbipd for USB device forwarding. Currently, my test results are normal, and I suspect that you cannot recognize the manufacturer information because the driver is not installed correctly, resulting in incorrect acquisition of the manufacturer information or description information.

xianglin1998 commented 1 year ago

image You can use lsusb to list all devices and check if chameleonultra is loaded correctly.

gentilkiwi commented 1 year ago

In WSL1, serial ports are natively redirected/exposed

GameTec-live commented 1 year ago

In WSL1, serial ports are natively redirected/exposed

so, ofc this is still an issue and ig its also partly mine, because i tried implementing that autodetect, but why not use wsl 2? isnt wsl 1 now not even supported anymore? also; compiling and running in proxspace should work too ;)

gentilkiwi commented 1 year ago

I don't blame anyone @GameTec-live ;)

At the moment it's still supported: https://devblogs.microsoft.com/commandline/wsl-2-post-build-faq/#what-will-happen-to-wsl-1-will-it-be-abandoned And why use it ? Especially because of serial native supports, it works out of the box without latencies!

Foxushka commented 1 year ago

but why not use wsl 2

Because minimum required windows for wsl2 is 20xx. Windows 10 LTSC 2019 based on 18xx. Newer versions of windows are just unusable buggy shit

GameTec-live commented 1 year ago

its very likely my fault, autodetect doesnt even work in normal windows, it should be fixed with pr #26

gentilkiwi commented 1 year ago

It does not work with WSL1

it seems @iceman1001 use a PowerShell hack to detect it under Windows env. then pass results to scripts

gentilkiwi commented 1 year ago

In Windows native Python 3:

{'device': 'COM15',
 'name': 'COM15',
 'description': 'Périphérique série USB (COM15)',
 'hwid': 'USB VID:PID=6868:8686 SER=000000000000',
 'vid': 26728,
 'pid': 34438,
 'serial_number': '000000000000',
 'location': None,
 'manufacturer': 'Microsoft',
 'product': None,
 'interface': None}

In Windows WSL1 Python3:

{'device': '/dev/ttyS15',
 'name': 'ttyS15',
 'description': 'n/a',
 'hwid': 'n/a',
 'vid': None,
 'pid': None,
 'serial_number': None,
 'location': None,
 'manufacturer': None,
 'product': None,
 'interface': None,
 'usb_device_path': None,
 'device_path': None,
 'subsystem': None,
 'usb_interface_path': None}

That's why @iceman1001 bless us with PowerShell in: https://github.com/search?q=repo%3ARfidResearchGroup/proxmark3%20get_pm3_list_WSL&type=code

xianglin1998 commented 1 year ago

A recent PR #26 has attempted to solve this problem, you can give it a try. ^.^

GameTec-live commented 1 year ago

A recent PR #26 has attempted to solve this problem, you can give it a try. ^.^

if wsl1 doesnt expose anything (as shown above), no vid, pid, etc, i think its not possible to identify a chameleon?

nieldk commented 1 year ago

You probably need to use usbipd

https://github.com/dorssel/usbipd-win

GameTec-live commented 1 year ago

they are on wsl one, not 2. cool idea though

Msprg commented 1 year ago

A recent PR #26 has attempted to solve this problem, you can give it a try. ^.^

if wsl1 doesnt expose anything (as shown above), no vid, pid, etc, i think its not possible to identify a chameleon?

Perhaps take a peek at how RRG/pm3 client does it. Seems to work reliably on WSL1 at least on my setup.

GameTec-live commented 1 year ago

A recent PR #26 has attempted to solve this problem, you can give it a try. ^.^

if wsl1 doesnt expose anything (as shown above), no vid, pid, etc, i think its not possible to identify a chameleon?

Perhaps take a peek at how RRG/pm3 client does it. Seems to work reliably on WSL1 at least on my setup.

problem being: pm3 is in c, this is python

m-kozlowski commented 1 year ago

https://github.com/RfidResearchGroup/proxmark3/blob/81a0739153aa2dce7af05e273382b889b777f0c3/pm3#L182

xianglin1998 commented 1 year ago

@gentilkiwi Now have a pr to resolve your problem, can you test it and feedback results, thanks.