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

Connect Three Lepton on Raspberry Pi 3 #40

Open
MicheleMussi opened this issue Feb 28, 2020 · 1 comment
Open

Connect Three Lepton on Raspberry Pi 3 #40

MicheleMussi opened this issue Feb 28, 2020 · 1 comment

Comments

@MicheleMussi
Copy link

Good morning,
I would like use three lepton to the raspberry, with your library.
Is this possible?

Running this example

import numpy as np
import cv2
from pylepton import Lepton

with Lepton("/dev/spidev1.0") as l:
a,_ = l.capture(None,True,True,True)
cv2.normalize(a, a, 0, 65535, cv2.NORM_MINMAX) # extend contrast
np.right_shift(a, 8, a) # fit data into 8 bits
cv2.imwrite("python3.jpg", np.uint8(a)) # write it!

it works with
with Lepton("/dev/spidev0.0") as l:
with Lepton("/dev/spidev0.1") as l:

after running the program on one port it does not work on the next one until the raspberry is restarted

not work with
with Lepton("/dev/spidev1.0") as l:
The error is:

From the following error
Traceback (most recent call last):
File "3Capture.py", line 7, in
with Lepton ("/ dev / spidev1.0") as l:
File "/usr/local/lib/python2.7/dist-packages/pylepton/Lepton.py", line 85, in enter
ioctl (self .__ handle, SPI_IOC_WR_MODE, struct.pack ("= B", Lepton.MODE))
IOError: [Errno 22] Invalid argument

but the ports exist

pi @ raspberrypi: ~ / Bm / ConveyorApp / Sender $ ls / dev / spidev *
/dev/spidev0.0 /dev/spidev0.1 /dev/spidev1.0 /dev/spidev1.1 /dev/spidev1.2

Thanks for your help

@dylandxt
Copy link

I ran into the same issue. In Lepton.py it is trying to set the SPI mode to 3. I believe it is not supported by SPI1 on RPi. https://forums.raspberrypi.com//viewtopic.php?t=149981

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