Leopard Imaging L-BCM5M1

I have bought the 5M version of Leopard Imaging’s camera. I can use this camera with one of two operating systems both of which are up-to-date.

  1. Angstrom: Linux beagleboard 2.6.32 #3 PREEMPT Tue Jul 26 10:56:56 CEST 2011 armv7l unknown
  2. Ubuntu 12.04: Linux arm 3.5.4-x6 #1 SMP Thu Sep 27 11:13:38 UTC 2012 armv7l armv7l armv7l GNUx

I was able to switch on the camera in the Angstrom operating system with help from https://groups.google.com/forum/#!msg/beagleboard/GGJO2jWnECY/O9PoiEBnKckJ and http://embeddedgeeks.wordpress.com/2012/01/21/leopard-imaging-camera-li-lbcm3m1-on-the-beagleboard/

In particular, I found it helpful to OPKG INSTALL kernel-module-mt9p031 and then insert the line camera=lbcm3m1 into the uEnv.txt file in the boot partition. However, the pictures were all VGA quality whereas the camera is 5M. I tried to use different names for the camera entry in uEnv.txt substituting 5 for 3but when I do that /dev/video0 disappears and the mtp3 entry in lsmod disappears also. How can I take full resolution pictures?

Second question is, how can I install the camera on Ubuntu version given above? I did the same things but got no results.

Thank you,

Ahmet

Hello,

Why don’t you give a try to this tutorial? It is for mt9p031 driver, so it maybe work for you!
https://groups.google.com/forum/?fromgroups=#!topic/beagleboard/Ag2b4Gmvxa0

Regards,

With Ubuntu, as long as you install "v3.2.30-x15" and add
camera=lbcm5m1 to your boot args the kernel side will now work..

So with precise armhf, you can get that from here:
http://rcn-ee.net/deb/precise-armhf/v3.2.30-x15/

Regards,

Thank you, Robert. Are you sure about the camera=lbcm5m1 parameter? The equivalent Angstrom parameter was camera=lbcm3m03 which only seems to provide VGA resolution. I have kernel 3.2.30-x15 but /dev/video0 is not shown and the driver is not listed in response to lsmod. If I want to use the camera with your newest kernel, then do I have to follow the steps descirbe in the previous post by mrne? I am not experienced in cross compiling and all that.

Ahmet

8 Ekim 2012 Pazartesi 15:44:05 UTC+3 tarihinde RobertCNelson yazdı:

Thank you. It will take me some time to follow through the instructions.

Ahmet

8 Ekim 2012 Pazartesi 14:29:59 UTC+3 tarihinde mrne yazdı:

Thank you, Robert. Are you sure about the camera=lbcm5m1 parameter? The

Yeap, as that's what i used in the patch:

https://github.com/RobertCNelson/stable-kernel/blob/master/patches/beagle/0021-Beagle-Camera-add-MT9P031-Aptina-image-sensor-driver.patch#L190

