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

SPI speed #43

Open
zoltanszalontay opened this issue May 23, 2020 · 2 comments
Open

SPI speed #43

zoltanszalontay opened this issue May 23, 2020 · 2 comments

Comments

@zoltanszalontay
Copy link

zoltanszalontay commented May 23, 2020

Is there any way to set the speed of the SPI bus?

I am using lepton3-dev with an RPI 3B+ and a 4B with a Lepton 3.5 via a Breakout Board v2. I set the CPU governor to run at fixed 100%. Video is fine, but there are sporadic lost frames ("Garbage..." message). Also, when I start picamera, the pylepton almost stops. As soon as I stop picamera, Lepton capture gets smooth again. (OK, that may be because the two I/O operations are blocking each other so threading should be used.)

I suspect the SPI bus speed is slow by default because when I used flirpy with my PureThermal, I could get stable video without any errors at 30MHz only. Anything below that caused split frames or garbage.

I am aware that pylepton does not use I2C, but I hope basic SPI settings, like bus speed can be configured. As I see, it is done via ioctl, but could someone help me where exactly?

@zoltanszalontay
Copy link
Author

I did not debug it yet, but anyone knows if I can set SPI speed here?

SPI_IOC_RD_MAX_SPEED_HZ = _IOR(SPI_IOC_MAGIC, 4, "=I")

@arushk1
Copy link

arushk1 commented Jul 5, 2020

Hi @zoltanszalontay I'm facing the same issue. You can set the SPI bus speed at Line 46 in Lepton.py :

SPEED = 18000000

Setting the speed does not do anything to smooth out the video. It's bad when using the PiCamera simultaneously.

Even threading does not help. Running them in the two different processes does not help.

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