Link error for MIPI_Camera on RPi4 + Ubuntu18.04

Hello!

I’m trying to build the ‘MIPI_Camera’ test programs on my RPi4 running Ubuntu18.04.
But when I make I get the error message,

/usr/bin/ld: skipping incompatible //usr/lib/libarducam_mipicamera.so when searching for -larducam_mipicamera

I did run the install and I can see the file there and can ls the above path+name.

Do I need to compile that library because I’m on Ubuntu?

Cheers

Btw, I am using the ‘arm64’ version of the ubuntu server for Pi4.

Ok…so after some investigation I thought to check the file type of ‘libarducam_mipicamera.so’ using the ‘file’ command.

This returns:

libarducam_mipicamera.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=f89d2154b7f02d1316e686329ec018b82f89082d, not stripped

 

Soo0…that means that the file is of a 32bit architechture build? Is that correct?

And I am trying to build it on a 64bit version of Ubuntu. So can that be the source of the link error?

 

Hello,

The libarducam_mipicamera.so is compiled on Raspibian system,which is not compatible with the Ubuntu system. we will try to recompiled the so file on ubuntu system.

 

Thank you that would be much appreciated!

Just so that you know, I did just install the 32bit version of Ubuntu18.04 for the Raspberry and it seems like iv’e manage to build the MIPI_Camera examples.

But when I run them I just get some messages like,

> ./preview-camera0

Open camera…
can’t open /dev/gpiomem
Couldn’t open I2C device
init camera status = 4097

 

and

> sudo ./preview-camera0

Open camera…
init camera status = 4100

 

But no streaming images. I tried some of the other programs too but without success.

I also thought maybe I attached the camera wrong and swapped the direction of the brown strip/band. But no success either way.

 

 

Just read someone else’s post so also did,

> sudo ./camera_i2c

setting GPIO for board revsion: b03111
Raspberry Pi3B / Pi3B+ / 3A / 4B(1G/2G/4G)
./camera_i2c: 125: ./camera_i2c: gpio: not found
./camera_i2c: 126: ./camera_i2c: gpio: not found
./camera_i2c: 127: ./camera_i2c: gpio: not found
./camera_i2c: 128: ./camera_i2c: gpio: not found
./camera_i2c: 130: ./camera_i2c: gpio: not found
./camera_i2c: 131: ./camera_i2c: gpio: not found
./camera_i2c: 132: ./camera_i2c: gpio: not found
./camera_i2c: 133: ./camera_i2c: gpio: not found
./camera_i2c: 137: ./camera_i2c: ./rpi3-gpiovirtbuf: Permission denied
./camera_i2c: 140: ./camera_i2c: i2cdetect: not found

Hi,

For Pi4 platform Please try those commands

cd /tmp
wget https://project-downloads.drogon.net/wiringpi-latest.deb
sudo dpkg -i wiringpi-latest.deb
[email protected]:~/MIPI_Camera/RPI $ chmod +x enable_i2c_vc.sh
[email protected]:~/MIPI_Camera/RPI $ ./enable_i2c_vc.sh

Hi,

For Pi4 platform Please try those commands

cd /tmp
wget https://project-downloads.drogon.net/wiringpi-latest.deb
sudo dpkg -i wiringpi-latest.deb
[email protected]:~/MIPI_Camera/RPI $ chmod +x enable_i2c_vc.sh
[email protected]:~/MIPI_Camera/RPI $ ./enable_i2c_vc.sh

 

Hi!

Thanks for that! I had started looking for ‘gpio’ but realized it has been deprecated.

I tried your download but when running ./camera_i2c I get this:

setting GPIO for board revsion: b03111
Raspberry Pi3B / Pi3B+ / 3A / 4B(1G/2G/4G)
gpio: /lib/arm-linux-gnueabihf/libc.so.6: version GLIBC_2.28' not found (required by /usr/lib/libwiringPi.so) gpio: /lib/arm-linux-gnueabihf/libc.so.6: version GLIBC_2.28’ not found (required by /usr/lib/libwiringPi.so)
gpio: /lib/arm-linux-gnueabihf/libc.so.6: version GLIBC_2.28' not found (required by /usr/lib/libwiringPi.so) gpio: /lib/arm-linux-gnueabihf/libc.so.6: version GLIBC_2.28’ not found (required by /usr/lib/libwiringPi.so)
gpio: /lib/arm-linux-gnueabihf/libc.so.6: version GLIBC_2.28' not found (required by /usr/lib/libwiringPi.so) gpio: /lib/arm-linux-gnueabihf/libc.so.6: version GLIBC_2.28’ not found (required by /usr/lib/libwiringPi.so)
gpio: /lib/arm-linux-gnueabihf/libc.so.6: version GLIBC_2.28' not found (required by /usr/lib/libwiringPi.so) gpio: /lib/arm-linux-gnueabihf/libc.so.6: version GLIBC_2.28’ not found (required by /usr/lib/libwiringPi.so)
./camera_i2c: 137: ./camera_i2c: ./rpi3-gpiovirtbuf: Permission denied
./camera_i2c: 140: ./camera_i2c: i2cdetect: not found

 

