Link error for MIPI_Camera on RPi4 + Ubuntu18.04
Published by RedMarsBlueMoon on
New Home › Forums › 1. Cameras Modules for Raspberry Pi › Arducam MIPI Camera Modules › Link error for MIPI_Camera on RPi4 + Ubuntu18.04
- This topic has 22 replies, 2 voices, and was last updated 7 months, 2 weeks ago by
bin.
- AuthorPosts
- May 26, 2020 at 10:31 am #23092
RedMarsBlueMoon
ParticipantHello!
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
- May 26, 2020 at 10:49 am #23093
RedMarsBlueMoon
ParticipantBtw, I am using the ‘arm64’ version of the ubuntu server for Pi4.
- May 26, 2020 at 11:53 am #23094
RedMarsBlueMoon
ParticipantOk…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?
- May 26, 2020 at 7:14 pm #23116
bin
KeymasterHello,
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.
- May 26, 2020 at 11:04 pm #23129
RedMarsBlueMoon
ParticipantThank 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 = 4097and
> sudo ./preview-camera0
Open camera…
init camera status = 4100But 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.
- May 26, 2020 at 11:08 pm #23130
RedMarsBlueMoon
ParticipantJust 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 - May 27, 2020 at 6:54 pm #23175
bin
KeymasterHi,
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 - May 27, 2020 at 6:54 pm #23176
bin
KeymasterHi,
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 - May 27, 2020 at 9:25 pm #23190
RedMarsBlueMoon
ParticipantHi!
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 foundI 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? 🙂
- May 27, 2020 at 9:26 pm #23191
RedMarsBlueMoon
ParticipantSorry, I did start by running ./enable_i2c_vc.sh + rebooting. But nothing seemed to have changed.
- May 28, 2020 at 9:30 am #23206
RedMarsBlueMoon
Participanttest
- May 28, 2020 at 9:50 am #23208
RedMarsBlueMoon
ParticipantThere seems to be something wron with the forum code/server. I keep sending messages but they are not showing.
- May 28, 2020 at 5:40 pm #23195
RedMarsBlueMoon
ParticipantSo, instead I just build ‘gpio’ from this source,
https://github.com/WiringPi/WiringPiThen 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 directoryI do have an ‘/dev/i2c-1’
but if I run
> sudo i2cdetect -y 1I only get empty (–) fields in the grid.
Here’s a picture of the hardware
- May 28, 2020 at 5:40 pm #23202
RedMarsBlueMoon
ParticipantI 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
- May 28, 2020 at 5:40 pm #23193
RedMarsBlueMoon
ParticipantOk, 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 directoryStill, maybe progress of sorts!?
- May 28, 2020 at 5:40 pm #23207
RedMarsBlueMoon
Participant(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.
- May 28, 2020 at 6:11 pm #23227
bin
KeymasterHello,
Please test it on raspbian system instead of Ubuntu system. When I have time. I will test it on ubuntu system.
- May 28, 2020 at 10:03 pm #23233
RedMarsBlueMoon
ParticipantHi,
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?
- May 28, 2020 at 11:29 pm #23236
RedMarsBlueMoon
ParticipantOh I just had the camera connected the wrong way around!
As you can see from the picture higher up! 🙂
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!
- May 29, 2020 at 11:15 pm #23242
RedMarsBlueMoon
ParticipantI have tried it again on Ubuntu but can’t get it to work there.
- May 31, 2020 at 7:39 pm #23305
bin
KeymasterHello,
Great to hear it can work on raspbian system, it does not work on ubuntu which is normal due to the system is not compatible, As I have said to you, our dynamic link library is compiled based on raspbian system instead of ubuntu.
Recently, we will try to compiled it on ubuntu system.
- June 1, 2020 at 8:25 am #23431
RedMarsBlueMoon
ParticipantI’m happy to continue with Raspbian!
So if it’s just me that’s asking about Ubuntu, then please don’t worry!
I’m fine now.
- June 1, 2020 at 7:54 pm #23446
bin
KeymasterGreat, thanks for your patient.
- AuthorPosts
- You must be logged in to reply to this topic.