0. Pasang Kamera SH-2035 ke Orange Pi

Cara untuk memasang camera ke board Orange Pi bisa dilihat pada gambar dibawah ini
Cara pasang modul kamera orange pi SH-2035

1. Install armbian

Disini saya tidak akan menjelaskan cara install Armbian, karena sudah pernah saya tulis sebelumnya di Menginstall ARMBian di Orange Pi PC

2. Aktifkan Module Kernel

Di terminal sebagai root jalankan

modprobe gc2035
modprobe vfe_v4l2

3. Motion

Install motion

apt-get install motion

Edit file konfigurasi motion di /etc/motion/motion.conf, bagian yang perlu diubah

logfile /tmp/motion.log
target_dir /var/lib/motion
stream_localhost on

menjadi

logfile /var/log/motion.log
target_dir /home/motion
stream_localhost off

/home/motion adalah tempat file gambar disimpan.
stream_localhost off agar web interface bisa diakses dari LAN.

Buat file tempat menyimpan file gambar hasi capture kamera.

mkdir /home/motion
chmod 777 /home/motion

jalankan motion

service motion start

coba akses web interface di IP.ORANGE.PI:8080, contoh di tempat saya 192.168.2.111:8081
tampilan kamera orange pi

Bila hasil gambar terbalik, bisa diubah di file motion.conf dibagian

rotate 0

nilai yang bisa digunakan 0, 90, 180, 360.

Bila masih belum berhasil, coba cek log di /var/log/motion.log, contoh log motion berhasil mengambil gambar

[1] [NTC] [VID] [Oct 21 14:53:50] vid_v4lx_start: Using videodevice /dev/video0 and input -1
[1] [NTC] [VID] [Oct 21 14:53:50] v4l2_get_capability: 
------------------------
cap.driver: "sunxi-vfe"
cap.card: "sunxi-vfe"
cap.bus_info: "sunxi_vfe sunxi_vfe.0"
cap.capabilities=0x05000001
------------------------
[1] [NTC] [VID] [Oct 21 14:53:50] v4l2_get_capability: - VIDEO_CAPTURE
[1] [NTC] [VID] [Oct 21 14:53:50] v4l2_get_capability: - READWRITE
[1] [NTC] [VID] [Oct 21 14:53:50] v4l2_get_capability: - STREAMING
[1] [NTC] [VID] [Oct 21 14:53:50] v4l2_select_input: name = "", type 0x00000002, status 00000000
[1] [NTC] [VID] [Oct 21 14:53:50] v4l2_select_input: - CAMERA
[1] [WRN] [VID] [Oct 21 14:53:50] v4l2_select_input: Device doesn't support VIDIOC_G_STD
[1] [NTC] [VID] [Oct 21 14:53:50] v4l2_do_set_pix_format: Testing palette YU12 (320x240)
[1] [WRN] [VID] [Oct 21 14:53:50] v4l2_do_set_pix_format: Adjusting resolution from 320x240 to 640x480.
[1] [NTC] [VID] [Oct 21 14:53:51] v4l2_do_set_pix_format: Using palette YU12 (640x480) bytesperlines 0 sizeimage 0 colorspace 00000000
[1] [NTC] [VID] [Oct 21 14:53:51] v4l2_scan_controls: found control 0x00980911, "Exposure", range -4,4 
[1] [NTC] [VID] [Oct 21 14:53:51] v4l2_scan_controls: 	"Exposure", default 0, current 0
[1] [NTC] [VID] [Oct 21 14:53:51] vid_v4lx_start: Using V4L2
[1] [NTC] [ALL] [Oct 21 14:53:51] motion_loop: Camera has finally become available
Camera image has different width and heightfrom what is in the config file. You should fix that
Restarting Motion thread to reinitialize all image buffers to new picture dimensions
[1] [NTC] [ALL] [Oct 21 14:53:51] motion_loop: Thread exiting
[1] [NTC] [STR] [Oct 21 14:53:51] stream_stop: Closing motion-stream listen socket & active motion-stream sockets
[1] [NTC] [STR] [Oct 21 14:53:51] stream_stop: Closed motion-stream listen socket & active motion-stream sockets
[1] [NTC] [VID] [Oct 21 14:53:51] vid_close: Closing video device /dev/video0
[0] [NTC] [ALL] [Oct 21 14:53:51] main: Motion thread 1 restart
[1] [NTC] [ALL] [Oct 21 14:53:51] motion_init: Thread 1 started , motion detection Enabled
[1] [NTC] [VID] [Oct 21 14:53:51] vid_v4lx_start: Using videodevice /dev/video0 and input -1

Streaming sukses ;)

Join the Conversation

1 Comment

Your email address will not be published. Required fields are marked *