Using camogm with Elphel393 camera

From ElphelWiki
Jump to: navigation, search


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 located in the /etc/elphel393 directory and called There is a set of parameters which this script receives from init script /etc/ini.d/init_elphel393 and one of them is responsible for SATA controller configuration and driver loading:

\"sata\"            :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. The program can be started the same way as described in Starting camogm section and it will create command pipe called camogm_cmd in the following directory:

root@elphel393:~# ls -l /var/volatile/state/
-rw-r--r-- 1 root root 176 Dec 21 18:56 camera
prwxrwxrwx 1 root root   0 Dec 21 19:28 camogm.state
prwxr-xr-x 1 root root   0 Dec 21 19:28 camogm_cmd

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 git page.

You can start camogm as a standalone command-line application or use web GUI interface in a browser to control the program. The examples of using camogm in both ways are shown below.


1. WebGUI

Fig.1 Camogmgui - change recording formats
Fig.2 Camogmgui - recording status
Fast recording

camogm can write data to disk or partition in a special fast recording mode. This mode supports higher sequential write speeds than those that can be achieved during regular file recording to a file system but additional step to extract data from disk is needed. Use these scripts to extract raw data from disk and split it into separate images.

  • Keep Use fast recording checkbox selected - press OK then RECORD
    • An image sequence will be written to a raw partition.
    • The Format: options will be disabled as well as Directory
Normal recording

In this mode camogm saves data to regular files on a file system.

  • Deselect Use fast recording
  • Choose Format (Ogg Media Stream is not tested)
  • Type Directory - the absolute path the images will be stored at. Can be anything (Must end with /):
    • /mnt/sdaX/ - internal SSD (example from Fig.1)
    • /mnt/mmc/ or other mounted mmc partition
  • Press OK then RECORD

2. Command line

  • recorded ports: all active ports will be recorded
  • mount point /mnt/sda1 (also works for a micro SD card partition, rootfs partition, USB or mounted NFS partition but the recording speed is slower than for an SSD)
  • 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/camogm.status

start recording:

echo "format=mov;status=/var/tmp/camogm.status;prefix=/mnt/sda1/;duration=600;length=1073741824;start" > /var/volatile/camogm_cmd

stop recording:

echo "stop" > /var/volatile/camogm_cmd

NOTE: sync is important if you power off the camera w/o proper unmounting of the media.