pimoroni / mlx90640-library

Python library for the MLX90640 thermal camera
https://shop.pimoroni.com/products/mlx90640-thermal-camera-breakout
Apache License 2.0
133 stars 84 forks source link

Checkerboard pattern randomly #23

Closed nunomiguelferreira closed 1 year ago

nunomiguelferreira commented 5 years ago

Hello,

So I'm using this library to get a reading every minute, but sometimes after some hours of readings I get this checkerboard pattern that you can observe in this apng.

video_checker

The only way to make the library work again is to reboot the pi (not a soft reboot, literally unplugging it from the power chord). So I'm wondering, if you know if the problem is from the camera being out of sync (which would be weird, since a new ./video is run every minute) or if the problem stems from somewhere in the I2C bus.

I'd also like to say that I'm writing the array temperature values for each frame read in a text file and this is with a RPI3 !

Thank you for your time

Gadgetoid commented 5 years ago

I've not seen this myself- but I also haven't run the camera for more than a few hours. It's a very finickity sensor that I've had precious little luck bending to my will- not for want of trying.

Unfortunately I've got too much on my plate to give this a proper look at the moment, but it's been on my TODO list for a while.

nunomiguelferreira commented 5 years ago

Yeah exactly, I only run into this problem when running the sensor for over 16hours at a time. I've managed to fix it by cutting power to the RPI board once every 8 hours, but it is not the most elegant solution for a fix.

Thank you for your input!

dglaude commented 4 years ago

Checkboard pattern is the way this sensor work. It take two half frame with alternate checkboard. You would notice that with moving object. This library might hide this, but then over time something goes wrong. You could try with Adafruit new CircuitPython library with Blinks.

Technofinchen commented 4 years ago

Having the same problem trying to pipe the rawrgb.cpp output to flask without buffering. The problems exists permanently. Does the rawrgb script generate a full 24x32 rgb matrix?

... `try: with subprocess.Popen(["sudo", trgbpath, "{}".format(fps)], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as tcamera: while True: tframe = tcamera.stdout.read(2304) size = len(tframe) print("Got {} bytes of data!".format(size)) image = Image.frombytes('RGB', (32, 24), tframe)

                break`

...