Difference between revisions of "Using camogm with Elphel393 camera"

From ElphelWiki
Jump to: navigation, search
(Created page with "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 ca...")
 
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
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:
+
===Introduction===
 +
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 ''init_elphel393.py''. 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_EN=1
+
  \"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:
 
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:
Line 17: Line 18:
 
  [  30.646115] sd 0:0:0:0: [sda] Attached SCSI disk
 
  [  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. <code>/dev/sda2</code> in this example is not partitioned and not mounted:
+
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. <code>/dev/sda2</code> in this example is not partitioned and not mounted:
  
 
  ~# mount
 
  ~# mount
Line 31: Line 32:
 
  /dev/sda1 on /mnt/sda1 type ext2 (rw,relatime,errors=continue)
 
  /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 [[Camogm#Starting_camogm|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:
+
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 [[Camogm#Starting_camogm|Starting camogm]] section and it will create command pipe called ''camogm_cmd'' in the following directory:
  
  ~# ls -l /var/volatile/
+
  root@elphel393:~# ls -l /var/volatile/state/
  prwxr-xr-x    1 root    root            0 May 31 16:55 camogm_cmd0
+
  -rw-r--r-- 1 root root 176 Dec 21 18:56 camera
prwxr-xr-x    1 root     root             0 May 31 16:55 camogm_cmd1
+
  prwxrwxrwx 1 root root   0 Dec 21 19:28 camogm.state
  prwxr-xr-x    1 root     root             0 May 31 16:55 camogm_cmd2
+
  prwxr-xr-x 1 root root   0 Dec 21 19:28 camogm_cmd
  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:
+
The status information output can be redirected to a file as described in [[Camogm#Sending_Commands_to_camogm|Sending commands to camogm]].
  
~# for i in `seq 0 3`; do echo "exit" > /var/volatile/camogm_cmd$i; done
+
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 [https://git.elphel.com/Elphel git page].
~# camogm /var/volatile/camogm_cmd
 
  
Alternatively, the status information output can be redirected to a file as described in [[Camogm#Sending_Commands_to_camogm|Sending commands to camogm]].
+
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.
 +
===Example===
 +
====1. WebGUI====
 +
* http://192.168.0.9/camogmgui.php
 +
* In the '''Format''' tab check the settings then press OK button
 +
{|
 +
| valign='top'|[[File:Camogmgui format tab.png|thumb|400px|Fig.1 Camogmgui - change recording formats]]
 +
| valign='top'|[[File:Camogmgui recording 1.png|thumb|400px|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 [https://git.elphel.com/Elphel/elphel-tools-x393 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:
 +
<font size='2'>
 +
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
 +
sync
 +
'''NOTE:''' ''sync'' is important if you power off the camera w/o proper unmounting of the media.
 +
</font>

Latest revision as of 19:30, 19 March 2017

Introduction

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 init_elphel393.py. 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.

Example

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
sync

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