OpenThermal / libseek-thermal

SEEK thermal compact camera driver supporting the thermal Compact, thermal CompactXR and and thermal CompactPRO
MIT License
293 stars 100 forks source link

cannot close and re-open LibSeek::SeekThermalPro #28

Closed pauledd closed 3 years ago

pauledd commented 6 years ago

Hi

After I opened the cam with:

if(!cam.open())
    {
        mBox->setText("Unable to open SeekThermal device");
        mBox->show();
        return 1;
    }

and I close it later with: cam.close(); I cannot open it with the first command again, I get the error

Error: SeekDevice already opened
Error: open failed

but I can clearly hear that the shutter closed on the cam.close command... I am doing it wrong?

maartenvds commented 6 years ago

Could be a bug, never reopened it myself :-p.

Achref-Dachraoui commented 6 years ago

Hi, To reopen the camera you can use the close function in seekdevice.cpp to close the usb interface. I defined a new function in seekcam. cpp like this and called it from seek_test_viewer.cpp.

In SeekCam.cpp

void closeDevice () { m_dev.close(); }

In seek_viewer.cpp

cam.closeDevice();

this tip worked for me.

pauledd commented 6 years ago

okay, thanks, that "dirty" fix works.. somehow almost always. I sometimes get a Error: expected first frame to have id 4 when I try to re-open the cam... so I have to press close again then it mostly works...