groupgets / GetThermal

Cross-platform USB thermal camera viewer
MIT License
228 stars 90 forks source link

GetThermal get's stuck on Raspberry PI 3 B+ #13

Open benbesen opened 5 years ago

benbesen commented 5 years ago

I'm running the GetThermal App on my Rasberry PI 3 B+. It all works fine, but after a while the image freezes. The command line keeps on outputting: -9UVC_GetAttribute failed I'm using the Purethermal2 board with a FLIR Lepton 2.5

kekiefer commented 5 years ago

I've heard another report of this. It's a problem specific to the raspberry pi, but I'm not an expert with this system so I couldn't guess what the problem would be. Please let me know if you learn anything and we can update the wiki page with any recommendations.

BigMuscle85 commented 5 years ago

We have the same problem. RPi3 B+ with Raspbian Lite installed (+X) and even when we write our own very simple application based on libuvc, this problem appears after the several seconds. With GetThermal, it happens too but not so often. Camera stops sending frames and any communication ends up with error code -9 (Pipe error). When the stream is stopped, all handles closed and application exited, the camera LED continues blinking. After restarting the app, there is still no image. If we perform FFC then, the image reappears but it gets broken again after a while.

Is there any known solution/workaroung for this? I can help with the problem debugging if anyone is interested.

BigMuscle85 commented 5 years ago

Tested on RPi 2 Model B and problem appears too. Also the same problem when streaming via VLC, so it is not related to GetThermal app but rather to the PureThermal board.

kekiefer commented 5 years ago

Or it's a problem with the raspberry pi hardware or drivers. I say this considering that I don't see reports of this happening on other systems. This would be good information to know.

BigMuscle85 commented 5 years ago

I believe there is some bottleneck on Raspberry (maybe memory bus?), because this problem appears mainly when HW load is increased. And very similar problem appears when running Lepton 3 over SPI - loss of sync when loading HW a bit.

However, there is surely some driver problem too. When this problem appears, the following lines appear in /var/log/kern.log and it is not able to recover from it. LED on board continues blinking fastly even when device handle is closed and application exited.

kernel: [21418.056754] Transfer to device 15 endpoint 0x1 frame 1099 failed - FIQ timed out. Data may have been lost.
kernel: [21421.932856] Transfer to device 15 endpoint 0x1 frame 879 failed - FIQ timed out. Data may have been lost.
kernel: [21443.020767] Transfer to device 15 endpoint 0x1 frame 1487 failed - FIQ timed out. Data may have been lost.
kernel: [21447.019344] uvcvideo: Non-zero status (-32) in status completion handler.
kekiefer commented 5 years ago

Do you have any ideas how we can move this forward?

BigMuscle85 commented 5 years ago

I'm afraid not. We tried many things and we were not able to get it work correctly, so we gave it up and moved to SPI connection.

BaNavyBlue commented 4 years ago

Any updates on this I'm having the exact same problem on 3b+ I just want to take stills.

kekiefer commented 4 years ago

@AntoneB there has been a change on the development branch of purethermal1-firmware that adds a lower bandwidth descriptor that helps on the newer rpi os. Also, GetThermal can now work against the upstream libuvc, rather than the GroupGets fork. These are both things worth trying.

  1. Build and install on your camera the PureThermal firmware from the development branch: https://github.com/groupgets/purethermal1-firmware/tree/development

  2. Build the master+libuvc-upstream branch of this repository. This branch no longer uses the groupgets libuvc fork, so make sure you install it first before building (sudo apt install libuvc-dev) : https://github.com/groupgets/GetThermal/tree/master%2Bupstream-libuvc

If you are just taking stills you might also have a look at the repo https://github.com/groupgets/purethermal1-uvc-capture (note that there is also a master+upstream-libuvc branch there, if you're using the python examples). To not use libuvc, there is also a v4l2 example that does some still capture (you will have to modify the source to have it capture 160x120 from the lepton 3).

xiaofeinot commented 4 years ago

Same problem on x64 ubuntu, using lapton2.5 and Pure Thermal Mini. Any advice? Thnaks

