Inappropriate ioctl for device

See original GitHub issue

I’ve tried running a basic capture per the README.MD instructions under both Python v2.7.9 (with Numpy v1.8.2 & OpenCV v2.4.9.1) and Python 3.4.2 (with Numpy v1.8.2 & OpenCV v3.4.0) and always receive the following errors: Python v2.7.9

Python 2.7.9 (default, Sep 17 2016, 20:26:04)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from pylepton import Lepton
>>> with Lepton() as l:
...   a,_ = l.capture()
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/pylepton/Lepton.py", line 84, in __enter__
    ioctl(self.__handle, SPI_IOC_RD_MODE, struct.pack("=B", Lepton.MODE))
IOError: [Errno 25] Inappropriate ioctl for device

Python v3.4.2

Python 3.4.2 (default, Oct 19 2014, 13:31:11)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pylepton import Lepton
>>> with Lepton() as l:
...   a,_ = l.capture()
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.4/dist-packages/pylepton/Lepton.py", line 84, in __enter__
    ioctl(self.__handle, SPI_IOC_RD_MODE, struct.pack("=B", Lepton.MODE))
OSError: [Errno 25] Inappropriate ioctl for device

Doing a ls /dev reports that my SPI device is spidev0.0.

I’m a complete newbie to Linux and Python and I just have no idea where to even start troubleshooting this, frankly I don’t even know what the error means!

Any help very much appreciated 😃

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kekiefercommented, Oct 29, 2019

pylepton is just for the breakout board. You should look at https://github.com/groupgets/purethermal1-uvc-capture

0reactions
al2kcommented, May 23, 2021

Check your cable setup. An incorrect setup will throw this error when using pylepton 3.0.

This guide from FLIR shows the correct GPIO setup: https://lepton.flir.com/forums/topic/pylepton-overlay-guide-2-0-for-raspbian-pixel/

Read more comments on GitHub >

github_iconTop Results From Across the Web

inappropriate ioctl for device - perl - Stack Overflow
"inappropriate ioctl for device" is the error string for the ENOTTY error. It used to be triggerred primarily by ...
Read more >
Inappropriate ioctl for device
The ioctl(2) system call was given as an argument for a file that is not a special character device. This message replaces the...
Read more >
Inappropriate ioctl for device - The UNIX and Linux Forums
Dear all, Problem goes like this: I have a shell script which when run manually runs perfectly. When same script is executed through...
Read more >
bosh-release 271 Inappropriate ioctl for device (Errno::ENOTTY)
Inappropriate ioctl for device normally means that some program attempted to do a terminal control operation but its standard I/O streams weren't connected...
Read more >
Inappropriate ioctl for device/ENOTTY error in Linux - LinuxPip
"Inappropriate ioctl for device" is a programming error, so if you're not a software developer, your best bet is to ask the program's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found