I looked at the Ubuntu site for a ‘libc-2.28.so’ but I haven’t found one. And it sounds like a pretty crucial library for the OS so it might not even be a good idea to try to swap.

I did try to do a sneaky symbolic link to pretend I had that file but it didn’t work.

There seem to be some alternatives to gpio around. Maybe its time to upgrade to a more multi platform tool? :slight_smile:

 

 

 

 

Sorry, I did start by running ./enable_i2c_vc.sh + rebooting. But nothing seemed to have changed.

Ok, so instead I just built ‘gpio’ from this source,

https://github.com/WiringPi/WiringPi

then installed ‘rpi3-gpiovirtbuf’ from https://github.com/6by9/raspiraw

and finally did

> sudo apt-get install i2c-tools for ‘i2cdetect’

 

I then run

> ./camera_i2c

but just get:

setting GPIO for board revsion: b03111
Raspberry Pi3B / Pi3B+ / 3A / 4B(1G/2G/4G)
error: open: /dev/vcio: Permission denied
Error: Could not open file /dev/i2c-0’ or/dev/i2c/0’: No such file or directory

 

Still, maybe progress of sorts!?

 

 

 

 

 

 

 

So, instead I just build ‘gpio’ from this source,
https://github.com/WiringPi/WiringPi

Then installed ‘rpi3-gpiovirtbuf’ from https://github.com/6by9/raspiraw

and
> sudo apt-get install i2c-tools for ‘i2cdetect’

Then tried again. I first had to do
> sudo chmod a+r /dev/vcio
as I got an Permission error. Probably not a good thing to do.

finally
> ./camera_i2c
setting GPIO for board revsion: b03111
Raspberry Pi3B / Pi3B+ / 3A / 4B(1G/2G/4G)
Set state of 133 to 1
Error: Could not open file /dev/i2c-0’ or/dev/i2c/0’: No such file or directory

I do have an ‘/dev/i2c-1’
but if I run
> sudo i2cdetect -y 1

I only get empty (–) fields in the grid.

 

Here’s a picture of the hardware

 

 

I later on decided to build ‘gpio’ from source instead (from original authors git).

I also got the ‘rpi3-gpiovirtbuf’ program, from https://github.com/Hermann-SW/raspiraw.

Then I ran the ‘camera_i2c’ script again.

I manage to clear all error messages, but I still didn’t get any images from the camera.

 

I don’t actually seem to be able to get any proof that the camera is being registered correctly at all.

Here’s a picture of my hardware

test

(Iv’e recently had several failed attempts to post)

 

So, I ended up building ‘gpio’ from source, from the authors git repo.

I got the ‘rpi3-gpiovirtbuf’ from this place, https://github.com/Hermann-SW/raspiraw

I then ran the ‘camera_i2c’ script again and got no error messages.

But still no images from the camera.

 

I can’t even get a proof that the camera is correctly registered on the Pi.

There seems to be something wron with the forum code/server. I keep sending messages but they are not showing.

Hello,

Please test it on raspbian system instead of Ubuntu system. When I have time. I will test it on ubuntu system.

Hi,

I now have a fresh Raspbian Buster card I can boot from and have tested there.

Boot config,

gpu_mem=128

dtparam=i2c_vc=on

> ls /dev/i2c-*

/dev/i2c-0 /dev/i2c-1

> ./preview-camera0

Open camera…
init camera status = 4100

(and nothing else happens)

>./camera_i2c

setting GPIO for board revsion: b03111
Raspberry Pi3B / Pi3B+ / 3A / 4B(1G/2G/4G)
Set state of 133 to 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – – – – – – – – – – – – –
10: – – – – – – – – – – – – – – – –
20: – – – – – – – – – – – – – – – –
30: – – – – – – – – – – – – – – – –
40: – – – – – – – – – – – – – – – –
50: – – – – – – – – – – – – – – – –
60: – – – – – – – – – – – – – – – –
70: – – – – – – – –

Could it maybe be something wrong with the camera do you think?

Oh I just had the camera connected the wrong way around!

As you can see from the picture higher up! :slight_smile:

I get a good picture with ‘preview_setMode’.

But ‘preview’ does not work.

I do get the mmal lens shading error.

This is great! I will try with Ubuntu again over the weekend!

I have tried it again on Ubuntu but can’t get it to work there.