Comments (6)
Thanks Itay, this is very interesting and odd. I presume that this something that happens during continuous capture? If you power off the module and do a single frame capture, does it return data as expected?
There's a line counter in there which returns values from 0-59 (in the LS first 12 of 16 bits of a line), and there's also a CRC that is computed against that counter (second 16 bits), and I wonder if that's what we're seeing here.
If not keeping up with real time demands of the module (which we are just barely now in Python), we can pretty easily get out of sync with the driver and start getting crazy data. For example I've had issues re-allocating the capture buffer every time.
Another thing I noticed the other day is that the SPI Mode is set wrong (0, which was not set in the original C program), where according to the docs, it is supposed to be 3 (CPOL=1, CPHA=1), so we could be clocking out data with the wrong polarity on the wrong edge, arg! Strangely an fortuitously, this setting must be ignored by the driver. It might be worth changing that though.
Please let me know if you learn any more. When I've got a chance soon I'll do some investigation too.
from pylepton.
Got it!
You're right, it was the SPI mode.
I tried setting it at 3, but got garbage.
The magic number is mode 1, i.e. the trailing edge.
I'll do some thorough testing tomorrow, but right now it seems to have solved this sync problem.
Thanks so much!
from pylepton.
Are you on a Raspberry Pi or some other platform with spidev?
from pylepton.
I'm using RPi 2, running Raspbian 8 (Jessie).
What would you like me to check?
from pylepton.
Just checking. Please let me know if this continues working for you. Mode 2 is CPOL=1, CPHA=0, which isn't quite what the datasheet calls out. Considering that this was basically working with CPOL=0 before, I'm still a little confused by this.
from pylepton.
Hey Itay, I pushed a couple fixes to improve throughput and reliability (just to avoid potential issues there) and set SPI mode 3. This is working well for me and I have values in the correct range. Please let me know if you are still having problems.
from pylepton.
Related Issues (20)
- RE: pylepton and error issues w/ Python3, BeagleBone Green, and LCD Display HOT 4
- Shutter closes and opens w/ Pi 4 HOT 2
- lepton 3.5 not working with RPi0W HOT 4
- Error: Inappropriate ioctl for device HOT 8
- groupgets/LeptonModule Works, pylepton does not
- [Errno 25] Inappropriate ioctl for device HOT 1
- poor quality images HOT 1
- Estimate peak temp from sides and center pixels of Lepton 2.5 HOT 1
- Lepton 3/3.5 with Breakout board v2.0 HOT 1
- FLIR Lepton 3.5 with PyLepton in Jetson Nano HOT 5
- all of a sudden the camera started producing these artefacts. Does it mean it is damaged or it could be the library?
- Working With Mac M1 with MacOS 12.2
- Lepton3 - Module is not callable HOT 2
- Extrange range temperatures using Lepton3 HOT 1
- pylepton_overlay error Raspbian Bullseye
- Jetson Xavier NX and Lepton 2.5
- flir
- setup.py error
- Small Dark Lines in Images
- Garbage frame number reset waiting...
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pylepton.