Problems captruing on Raspberry Pi

923 views
Skip to first unread message

Craig Paterson

unread,
Oct 20, 2014, 11:07:20 AM10/20/14
to flir-...@googlegroups.com
I'm not able to successfully capture a still image on the RPi (haven't attempted video yet). Code compiles fine and binary runs but silently hangs without generating an image. Invocation looks like this:

pi@pi2 ~/LeptonModule/raspberrypi_capture $ sudo ./a.out
spi mode: 0
bits per word: 8
max speed: 16000000 Hz (16000 KHz)

And that's all she wrote. Running it through strace it generates an endless string of unvarying ioctl messages like this:

 ioctl(3, 0x40206b00, 0xbe96a658)        = 164

This is on a vanilla Raspbian install. SPI and i2c are enabled and lsmod shows them loaded. Output of i2cdetect looks like this:

pi@pi2 ~/LeptonModule/raspberrypi_capture $ sudo i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- 2a -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

This is all on an early 256MB Model B. Haven't yet tried it on a B+. It would help if I understood what strace was telling me about that ioctl call, but I don't :)

Thanks,
Craig.

Pure Engineering

unread,
Oct 20, 2014, 11:20:37 AM10/20/14
to flir-...@googlegroups.com
did you unblacklist the spi driver. 
  1. sudo vi /etc/modules
  2. add # in front of spi-bcm2708 and ic2-dev, 
also did you checkout the wiki page here
also double check the pinout, don't forget the CS line
the output of the program should be a file.

Also you can try out the raspberrypi_video demo as well.

Craig Paterson

unread,
Oct 20, 2014, 11:38:35 AM10/20/14
to flir-...@googlegroups.com
Yes, did comment out the module, though it still seems to be getting loaded as a dependency, and blacklisting it makes the device unavailable.

Anyway, I'll go over the hardware connections again this evening.

Karna Kuru

unread,
Oct 20, 2014, 4:32:38 PM10/20/14
to flir-...@googlegroups.com
Which pin did you wire CS to? Using the example code, you should use SPI0.

Craig Paterson

unread,
Oct 20, 2014, 10:34:06 PM10/20/14
to flir-...@googlegroups.com
Winner! Had it on the wrong CS pin (via an Adafruit PI prototyping kit). Swapping the CS pin and it works fine. False alarm, hopefully useful to anyone else who makes the same mistake :)

At some point maybe I'll dust off my lousy C++ and graft in a timeout -- I'm guessing what I saw was the I2C init and then no image data being read from the SPI because I had it hooked to the wrong pin.


Jeff Debrosse

unread,
Oct 24, 2014, 10:28:49 PM10/24/14
to flir-...@googlegroups.com
This group has been immensely helpful in troubleshooting and whittling down my particular problem getting the module up and running. In the end it was a barely noticeable difference between the top edge of the imaging module and the socket that it goes into.

When I had eliminated, OS, loadable modules, system configuration issues and PI revisions (A through B+) I ended up looking closely at the imaging module and realized that it was just a few hairs higher than the socket that it sits in. I pressed firmly on the edges and barely felt the snap, but when I looked at the screen I saw that the capture program had, for the first time, completed its run and exited to the command line!

I noticed that by default the video capture demo uses a different pinout for CS (pin 26/CE1). Swapping the CS line to CE1 allowed for the video capture demo to work right off the bat.

Thanks for these awesome low-cost boards!

Jeff
Reply all
Reply to author
Forward
Message has been deleted
0 new messages