Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSError: [Errno 90] Message too long on Raspberry Pi4 #52

Closed
BatbayarU opened this issue Jan 16, 2021 · 3 comments
Closed

OSError: [Errno 90] Message too long on Raspberry Pi4 #52

BatbayarU opened this issue Jan 16, 2021 · 3 comments

Comments

@BatbayarU
Copy link

BatbayarU commented Jan 16, 2021

Hi @kekiefer @brandoncurtis and team members,

Thank you very much for your helpful work. I'm implementing a project using Lepton 2.5 with breakout board v2.0 on Raspberry Pi4. About a few months ago, it was working well. But now it isn't working, and an error below occurs.

Traceback (most recent call last):
File "/home/pi/Desktop/lepton test.py", line 7, in
a,_ = l.capture()
File "/usr/local/lib/python3.7/dist-packages/pylepton/Lepton.py", line 153, in capture
Lepton.capture_segment(self.__handle, self.__xmit_buf, self.__msg_size, self.__capture_buf[0])
File "/usr/local/lib/python3.7/dist-packages/pylepton/Lepton.py", line 125, in capture_segment
ret = ioctl(handle, iow, xs_buf[xs_size * (60 - messages):], True)
OSError: [Errno 90] Message too long

However, raspberrypi_video from LaptonModule is working. Do you know what is wrong with it?

Thank you very much.
Batbayar

@oroelipas
Copy link

I have the same error.
raspberrypi_video from LaptonModule is also working for me but not this library.
I am using Lpeton 3.5 with breakoutboard v2.0 on Raspberry Pi 4.

OS: Raspbian Buster
Kernel: 5.4.72-v7l+
Python: 3.7.3

Any solution?

@oroelipas
Copy link

SOLUTION:

The problem is in the SPI buffer size. The default value is 4096 but 160x120 images from Lepton3 are bigger.

You need to increase the size of the SPI buffer as explain here

Edit /boot/cmdline.txt and add in the end:
spidev.bufsiz= 65535

Then reboot your raspberry and check it worked with:
cat /sys/module/spidev/parameters/bufsiz

Hope it works for you also. Maybe this information should be in the README setup tutorial

@BatbayarU
Copy link
Author

SOLUTION:

The problem is in the SPI buffer size. The default value is 4096 but 160x120 images from Lepton3 are bigger.

You need to increase the size of the SPI buffer as explain here

Edit /boot/cmdline.txt and add in the end:
spidev.bufsiz= 65535

Then reboot your raspberry and check it worked with:
cat /sys/module/spidev/parameters/bufsiz

Hope it works for you also. Maybe this information should be in the README setup tutorial

Hi,
Thank you for your solution. I have tried this but the I couldn't change the buffer size. However, I solved this the opposite of your solution which is by reducing the message size of the library. SPIDEV_MESSAGE_LIMIT = 24 to 8 of Lepton.py. I hope this helps someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants