0

[Errno 110] Connection timed out - MLX90640
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

[Errno 110] Connection timed out - MLX90640

by sensorlife on Thu Apr 22, 2021 3:08 am

Hi I am using the adafruit library to read out my MLX90640 sensor but my code always stops after some time. The time it takes before it stops differs but I always get the same error:

Traceback (most recent call last):
File "/home/pi/Desktop/sendCoordinates.py", line 35, in <module>
mlx.getFrame(frame)
File "/usr/local/lib/python3.7/dist-packages/adafruit_mlx90640.py", line 126, in getFrame
status = self._GetFrameData(mlx90640Frame)
File "/usr/local/lib/python3.7/dist-packages/adafruit_mlx90640.py", line 147, in _GetFrameData
self._I2CReadWords(0x0400, frameData, end=832)
File "/usr/local/lib/python3.7/dist-packages/adafruit_mlx90640.py", line 829, in _I2CReadWords
addrbuf, inbuf, in_end=read_words * 2
File "/usr/local/lib/python3.7/dist-packages/adafruit_bus_device/i2c_device.py", line 131, in write_then_readinto
in_end=in_end,
File "/usr/local/lib/python3.7/dist-packages/busio.py", line 141, in writeto_then_readfrom
stop=stop,
File "/usr/local/lib/python3.7/dist-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 88, in writeto_then_readfrom
address, buffer_out[out_start:out_end], in_end - in_start
File "/usr/local/lib/python3.7/dist-packages/Adafruit_PureIO/smbus.py", line 273, in read_i2c_block_data
ioctl(self._device.fileno(), I2C_RDWR, request)
TimeoutError: [Errno 110] Connection timed out

Is there something I can do to fix this? Thanks in advance!

sensorlife
 
Posts: 10
Joined: Tue Apr 06, 2021 11:42 am

Re: [Errno 110] Connection timed out - MLX90640

by adafruit_support_carter on Thu Apr 22, 2021 2:23 pm

Could be connection related. Can you post a photo of your setup showing how everything is wired up.

adafruit_support_carter
 
Posts: 20679
Joined: Tue Nov 29, 2016 2:45 pm

Re: [Errno 110] Connection timed out - MLX90640

by sensorlife on Fri Apr 23, 2021 4:20 am



I am using a Raspberry Pi 3B+
Attachments
20210423_101426 (1).jpg
20210423_101426 (1).jpg (621.54 KiB) Viewed 283 times

sensorlife
 
Posts: 10
Joined: Tue Apr 06, 2021 11:42 am

Re: [Errno 110] Connection timed out - MLX90640

by adafruit_support_carter on Fri Apr 23, 2021 3:18 pm

Is it sitting on top of the ethernet port just for the photo? Or is that where it normally sits? If so, is anything shorting out via the ethernet connector housing?

adafruit_support_carter
 
Posts: 20679
Joined: Tue Nov 29, 2016 2:45 pm

Re: [Errno 110] Connection timed out - MLX90640

by sensorlife on Sun Apr 25, 2021 5:05 am

There is thick double sided tape in between so shorting should not be possible!

sensorlife
 
Posts: 10
Joined: Tue Apr 06, 2021 11:42 am

Re: [Errno 110] Connection timed out - MLX90640

by adafruit_support_carter on Mon Apr 26, 2021 11:00 am

OK, thanks, that should be fine. Can you remove it and post a photo of the backside of the camera module so we can see how the connections go from the camera's header pins to the hookup wires.

The pins being used seem OK, so not that.

adafruit_support_carter
 
Posts: 20679
Joined: Tue Nov 29, 2016 2:45 pm

Re: [Errno 110] Connection timed out - MLX90640

by sensorlife on Mon Apr 26, 2021 11:57 am

I am only using 5 simple right angle pins!
Attachments
rsz_20210426_174750.jpg
rsz_20210426_174750.jpg (73.52 KiB) Viewed 250 times

sensorlife
 
Posts: 10
Joined: Tue Apr 06, 2021 11:42 am

Re: [Errno 110] Connection timed out - MLX90640

by adafruit_support_carter on Tue Apr 27, 2021 11:39 am

Thanks. That all looks fine.

Can you try running one of the examples from the library and see if you get the same timeout error running that. To keep it simple, try this one:
https://github.com/adafruit/Adafruit_Ci ... pletest.py

adafruit_support_carter
 
Posts: 20679
Joined: Tue Nov 29, 2016 2:45 pm

Re: [Errno 110] Connection timed out - MLX90640

by sensorlife on Tue Apr 27, 2021 5:09 pm

This seems to be running endlessly just fine. The code I am using to collect the data is the same:

try:
mlx.getFrame(frame)
except ValueError:
# these happen, no biggie - retry
continue

after this I do several things with frame but nothing using I2C, where could the problem me?

Many thanks!

sensorlife
 
Posts: 10
Joined: Tue Apr 06, 2021 11:42 am

Re: [Errno 110] Connection timed out - MLX90640

by sensorlife on Wed Apr 28, 2021 5:41 am

I am running my code at a refresh rate of 8 Hz, does that matter?

sensorlife
 
Posts: 10
Joined: Tue Apr 06, 2021 11:42 am

Re: [Errno 110] Connection timed out - MLX90640

by adafruit_support_carter on Wed Apr 28, 2021 10:22 am

It sounds like that linked example is running OK as is? Try changing the line that sets the refresh rate to 8HZ to match your code:
https://github.com/adafruit/Adafruit_Ci ... est.py#L18
and see if it still runs OK.

adafruit_support_carter
 
Posts: 20679
Joined: Tue Nov 29, 2016 2:45 pm

Re: [Errno 110] Connection timed out - MLX90640

by sensorlife on Wed Apr 28, 2021 10:58 am

Yes the linked example would run without error. However changing the refresh rate to 8Hz gives me the error...

I added a screenshot of my I2C settings
Attachments
Screenshot 2021-04-28 165523.jpg
Screenshot 2021-04-28 165523.jpg (10.77 KiB) Viewed 220 times

sensorlife
 
Posts: 10
Joined: Tue Apr 06, 2021 11:42 am

Re: [Errno 110] Connection timed out - MLX90640

by adafruit_support_carter on Wed Apr 28, 2021 1:13 pm

I just tried this with the Adafruit version of the same sensor:
https://www.adafruit.com/product/4407
and it's working OK. I've bumped up I2C to 1000000 same as you and I'm running that example from above, but with
Code: Select all | TOGGLE FULL SIZE
mlx.refresh_rate = adafruit_mlx90640.RefreshRate.REFRESH_8_HZ

and so far, so good.

What is the general time for seeing the issue? Seconds? Minutes? etc.

What model Pi are you using?

adafruit_support_carter
 
Posts: 20679
Joined: Tue Nov 29, 2016 2:45 pm

Re: [Errno 110] Connection timed out - MLX90640

by sensorlife on Wed Apr 28, 2021 1:17 pm

The problem is usually between half a minute and a couple of minutes

sensorlife
 
Posts: 10
Joined: Tue Apr 06, 2021 11:42 am

Please be positive and constructive with your questions and comments.