Using camogm with Elphel393 camera
Elphel 393 series cameras can be equipped with m.2 SSD drive used for images and video recording. The camera equipped with a drive should be configured in a way that the drive can be accessible from Linux operating system. This is normally done with a configuration script which is executed during system boot. The script is usually located in the root directory on microSD card and called init_elphel393.sh. These is a set of parameters in the beginning of the script and one of them is responsible for SATA controller configuration and driver loading:
SATA_EN=1
Make sure this parameter is set to 1 if your camera is equipped with SSD drive. You should see the following messages in system log after successful initialization and auto-mounting:
[ 30.587212] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300) [ 30.594510] ata1.00: ATA-9: SanDisk SD8SMAT128G1122, Z2320000, max UDMA/133 [ 30.601426] ata1.00: 250069680 sectors, multi 1: LBA48 NCQ (depth 0/32) [ 30.616091] ata1.00: configured for UDMA/133 [ 30.620669] scsi 0:0:0:0: Direct-Access ATA SanDisk SD8SMAT1 0000 PQ: 0 ANSI: 5 [ 30.629879] sd 0:0:0:0: Attached scsi generic sg0 type 0 [ 30.630011] sd 0:0:0:0: [sda] 250069680 512-byte logical blocks: (128 GB/119 GiB) [ 30.630987] sd 0:0:0:0: [sda] Write Protect is off [ 30.631106] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 30.637003] sda: sda1 sda2 [ 30.646115] sd 0:0:0:0: [sda] Attached SCSI disk
The disk model and the number of partitions(sda1 and sda2) in the example above correspond to a test platform and they may not be the same in your camera. /dev/sda2
in this example is not partitioned and not mounted:
~# mount /dev/root on / type ext4 (rw,relatime,data=ordered) devtmpfs on /dev type devtmpfs (rw,relatime,size=449540k,nr_inodes=112385,mode=755) proc on /proc type proc (rw,relatime) sysfs on /sys type sysfs (rw,relatime) debugfs on /sys/kernel/debug type debugfs (rw,relatime) tmpfs on /run type tmpfs (rw,nosuid,nodev,mode=755) tmpfs on /var/volatile type tmpfs (rw,relatime) devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620) /dev/mmcblk0p1 on /mnt/mmc type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro) /dev/sda1 on /mnt/sda1 type ext2 (rw,relatime,errors=continue)
The program for video/images recording is called camogm. Its full description for previous series of Elphel cameras is available on Camogm wiki page. Current version of the program supports four sensor channels and has the same command set as the previous version, but commands can be sent to each channel separately. The program can be started the same way as described in Starting camogm section, but now it will create four command pipes instead of one and each pipe will have channel number appended to the name provided on command line:
~# ls -l /var/volatile/ prwxr-xr-x 1 root root 0 May 31 16:55 camogm_cmd0 prwxr-xr-x 1 root root 0 May 31 16:55 camogm_cmd1 prwxr-xr-x 1 root root 0 May 31 16:55 camogm_cmd2 prwxr-xr-x 1 root root 0 May 31 16:55 camogm_cmd3 drwxr-xr-x 2 root root 180 May 31 16:54 log drwxrwxrwt 2 root root 160 May 31 16:54 tmp
camogm is started from init_elphel393.sh script by default and its output is may not be visible on your console. You can stop current instances of the program and restart it from you terminal if the output should be visible:
~# for i in `seq 0 3`; do echo "exit" > /var/volatile/camogm_cmd$i; done ~# camogm /var/volatile/camogm_cmd
Alternatively, the status information output can be redirected to a file as described in Sending commands to camogm.
Note, that camogm is under development and not all features of the previous version have been ported to new camera. As for now, geo tagging and exif specific commands are not implemented. Watch for updates on our github page.
Example
1.
- channel 2 (0-3)
- mount point /mnt/sda1
- max duration = 10 min (new file every 10 mins or other limit)
- max size = 1GB (new file every 1GB or other limit)
- format = mov
- status updates: /var/tmp/camogm2.status
start recording:
echo "format=mov;status=/var/tmp/camogm2.status;prefix=/mnt/sda1/;duration=600;length=1073741824;start" > /var/volatile/camogm_cmd2
stop recording:
echo "stop" > /var/volatile/camogm_cmd2 sync
NOTE: sync is important if you power off the camera w/o proper unmounting of the media