ghost commented 4 years ago

Hi, we got the same problem here on raspberry pi 3b+ and lepton 3.5, purethermal 2. It was working fine before and the freezing problem appeared when we updated the raspberry firmware with sudo rpi-update. Then I tried updating from raspbian stretch to buster, no effect. Also, the camera runs fine on classical desktop computer with Debian architecture. What do you think ? I will try your suggestions kekiefer as soon as I get the tools to flash a new firmware. I'll keep updating.

Update:

Update 2:

Uup115 commented 3 years ago

Hello, I'm using the Purethermal2 with a FLIR Lepton 3.5 on Ubuntu x64.
Freezes momentarily when I click, "Perform FFC". I see the following error:

UVC_GetAttribute failed: -9UVC_GetAttribute failed: -9UVC_GetAttribute failed: -9UVC_SetAttribute failed: -9UVC_SetAttribute failed: -9UVC_SetAttribute failed: -9Estimated / selected altsetting bandwith : 18 / 642.

Not sure if this is related to the aforementioned error.

Update: Karl Parks' project is really nice and works great (no errors for me). Requires some patience to get it running though. https://github.com/Kheirlb/purethermal1-uvc-capture

~~Additionally... If anyone is experiencing momentary freezes, occurring periodically/randomly, consider using "nice" to set the priority of the application. For example: sudo nice -n -5 python3 RecordIR_v18.3.py For me, this eradicates freezes.~~

I'm wrong about the "nice" solution.
In my case, Lepton has always been fully seated.

itsonlyaudio commented 3 years ago

Same here on ubuntu 20/x64. It has worked before, though, until I updated my python recently. Not sure if that has anything to do with anything.

Nope. Completely wrong! my Lepton module had become unseated! Hopefully this will help someone.

Uup115 commented 3 years ago

I've noticed the Lepton module makes a faint "tick" sound. This happens at 3-minute intervals when idling and streaming. Consequently, the stream freezes momentarily when this "tick" occurs. Perhaps, the freeze is only related to the Purethermal2 itself (firmware).

BaNavyBlue commented 3 years ago

The Click is a Shutter closing, they do that for refreshing the sensor periodically. If you watch it you can clearly see the shutter.

On Mon, Jan 18, 2021 at 8:46 PM Uup115 notifications@github.com wrote:

I've noticed the Lepton module makes a faint "tick" sound. This happens at 3-minute intervals when idling and streaming. Consequently, the stream freezes momentarily when this "tick" occurs. Perhaps, the freeze is only related to the Purethermal2 itself (firmware).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/groupgets/GetThermal/issues/13#issuecomment-762598374, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJTNRML5RYZACNMJJTCWPU3S2UFCPANCNFSM4GSNDDKA .

-- Antone A. Bajor Computer Engineering Electrical Engineering Minor abajor@ucsc.edu 415 - 244 - 6368 Baskin School of Engineering University of California Santa Cruz

Uup115 commented 3 years ago

So it seems. Please forgive my noob-ness.
The automatic shutter closure can be annoying when trying to record a video. Fortunately, there's a way to disable it.

BaNavyBlue commented 3 years ago

It's there for a reason, you will run into having less accurate measurements if you disable the shutter. It's not there for capturing a fixed exposure, it's there to help purge and drain the sensor of accumulated stray IR.

On Thu, Jan 21, 2021 at 6:11 PM Uup115 notifications@github.com wrote:

So it seems. Please forgive my noob-ness. The automatic shutter closure can be annoying when trying to record a video. Fortunately, there's a way to disable it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/groupgets/GetThermal/issues/13#issuecomment-765065452, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJTNRMN3LZTE6AH5IJMPFKDS3DNGRANCNFSM4GSNDDKA .

-- Antone A. Bajor Computer Engineering Electrical Engineering Minor abajor@ucsc.edu 415 - 244 - 6368 Baskin School of Engineering University of California Santa Cruz

Uup115 commented 3 years ago

Understood. But no harm in disabling the shutter temporarily while recording a video, correct?