TrapSnap

Axis FTP Setup

Axis web cam FTP setup for use with TrapSnap.
The following discussion has been derived from information on the Axis web site.
The original URL is : http://www.axis.com/techsup/cam_servers/tech_notes/ftp_snapshot.htm
If that is not available start by looking http://www.axis.com/techsup/.

This information applies to:

Overview

To make the snapshot available in the Network Cameras, one file has to be created and stored in the Camera, the /etc/inittab and the /etc/sftpd.conf have to be edited. The created file is used to create a directory in /tmp/ and then create three files which will be the images to 'get' by ftp.
The added entry in the /etc/inittab will execute the file at boot and /etc/sftpd.conf will make the snapshots available.

Example

Create a file with the following content:

#!/bin/sh
mkdir /tmp/jpg
mkdir /tmp/jpg/1
#If AXIS 2400, remove the following 3 remarks
#mkdir /tmp/jpg/2
#mkdir /tmp/jpg/3
#mkdir /tmp/jpg/4
cat >/tmp/jpg/image.jpg

# Remove the remarks in front of the "cat.." under the camera model you are using. 

# AXIS2100
#cat >/tmp/jpg/1/320x240.jpg
#cat >/tmp/jpg/1/640x480.jpg

# AXIS 2120/2401/2420 PAL
#cat >/tmp/jpg/1/352x288.jpg
#cat >/tmp/jpg/1/704x576.jpg

# AXIS 2120/2401/2420 NTSC
#cat >/tmp/jpg/1/352x240.jpg
#cat >/tmp/jpg/1/704x480.jpg

# AXIS 2400 PAL
#cat >/tmp/jpg/1/352x288.jpg
#cat >/tmp/jpg/1/704x576.jpg
#cat >/tmp/jpg/2/352x288.jpg
#cat >/tmp/jpg/2/704x576.jpg
#cat >/tmp/jpg/3/352x288.jpg
#cat >/tmp/jpg/3/704x576.jpg
#cat >/tmp/jpg/4/352x288.jpg
#cat >/tmp/jpg/4/704x576.jpg

# AXIS 2400 NTSC
#cat >/tmp/jpg/1/352x240.jpg
#cat >/tmp/jpg/1/704x480.jpg
#cat >/tmp/jpg/2/352x240.jpg
#cat >/tmp/jpg/2/704x480.jpg
#cat >/tmp/jpg/3/352x240.jpg
#cat >/tmp/jpg/3/704x480.jpg
#cat >/tmp/jpg/4/352x240.jpg

Save the file as 'prepftpget'.

Start a command prompt and change to the directory where the prepftpget file was saved.
Open an ftp session to your camera and type the command viewed in bold below:
C:\Axis >ftp <ip address of camera>
Connected to <ip address of camera>
220 Axis 2100 Network Camera 2.12 Feb 05 2001 ready.
User (<ip address of camera>:(none)): root
331 User name okay, need password.
Password: pass (if not changed from default)
230 User logged in, proceed.
ftp> ascii
200 Command okay.
ftp> cd /etc/httpd/html
250 Command successful.
ftp> put prepftpget
200 Command okay.
150 Opening data connection.
226 Transfer complete.
ftp: 32 bytes sent in 0,00Seconds 32000,00Kbytes/sec.
ftp> quote
Command line to send SITE CHMOD 744 prepftpget
200 Command okay.

Get the /etc/inittab file from the Camera:
ftp> cd /etc
ftp> get inittab
200 Command okay.
150 Opening data connection.
226 Transfer complete.
ftp: 1380 bytes received in 0,01Seconds 138,00Kbytes/sec.

At this stage, open the downloaded inittab file in an editor and add the following line at the bottom:

prepftpget:3:once:/etc/httpd/html/prepftpget

Save the file.

Go back to the ftp session and continue:
ftp> put inittab
200 Command okay.
150 Opening data connection.
226 Transfer complete.
ftp: 1414 bytes sent in 0,00Seconds 1414000,00Kbytes/sec.
250 Command successful.

Get the /etc/sftpd.conf file from the Network Camera:
ftp> get sftpd.conf
200 Command okay.
150 Opening data connection.
226 Transfer complete.
ftp: 1380 bytes received in 0,01Seconds 138,00Kbytes/sec.

At this stage, open the downloaded sftpd.conf file in an editor and change according to the following. Don't forget to remove the appropriate remarks, depending on what camera used:

# /etc/sftpd.conf - Configuration file for sftpd
# To change the FTP port use /bin/sftpd [port]
#
# Use absloute paths

#Transfer <virtual path> <socket path> 
Transfer /tmp/jpg/image.jpg /tmp/camdsocket

# Remove the remarks in front of the "Transfer.." under the camera model you are using. 
# AXIS2100
#Transfer /tmp/jpg/1/320x240.jpg /tmp/camdsocket
#Transfer /tmp/jpg/1/640x480.jpg /tmp/camdsocket

# AXIS 2120/2401/2420 PAL
#Transfer /tmp/jpg/1/352x288.jpg /tmp/camdsocket
#Transfer /tmp/jpg/1/704x576.jpg /tmp/camdsocket

# AXIS 2120/2401/2420 NTSC
#Transfer /tmp/jpg/1/352x240.jpg /tmp/camdsocket
#Transfer /tmp/jpg/1/704x480.jpg /tmp/camdsocket

# AXIS 2400 PAL
#Transfer /tmp/jpg/1/352x288.jpg /tmp/camdsocket
#Transfer /tmp/jpg/1/704x576.jpg /tmp/camdsocket
#Transfer /tmp/jpg/2/352x288.jpg /tmp/camdsocket
#Transfer /tmp/jpg/2/704x576.jpg /tmp/camdsocket
#Transfer /tmp/jpg/3/352x288.jpg /tmp/camdsocket
#Transfer /tmp/jpg/3/704x576.jpg /tmp/camdsocket
#Transfer /tmp/jpg/4/352x288.jpg /tmp/camdsocket
#Transfer /tmp/jpg/4/704x576.jpg /tmp/camdsocket

# AXIS 2400 NTSC
#Transfer /tmp/jpg/1/352x240.jpg /tmp/camdsocket
#Transfer /tmp/jpg/1/704x480.jpg /tmp/camdsocket
#Transfer /tmp/jpg/2/352x240.jpg /tmp/camdsocket
#Transfer /tmp/jpg/2/704x480.jpg /tmp/camdsocket
#Transfer /tmp/jpg/3/352x240.jpg /tmp/camdsocket
#Transfer /tmp/jpg/3/704x480.jpg /tmp/camdsocket
#Transfer /tmp/jpg/4/352x240.jpg /tmp/camdsocket
#Transfer /tmp/jpg/4/704x480.jpg /tmp/camdsocket


#Cgi <virtual path> <cgi-bin path> 

Save the file.

Go back to the ftp session and continue:
ftp> put sftpd.conf
200 Command okay.
150 Opening data connection.
226 Transfer complete.
ftp: 1414 bytes sent in 0,00Seconds 1414000,00Kbytes/sec.
250 Command successful.
ftp> by
221 Goodbye.

Restart the Camera and the images should be available via FTP at /tmp/jpg/ and  /tmp/jpg/1/, 
if AXIS 2400, camera 2-4 available at /tmp/jpg/2/. /tmp/jpg/3/ and /tmp/jpg/4/

Axis & NETic do not take any responsibilities for how this configuration changes may affect your system. If the modification fails or if you get other unexpected results, you may have to restore the factory default settings as described in the Userís Manual.

Thanks to Axis for kindly letting us reproduce this information.