raspi-thermal-cam
raspi-thermal-cam copied to clipboard
OSError: [Errno 5] Input/output error
Hi. I download the code and try mlx90640_test.py by modify it for keeping running on my raspberry pi 4 64bit When it run 818 sec after start ,I got the error 'OSError: [Errno 5] Input/output error ' Do you know how can I fix it?
here is my code:
##################################
# MLX90640 Test with Raspberry Pi
##################################
#
import time,board,busio,os
import numpy as np
import adafruit_mlx90640
t0 =time.time()
i2c = busio.I2C(board.SCL, board.SDA, frequency=400000) # setup I2C
mlx = adafruit_mlx90640.MLX90640(i2c) # begin MLX90640 with I2C comm
mlx.refresh_rate = adafruit_mlx90640.RefreshRate.REFRESH_2_HZ # set refresh rate
frame = np.zeros((24*32,)) # setup array for storing all 768 temperatures
while True:
try:
mlx.getFrame(frame) # read MLX temperatures into frame var
except ValueError:
continue # if error, just read again
processtime = time.time()-t0
os.system('clear')
print('Average MLX90640 Temperature: {0:2.1f}C ({1:2.1f}F)'.\
format(np.mean(frame),(((9.0/5.0)*np.mean(frame))+32.0)))
print('processtime: %d sec'%processtime)
and here is the error report
"
Traceback (most recent call last):
File "/home/pi/raspi-thermal-cam/mlx90640_test.py", line 17, in