Giter Club home page Giter Club logo

Comments (8)

OwenTC avatar OwenTC commented on August 18, 2024

I am having the same problem right now using it through USB. Did you ever figure out a solution to the error?

Thanks,
Owen

from pylepton.

mishave avatar mishave commented on August 18, 2024

@AravindSadashiv1998 just curious to what your output is when you run:
cat /sys/module/spidev/parameters/bufsiz

Typical this should typically return 4096 bytes by default.. however when messing around trying to increase this number to the suggested 65535, the buffer returning an error or a very low number i.e. 4 when check with the above cmd. this in turn creates the 'Inappropriate ioctl for device '
to fix it I went ahead and reduced that size down using:
sudo nano /boot/cmdline.txt and add in the end:
spidev.bufsiz= 131072
Reboot after and check again.

from pylepton.

Tylersuard avatar Tylersuard commented on August 18, 2024

@mishave I just tried that, still the same error.

from pylepton.

jcarolinares avatar jcarolinares commented on August 18, 2024

Hello,

I'm experimenting the same error, in my case I've tried with a Raspberry Pi 4 model B the error message is the same but cat /sys/module/spidev/parameters/bufsiz does not exist

Any idea about what is happening or what are we doing wrong?

Also I'm sorry about the question but I'm not sure what is the correct wiring for the camera, I've found different diagrams across the internet. In my case is a Lepton Thermal Camera Breakout v1.4 if anyone has any clue that would be awesome

Thanks!

from pylepton.

Tylersuard avatar Tylersuard commented on August 18, 2024

from pylepton.

mishave avatar mishave commented on August 18, 2024

@mishave I just tried that, still the same error.

Apologies, just saw this, will set one up over the next week and see what comes up, I do remember it being a pain to set up. from memory, I did it using the lepton3-dev branch i.e.git clone -b lepton3-dev https://github.com/groupgets/pylepton.git keep in mind there are a few things you need to fix within that.

from pylepton.

mishave avatar mishave commented on August 18, 2024

@Tylersuard @jcarolinares Alrighty so, i started with a fresh build so had to reinstall everything first
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install python3-pip
sudo pip3 install --upgrade setuptools

OpenCV install - I was having some issues with the install following the current instructions which was throwing a cv2 import error si tried the following method
pip3 install opencv-python > would not work getting such on install, so I tried installing the previous build as per below:
pip3 install opencv-python==4.5.3.56
also installed NumPy:
pip3 install -U numpy

once that was installed I made a copy of the lepton3-dev branch:
git clone -b lepton3-dev https://github.com/groupgets/pylepton.git
made some tweaks as per: #60 (comment)

ran install sudo python3 setup.py install then tried to run pylepton_capture output.png which threw a cv2 import error..

Tried installing the contrib package and some of its dependencies manually using:
pip3 install opencv-contrib-python; sudo apt-get install -y libatlas-base-dev libhdf5-dev libhdf5-serial-dev libatlas-base-dev libjasper-dev libqtgui4 libqt4-test

for good measure re-run the install because yolo:
sudo python3 setup.py install

after that I was getting the ioctl error:
pi@raspberrypi:~/pylepton $ pylepton_capture output.png
Traceback (most recent call last):
File "/usr/local/bin/pylepton_capture", line 37, in
image = capture(flip_v = options.flip_v, device = options.device)
File "/usr/local/bin/pylepton_capture", line 10, in capture
a,_ = l.capture()
File "/usr/local/lib/python3.7/dist-packages/pylepton/Lepton3.py", line 55, in capture
Lepton.capture_segment(self._handle, self._xmit_buf[:self._msg_size * Lepton.ROWS], 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

So I checked the buf size and it returned:
pi@raspberrypi:~/pylepton $ cat /sys/module/spidev/parameters/bufsiz 4096

Extended the buf size:
pi@raspberrypi:~/pylepton $ sudo nano /boot/cmdline.txt
and add the following to the end:
spidev.bufsiz=65535

pi@raspberrypi:~/pylepton $ sudo reboot

Run the in built script
pylepton_capture output.png

happy days.

from pylepton.

kekiefer avatar kekiefer commented on August 18, 2024

#66 merged which reduces the spidev buffer size again, because apparently it works with the smaller message sizes. Let me know if there are issues with this approach.

from pylepton.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.