Earlier this month, I wrote a Quick Start Guide for Orange Pi Allwinner H3 boards such as Orange Pi PC, and showed how to install and configure Debian on the boards. I’ve also received the $5.90 Orange Pi camera, which when combined an Orange Pi PC, costs around $27 including shipping. So today, I’ve attached the CSI camera to my Orange Pi 2 mini board, and used it with motion to transform for the board into an IP camera.
Now connect all cable and power on your board. First, I studied the steps described on that forum thread, and modified Allwinner configuration files, but after one or two hours, I found out some work at been done since May, and it was now much easier to use the camera since gc2035 drivers was part of the Debian image, and the script.bin file (allwinner config file) was already setup to be used with Orange pi camera.
Open a terminal window in the board to load drivers:
sudo modprobe gc2035
sudo modprobe vfe_v4l2
and then mostly followed the instructions for USB webcams on Orange Pi website to install and configure motion:
sudo apt-get install motion
sudo nano /etc/motion/motion.conf
and enable the following line:
This will make sure the web server started by motion will be accessible from other network devices.
I’ve also changed target_dir to /home/orangepi/motion, as motion would crash each time it would create a file when detection motion.
chmod 777 motion
You’ll also need to change the startup script
sudo nano /etc/default/motion
and change the only line in the file as follows:
Finally, we are ready to give it a try:
sudo /etc/init.d/motion start
You can launch your favorite browser, or access localhost:8081 if you are using your board, or <orange_ip_address>:8081 from another machine on the network, and you should the the picture camera updated into your web browser about twice per second.
If the system detects motion will save pictures and videos in target_dir directory, which I set to /home/orangepi/motion earlier. The image resolution is set to 800×600, and it ignored width and height settings (320×240) set in motion.conf.
Motion will start automatically, but you still need to load the modules automatically at boot time for this to work. Simply edit /etc/modules, and add the two required modules at the end of the file.
Now motion will run automatically, and the camera work properly each time the board starts.
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.