The problem is : April board can’t read a complete video packet from camera.
Camera SPEC. : https://cdn.sparkfun.com/datasheets/Sensors/Infrared/FLIR_Lepton_Data_Brief.pdf
According to camera SPEC. “9.2.2.3.1 Establishing/Re-Establishing Sync” and “9.2.2.3.2 Maintaining Sync”, we know how to make a Sync and why Sync fail.
My fail situation is that: April only read few packets(1~5), then camera re-synchronize again.
So, I can’t receive a full video data.
According to SPEC. it seems a timeout issue ( 9.2.2.3.2: Intra-packet timeout).
That seems this camera can’t sync with imp SPI interface.
Does anyone has experience with this camera?
And has anyone used lepton camera with imp device and received video data well?
Thanks.
Hi hugo :
This device use SPI to transmit video stream data.
SPI Mode =3 , CS active low; clock supported 2MHz ~ 20MHz.
Below is my code, and the log message.
It should be read 60 packets, but camera always re-sync frame, so in the case only read 0~4 frame.
Thanks~
=>
class FLIRCam {
lepton_frame_packet = blob(164);
lepton_image = array(6400,0xFF);
Don’t call server.log in stuff you need to be quick locally. Sending data to the server involves a lot, eg marshalling the data, encrypting it, pushing it into the TCP stack etc
Don’t try to process the data into lepton_image in the frame grab. Just keep an array of blobs, and process it later, eg:
local lepton_frames[60];
if (frame_number < 60) lepton_frames[frame_number] = lepton_frame_packet;
…then when you have all the frames, process them into the image array at once.
It’s a bit hard for me to try this without an actual camera, though!