groupgets / purethermal1-firmware

Reference firmware for PureThermal 1 FLIR Lepton Dev Kit
MIT License
126 stars 64 forks source link

Issues running purethermal1 on pi zero 2w #56

Open techmaticsnz opened 1 year ago

techmaticsnz commented 1 year ago

Hello,

We've been using your thermal board for some time now so just wanted to thank you for the continued support that's been given over using this particular product in our line of robots.

I'm experiencing a stressful issue at the moment trying to stream the purethermal1 over wifi with flask. (flir lepton 3.5)

If I start up the program I get this error (over and over) [ WARN:0@11.195] global /tmp/pip-wheel-nz49_ez6/opencv-python-headless_488dea44cb7d406baf80df0bfc388ff9/opencv/modules/videoio/src/cap_v4l.cpp (1013) tryIoctl VIDEOIO(V4L2:/dev/lepton_camera): select() timeout.

I may get a single frame to display every minute.

The board is just running one purethermal device.

We've tried using the product, same program, on a pi3b, also a pi zero, and a pi 4.

We only have access to one pi zero 2, so are looking for an alternative solution to determine how to fix than simply replacing pi zero 2 (as you are aware limited numbers world wide)

What should we be using and is there an alternative way to stream the device over wifi?

Regards

Nathan

techmaticsnz commented 1 year ago

I've done a little digging. Can I get some help with what could possibly be happening?

This is the dmesg log when running the opencv program. https://pastebin.com/FeypS204

I've tried using libuvc version of getting frames and found out some more helpful information. using this program:

https://pastebin.com/RUAkVxEJ

it appears that after 30 seconds it can't find any frames from the callback and closes.

Tried camera on a pi zero, Pi3b, and Pi4b. Tried the camera on the same program on Pi3b and Pi4b, works. It appears to be something specific to the pi zero 2. It appears to be an issue with the start_streaming function.

as logs of this show:

device opened!
Version gpp: 3.3.26 dsp: 3.3.26
FLIR part #: b'500-0771-01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
FLIR serial #: b'\xcdT7\x01\x00\x00\x00\x00'
format: b'UYVY'
  frame 160x120 @ 9fps
format: b'Y16 '
  frame 160x120 @ 9fps
  frame 160x122 @ 9fps
format: b'Y8  '
  frame 160x120 @ 9fps
format: b'RGBP'
  frame 160x120 @ 9fps
format: b'}\xeb6\xe4'
  frame 160x120 @ 9fps
Estimated / selected altsetting bandwith : 18 / 642. 
starting_streaming
getting frame

Should note that the opencv program DOES receive frames every once in a while. but it is largely the select timeout issue trying to read frames from the camera.

techmaticsnz commented 1 year ago

It doesn't appear to be related to hardware... We tried plugging in a keyboard to the USB port and it works fine. Also if we run the camera through a USB hub it actually starts getting data, but quickly after starting the program it closes because it doesn't read any frames.

EduardoRonchi commented 1 year ago

Any updates on this issue? I am having the same problem with PT Mini + Lepton 3.5 and Raspberry Pi 4B. If I restart my raspberry solves the problem, but it comes back after some time.

techmaticsnz commented 1 year ago

Sorry for the late reply, but we've found the Purethermal Breakout board a good replacement for the Purethermal 2. It connects the thermal camera over I2C and SPI. Hope this still helps