Although, i'm tempted to change it to something like "camera=li5m03"
as that is what is actually written on this module... (of course i'll
also patching u-boot to pass the parameter so you could just do
"camera=${camera}" and it'll be taken care of..)

equivalent Angstrom parameter was camera=lbcm3m03 which only seems to
provide VGA resolution.

Sorry, I never looked at the angstrom patchset, for these cameras...

I have kernel 3.2.30-x15 but /dev/video0 is not
shown and the driver is not listed in response to lsmod. If I want to use

What do:

dmesg | grep -i beagle
dmesg | grep -i isp

return?

the camera with your newest kernel, then do I have to follow the steps
descirbe in the previous post by mrne? I am not experienced in cross
compiling and all that.

No, there is no reason to rebuild, as after getting it to work, i
tagged a release and pushed it out..

Regards,

Strike that idea, camera regulators aren't set in u-boot, so it's not
as easy to just probe the device (as it's not powered). :wink:

Regards,

So it is up to the patch writer to decide what the camera= parameter should say. I didn’t know, I thought it might be in the manufacturer’s device driver. What are the camera regulators? My camera is physically powered on as the green light comes on regardless.

In response to your earlier question:

ubuntu@arm:~$ dmesg | grep -i beagle
[ 0.000000] Machine: OMAP3 Beagle Board
[ 0.000000] Beagle expansionboard: none
[ 0.000000] Beagle second expansionboard: none
[ 0.053955] OMAP3 Beagle Rev: xM C
[ 4.112304] Registered led device: beagleboard::usr0
[ 4.112426] Registered led device: beagleboard::usr1
[ 4.114135] Registered led device: beagleboard::pmu_stat
[ 14.805419] OMAP3 Beagle/Devkit8000 SoC init
ubuntu@arm:~$ dmesg | grep -i isp
[ 0.000000] OMAP3630 ES1.2 (l2cache iva sgx neon isp 192mhz_clk )
[ 0.000000] Kernel command line: console=ttyO2,115200n8 console=tty0 vram=12e
[ 0.093688] omap-iommu omap-iommu.0: isp registered

8 Ekim 2012 Pazartesi 17:39:09 UTC+3 tarihinde RobertCNelson yazdı:

So it is up to the patch writer to decide what the camera= parameter should
say. I didn't know, I thought it might be in the manufacturer's device

I wish i knew where "lbcm5m1" came from, as the camera i have might be
completely different.

driver. What are the camera regulators? My camera is physically powered on
as the green light comes on regardless.

Mine doesn't have any led's... On the silkscreen, what is your camera
actually labeled as?

Mine: "Leopard Imaging LI-5M03"

In response to your earlier question:

ubuntu@arm:~$ dmesg | grep -i beagle
[ 0.000000] Machine: OMAP3 Beagle Board
[ 0.000000] Beagle expansionboard: none
[ 0.000000] Beagle second expansionboard: none

So: your either not running "v3.2.30-x15", or didnt' add
"camera=lbcm5m1" to your bootargs..

[ 0.053955] OMAP3 Beagle Rev: xM C
[ 4.112304] Registered led device: beagleboard::usr0
[ 4.112426] Registered led device: beagleboard::usr1
[ 4.114135] Registered led device: beagleboard::pmu_stat

Regards,

Thank you, Robert.

The label on the seller’s package was ‘LI-LBCM5M1’. By silkscreen, do you mean the power-up messages dislpayed by dmesg? I couldn’t find the word Leopard in it.

I discovered that I had changed the camera parameter in uEnv.txt to something to experiment with alternatives. I have now corrected it as shown below. The responses to the grep commands look very similar. The O/S is definitely the one you recommended. I downloaded five files from the directory and ran the shell on BB to install.

camera=lbcm5m1

ubuntu@arm:~$ dmesg | grep -i beagle
[ 0.000000] Machine: OMAP3 Beagle Board
[ 0.000000] Beagle expansionboard: none
[ 0.000000] Beagle second expansionboard: none
[ 0.053894] OMAP3 Beagle Rev: xM C
[ 4.144165] Registered led device: beagleboard::usr0
[ 4.144287] Registered led device: beagleboard::usr1
[ 4.147430] Registered led device: beagleboard::pmu_stat
[ 14.778900] OMAP3 Beagle/Devkit8000 SoC init
ubuntu@arm:~$ dmesg | grep -i isp
[ 0.000000] OMAP3630 ES1.2 (l2cache iva sgx neon isp 192mhz_clk )
[ 0.000000] Kernel command line: console=ttyO2,115200n8 console=tty0 vram=12e
[ 0.093627] omap-iommu omap-iommu.0: isp registered

ubuntu@arm:~$ uname --all
Linux arm 3.2.30-x15 #1 SMP Sat Oct 6 05:51:08 UTC 2012 armv7l armv7l armv7l GNx

Regards,

Ahmet

8 Ekim 2012 Pazartesi 18:04:03 UTC+3 tarihinde RobertCNelson yazdı:

Thank you, Robert.

The label on the seller's package was 'LI-LBCM5M1'. By silkscreen, do you
mean the power-up messages dislpayed by dmesg? I couldn't find the word
Leopard in it.

Ah:

So yours:
https://www.leopardimaging.com/uploads/LI_LBCM5M1_Camera_Board.pdf
which uses: MT9P011

and mine:
http://shop.leopardimaging.com/product.sc?productId=17
Which uses: MT9P031

And now the 'camera' names make sense:

http://shop.leopardimaging.com/category.sc?categoryId=13
"LI-LBCM5M1"

I discovered that I had changed the camera parameter in uEnv.txt to
something to experiment with alternatives. I have now corrected it as shown
below. The responses to the grep commands look very similar. The O/S is
definitely the one you recommended. I downloaded five files from the
directory and ran the shell on BB to install.

grep-ing console, would be better to make sure it's enabled..

ubuntu@arm:~$ dmesg | grep console
[ 0.000000] Kernel command line: console=ttyO2,115200n8
console=tty0 vram=12M omapfb.mode=dvi:1280x720MR-16@60
omapdss.def_disp=dvi root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait
fixrtc buddy=none buddy2=none camera=lbcm5m1

Regards,

8 Ekim 2012 Pazartesi 19:45:26 UTC+3 tarihinde RobertCNelson yazdı:

ubuntu@arm:~$ dmesg | grep console
[ 0.000000] Kernel command line: console=ttyO2,115200n8 console=tty0
vram=12e
[ 0.000000] console [tty0] enabled
[ 1.482238] console [ttyO2] enabled

that's all folks :slight_smile: just three lines and no mention of the camera

Looks like your in minicom or another serial program that can't word-wrap..

Here's my uEnv.txt for reference:
http://paste.ubuntu.com/1267766/

*Warning, unless your running one of my ubuntu/debian images with
zImage/initrd.img support, it probally won't boot with that uEnv.txt
as is...

Regards,

8 Ekim 2012 Pazartesi 12:06:07 UTC-5 tarihinde RobertCNelson yazdı:

ubuntu@arm:~$ dmesg | grep console
[ 0.000000] Kernel command line: console=ttyO2,115200n8 console=tty0
vram=12e
[ 0.000000] console [tty0] enabled
[ 1.482238] console [ttyO2] enabled

that’s all folks :slight_smile: just three lines and no mention of the camera

Looks like your in minicom or another serial program that can’t word-wrap…

Here’s my uEnv.txt for reference:
http://paste.ubuntu.com/1267766/

*Warning, unless your running one of my ubuntu/debian images with
zImage/initrd.img support, it probally won’t boot with that uEnv.txt
as is…

Regards,


Robert Nelson
http://www.rcn-ee.com/

line wrap correction:
[ 0.000000] Kernel command line: console=ttyO2,115200n8 console=tty0 vram=12M omapfb.mode=dvi:1280x720MR-16@60 omapdss.def_disp=dvi root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait fixrtc buddy=none buddy2=none
[ 0.000000] console [tty0] enabled
[ 1.482238] console [ttyO2] enabled

If memory serves, I downloaded your ubuntu-12.04-r7-minimal-armhf-2012-09-27 and used tar to expand it. Then I inserted a blank sd card and executed setup-sdcard.sh to copy the files. I also found a file named precise-armhf 3.5.5-x7 and used it to set up the latest kernel. Then you said use 3.2.30 instead and I downloaded that. Now uname --all gives Linux arm 3.2.30-x15 #1 SMP Sat Oct 6 05:51:08 UTC 2012 armv7l armv7l armv7l GNU/Linux. Can I do anything else to verify compatibility with the camera?

Ahmet

8 Ekim 2012 Pazartesi 12:06:07 UTC-5 tarihinde RobertCNelson yazdı:

> ubuntu@arm:~$ dmesg | grep console
> [ 0.000000] Kernel command line: console=ttyO2,115200n8 console=tty0
> vram=12e
> [ 0.000000] console [tty0] enabled
> [ 1.482238] console [ttyO2] enabled
>
> that's all folks :slight_smile: just three lines and no mention of the camera

Looks like your in minicom or another serial program that can't
word-wrap..

Here's my uEnv.txt for reference:
http://paste.ubuntu.com/1267766/

*Warning, unless your running one of my ubuntu/debian images with
zImage/initrd.img support, it probally won't boot with that uEnv.txt
as is...

Regards,

--
Robert Nelson
http://www.rcn-ee.com/

line wrap correction:
[ 0.000000] Kernel command line: console=ttyO2,115200n8 console=tty0
vram=12M omapfb.mode=dvi:1280x720MR-16@60 omapdss.def_disp=dvi
root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait fixrtc buddy=none
buddy2=none
[ 0.000000] console [tty0] enabled
[ 1.482238] console [ttyO2] enabled

If memory serves, I downloaded your ubuntu-12.04-r7-minimal-armhf-2012-09-27
and used tar to expand it. Then I inserted a blank sd card and executed
setup-sdcard.sh to copy the files. I also found a file named precise-armhf

cool that's new enough..

Just open uEnv.txt in a text editor and change:

from:
expansion_args=setenv expansion buddy=${buddy} buddy2=${buddy2}

to:
expansion_args=setenv expansion buddy=${buddy} buddy2=${buddy2} camera=lbcm5m1

3.5.5-x7 and used it to set up the latest kernel.

Yeah, still working on v3.5/v3.6 fighting the i2c changes, as the
device is failing to init. :wink:

Then you said use 3.2.30
instead and I downloaded that. Now uname --all gives Linux arm 3.2.30-x15 #1
SMP Sat Oct 6 05:51:08 UTC 2012 armv7l armv7l armv7l GNU/Linux. Can I do
anything else to verify compatibility with the camera?

Regards,

8 Ekim 2012 Pazartesi 20:51:28 UTC+3 tarihinde RobertCNelson yazdı:

8 Ekim 2012 Pazartesi 20:51:28 UTC+3 tarihinde RobertCNelson yazdı:

>
>
> 8 Ekim 2012 Pazartesi 12:06:07 UTC-5 tarihinde RobertCNelson yazdı:
>>
>> > ubuntu@arm:~$ dmesg | grep console
>> > [ 0.000000] Kernel command line: console=ttyO2,115200n8
>> > console=tty0
>> > vram=12e
>> > [ 0.000000] console [tty0] enabled
>> > [ 1.482238] console [ttyO2] enabled
>> >
>> > that's all folks :slight_smile: just three lines and no mention of the camera
>>
>> Looks like your in minicom or another serial program that can't
>> word-wrap..
>>
>> Here's my uEnv.txt for reference:
>> http://paste.ubuntu.com/1267766/
>>
>> *Warning, unless your running one of my ubuntu/debian images with
>> zImage/initrd.img support, it probally won't boot with that uEnv.txt
>> as is...
>>
>> Regards,
>>
>> --
>> Robert Nelson
>> http://www.rcn-ee.com/
>
>
> line wrap correction:
> [ 0.000000] Kernel command line: console=ttyO2,115200n8 console=tty0
> vram=12M omapfb.mode=dvi:1280x720MR-16@60 omapdss.def_disp=dvi
> root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait fixrtc buddy=none
> buddy2=none
> [ 0.000000] console [tty0] enabled
> [ 1.482238] console [ttyO2] enabled
>
> If memory serves, I downloaded your
> ubuntu-12.04-r7-minimal-armhf-2012-09-27
> and used tar to expand it. Then I inserted a blank sd card and executed
> setup-sdcard.sh to copy the files. I also found a file named
> precise-armhf

cool that's new enough..

Just open uEnv.txt in a text editor and change:

from:
expansion_args=setenv expansion buddy=${buddy} buddy2=${buddy2}

to:
expansion_args=setenv expansion buddy=${buddy} buddy2=${buddy2}
camera=lbcm5m1

> 3.5.5-x7 and used it to set up the latest kernel.

Yeah, still working on v3.5/v3.6 fighting the i2c changes, as the
device is failing to init. :wink:

> Then you said use 3.2.30
> instead and I downloaded that. Now uname --all gives Linux arm
> 3.2.30-x15 #1
> SMP Sat Oct 6 05:51:08 UTC 2012 armv7l armv7l armv7l GNU/Linux. Can I do
> anything else to verify compatibility with the camera?

Regards,
--
Robert Nelson
http://www.rcn-ee.com/

Thank you. Now I have /dev/video0 through /dev/video6 listed. But I can't
see the device driver under lsmod.

They are built in..

dmesg | grep -i isp
dmesg | grep MT

should show it loaded..

I am getting this error message: 'Device
/dev/video0 is not a video capture device'

I get that same error when access /dev/video0...

Regards,

8 Ekim 2012 Pazartesi 22:17:47 UTC+3 tarihinde RobertCNelson yazdı:

From what i can tell after a week of using this, mplayer can't work
directly on this camera, as it's raw...

So you have to use a few tools such as media-ctrl/yavta...

There's a build script under:

/boot/uboot/tools/pkg/

(if that directory doesn't exit run: sudo ./update.sh from
/boot/uboot/tools/ to pull in the changes)...

and see for hints:
http://www.compulab.co.il/workspace/mediawiki/index.php5/CM-T3730:_Linux:_Camera

Regards,

I will take a look at that stuff but mplayer for Angstrom does display a VGA image which you can try yourself. Thanks again.

By the way, if I need a real-time os, is Ubuntu a good choice? Would you recommend Ubuntu for flight control, for instance?

Ahmet