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

What to change for Topdon TC001 camera? #9

Closed
Adam-yes opened this issue Jul 18, 2023 · 3 comments
Closed

What to change for Topdon TC001 camera? #9

Adam-yes opened this issue Jul 18, 2023 · 3 comments

Comments

@Adam-yes
Copy link

Adam-yes commented Jul 18, 2023

Hey LeoDJ, I'm truly amazed by your code, it's truly brilliant!

I'm currently trying to get the Topon TC001 up and running on Windows, and since it has the same data stream, it should work. However, I'm facing two issues:

  1. What do I need to specifically modify for the resolution and FPS?
  2. If I install the libusbK driver via Zadig, I can no longer run the default Topdon program as it stops functioning.

I noticed that someone was able to accomplish it using a Raspberry Pi (https://github.com/leswright1977/PyThermalCamera), but unfortunately, it doesn't work at all for Windows. Even with the added knowledge of separating the data stream that you provided, I haven't been successful in getting it to run.
I know this doesn't have much to do with your code and your camera, but I would greatly appreciate your expert opinion.

Best regards!

@LeoDJ
Copy link
Owner

LeoDJ commented Jul 21, 2023

Currently, my tool is pretty WIP and not finished yet.
It probably would be easier to modify Les' tool to run on Windows (I didn't see any Linux specific things on first glance, only a few behaviors that are different on Windows).

As for the TC001, it has the same USB VID/PID (and general behaviour) as the P2 Pro, so no changes should be needed on the viewer's side.

But you do need to "uninstall" the Topdon driver, if you installed their PC software, so it is recognized as a webcam again. There are multiple ways to accomplish this in the Windows device manager, but my favorite method is as follows.

You can select which driver Windows 10 uses for a device like this:

  • Find your device in the device manager (e.g. "TC001") and select it
  • View > Devices by connection
  • (Now if your device is inside a "USB Composite Device", select it instead)
  • Right click > Update driver > Browse my computer > Let me pick from a list

Here you can switch back and forth between the default webcam driver ("USB Composite Device") and the Topdon PC software driver ("TC001").
A P2 Pro with the default webcam driver will be called "USB Video", if you need to find it again. (I don't know how a TC001 is called without their driver).

For Les' tool and the base function of my tool (no commands like "high temperature range", once it's done), only the default Windows webcam driver is needed.

What I wrote in the readme only applies if you want to send those vendor commands.

@LeoDJ LeoDJ closed this as completed Jul 21, 2023
@LeoDJ
Copy link
Owner

LeoDJ commented Jul 21, 2023

This pull request should now work on Windows:
leswright1977/PyThermalCamera#4

@vincpad
Copy link

vincpad commented Aug 9, 2023

Hello !

TC001 owner here, I just tried to apply your modifications but python throws me this error after printing the desktop shortcuts

Traceback (most recent call last): File "C:\Users\user\Desktop\PyThermalCamera\src\tc001v4.2.py", line 108, in <module> frame = np.reshape(frame[0], (192*2, 256, 2)) # if there's a "can't reshape size xxxx into shape ..." error here, you most likely used the wrong --device ID File "<__array_function__ internals>", line 200, in reshape File "C:\Python310\lib\site-packages\numpy\core\fromnumeric.py", line 298, in reshape return _wrapfunc(a, 'reshape', newshape, order=order) File "C:\Python310\lib\site-packages\numpy\core\fromnumeric.py", line 57, in _wrapfunc return bound(*args, **kwds) ValueError: cannot reshape array of size 614400 into shape (384,256,2)

It may be caused by the difference of resolution between the two cameras.
Also, for info, the TC001 is called "USB Camera" when using the default driver on Windows ;)

Best regards !

EDIT : Nevermind, it was caused by the choice of device, for info for people that could encounter the same issue : call the script with --device <id> on Windows, ID being an int, for me 0 was the integrated camera and 1 was the TC001.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants