AR1820HS + Raspberry Pi 3

Hello, I’m setting up a AR1820SH camera, to test out the module together with a 20mm lens I need to work with.

I’m stumbling on three obstacles I’m not able to overcome:

1 - I’m trying the examples suggested in the “read me” GitHub rep:
https://github.com/ArduCAM/MIPI_Camera/blob/master/RPI/README.md

Once running each of them I get an Import Error saying No module named arducam_mipicamera

This happens even if I previously installed the libarducam_mipicamera.so, as prompted in the instructions, through the commands:

sudo pip install v4l2

sudo pip install numpy

sudo apt-get install python-opencv


Am I missing something? Is the library updated?

2 - When trying to run the opencvGui I get an error message stating:

Unable to init server: Could not connect: Connection refused (Arducam mipi camera controller:995): Gtk-WARNING **: 16:42:35.957: cannot open display:
3 - This last might be a simple one: when I start the camera preview by typing ./arducamstill -t 0, how do I stop it? I usually interrupt the programs via terminal, by typing ctrl + c, but in this case it seems like having no effect.

Whoever would like to help, I’d very much appreciate so !

Thanks in advance.

Hi,

Don’t worry and I will try my best to help you.

1 – I’m trying the examples suggested in the “read me” GitHub rep:
https://github.com/ArduCAM/MIPI_Camera/blob/master/RPI/README.md

Once running each of them I get an Import Error saying No module named arducam_mipicamera

A: Please ensure you have done the following commands to install the arducam_mipicamera lib

cd MIPI_Camera/RPI

make install

 

2 – When trying to run the opencvGui I get an error message stating:

Unable to init server: Could not connect: Connection refused
(Arducam mipi camera controller:995): Gtk-WARNING **: 16:42:35.957: cannot open display:

A2:The opencv display need to a display screen. Please run the demo on the local instead of remote terminal.

 

3 – This last might be a simple one:
when I start the camera preview by typing ./arducamstill -t 0, how do I stop it?
I usually interrupt the programs via terminal, by typing ctrl + c, but in this case it seems like having no effect.

A: You should push CTRL+C double time to exit the demo, the first time is to exit camera and the second is to exit keyboard detected. I have not find a good way to exit at the same time.

Let me know if you need more help.

 

Hello,

My apologies for my delay in getting back to you.

Firstly, many thanks for your prompt and on point reply.
Everything you suggested seemed to work, a part from the issue highlighted in question number 1:
“Once running each of them I get an Import Error saying: No module named arducam_mipicamera”

I keep being given the same ImportError, even if I went through the arducam_mipicamera lib installation once again. This happens all the times I try to run one of the python examples you provided in your GitHub repository.

This last time I was working on the example called capture.py. I tried both saving it within the MIPI_Camera/RPI folder and on the Desktop, and running them respectively, but no luck.

When following the commands:

cd MIPI_Camera/RPI

make install

I’m given this message:
sudo install -m 644 lib/libarducam_mipicamera.so /usr/lib/

I’m now wondering if the library has actually been successfully installed?

Thanks in advance for your help,
c.

Hello,

Yes, you are right. The lib has been installed successfully. Now Can you test the C code firstly?

Firstly, you can test the arducamstill demo to ensure the camera and the library are normal.

 

Hi,

So I can confirm that the ./ arducamstill commands work correctly. I can in fact run through all the examples you provide in the introduction documentation.

Regarding the .c code, they all seem to have issues in the code. For example, if I run
~/MIPI_Camera/RPI $ python preview.c

I’m prompted an SintaxError stating:

File “preview.c”, line 11

int main(int argc, char **argv) {

^

SyntaxError: invalid syntax

Is the one I can find in the GH repo the latest version of the code?

Thanks!

Hello,

preview.c is C code, such as arducamstill.c, if you want to use it, you should make it using make preview command. then run it using ./preivew instead of python preview.c.

Let me know if you need more help.

Great, thanks for this further explanation.

I tried what suggested for the C code and I can confirm it works, therefore all the checking tests seem pasted.

However, the python files keep prompt me the same error message.
This time I tried with the ArducamTest.py I found within the RPI folder. This is the error message I’m given:

Traceback (most recent call last):

File “ArducamTest.py”, line 1, in <module>

import arducam_mipicamera as arducam

ImportError: No module named arducam_mipicamera

How to import the module above mentioned?

Thanks!

Hi,

After you have run make install, it will install the arducam_mipicamera.so to your /usr/lib path.