Axis Technical Training

advertisement
Axis Technical Training
AXIS CAMERA Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
TABLE OF CONTENTS
AXIS TECHNICAL TRAINING
1
TABLE OF CONTENTS
2
Session 1: Practical case, Installation of 1 Camera.
Set IP Address “IP Utility”
Set IP Address using ARP
Browse and check Camera
Configure TCP/IP parameters
Focus Assistant
Choose Resolution , Compression.
Users & Password.
Save Configurations and Server Report.
Upgrade Firmware
Test - Upload to FTP.
Lens calculation – Focal Length
Lens calculation – Focal Length
Pixel calculation
Mr. ROTAKIN
Mr. ROTAKIN con’t
Bandwidth calculation
Bandwidth measurement on your PC
Bandwidth measurement using software
Camera bandwidth measurement
Camera bandwidth measurement con’t
Axis Camera Recorder
Axis Camera Recorder – I/O
Axis Camera Recorder – Scheduler
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Session 2: External Devices, Internet considerations.
Audio Module
Wireless LAN
Wireless LAN advanced settings
Install PTZ Camera
28
29
30
31
32
Session 3: HTTP commands, Web design.
HTTP - API introduction
HTTP - API Image commands
HTTP - API Parameter commands
HTTP - API Input / Output
Your Own Web Page
Camera Web Page stored on Web Server
Camera Web Page stored in Camera
Camera Web Page - variations
33
34
35
36
37
38
39
40
41
Session 4: Scripting.
42
EMBEDDED SCRIPTING – HANDS-ON
44
1 Create a small script and run it
1.1 Enable telnet
45
45
2
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
1.2 Open a telnet session to the Axis device and create a new scripts directory in /etc/
1.3 Create the script
1.4 Run the script
45
45
45
2 Run built-in applications from the shell prompt
2.1 Print a message to the log file
2.2 Get the network parameters to standard out
2.3 Take a snapshot image
2.4 Upload the image to an FTP server
2.5 Start an image buffer
2.6 Stop the image buffer
2.7 Send the images in an e-mail to yourself
2.8 Remove the image buffer
46
46
46
46
46
46
47
47
47
3 Run built-in applications from a shell script
3.1 Create the script
3.2 Run the script
48
48
48
4 Run shell scripts from task.list
4.1 Create the task.list file
4.2 Modify the task.list file
4.3 Modify the script file
4.4 Trigger the script
49
49
49
49
50
5 Create a custom web page
5.1 Create the html file
5.2 Make your web page to the default page
51
51
51
6 Create CGI scripts
6.1 Create the script directory
6.2 Modify boa.conf
6.3 Create the CGI script
52
52
52
52
3
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Session 1: Practical case, Installation of 1 Camera.
Objectives: After completing this Lab you will be able to:








Design complete surveillance solution for a typical site.
Choose appropriate equipment.
Calculate Storage, Bandwidth and CPU needs.
Calculate lens specifications.
Install the camera on a network.
Assign an IP Address and verify the setting.
Adjust lenses.
Install, configure and test surveillance software.
4
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Set IP Address “IP Utility”
1. Run the executable version of Axis IP Utility.
2. Acquire an IP Address from the instructor.
3. Look up and note down the Ethernet Address of the Camera. This
is the Serial No. of the Camera labeled on the bottom of Camera.
4. Enter the Serial number in the Serial Number field: e.g.
00408C3E45A7
5. Enter the IP Address.
6. Click on “Set IP” button.
7. IP Utility will prompt you to reset the camera. Remove power
supply connector from the Camera and reconnect again.
Own notes:
5
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Set IP Address using ARP
1. Connect an Ethernet cable to the Camera and attach it to the
network. Attach the Power Supply to Camera and power it up.
2. Acquire an IP Address from the instructor.
3. Look up and note down the Ethernet address of the Camera. This is
the Serial no. of the Camera labeled on the bottom of Camera.
4. Start “Command Prompt” software on your PC
[Start / Programs / Accessories / Command Prompt]
5. Enter the following command:
ARP –a 
This displays the ARP routing table of the specific PC
6. Enter the following command:
ARP –s [IP Address] [Ethernet Address] 
ex: ARP –s 192.168.1.52 00-40-8c-e3-4d-5a 
7. Enter Ping command:
PING [IP Address] –t 
ex: PING 192.168.1.52 –t 
8. Remove power supply connector from the Camera and reconnect
again. This action resets the Camera.
9. Approximately 10-15 seconds after connecting the power supply,
the message ‘Reply from 192.168.1.52...’ – or similar, is returned
in the Command Prompt. Ensure that the Power Indicator is
permanently lit and that the Network Indicator flashes
intermittently.
10.Find out routing table changes with ARP –a 
11.Delete camera IP. ARP –d 192.168.1.52 
12.Ping the camera once more: PING 192.168.1.52 
13.What is in ARP table? Explain why.
NOTE: It is important to use a Hub, alternatively direct connection to PC
using cross over Ethernet cable. (Switch and Router filter ARP
commands).
You have to have Administrator rights on your PC, ARP commands are
allowed only with these rights.
Own notes:
6
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Browse and check Camera
1. Start the Web Browser on your PC
[Start / Programs / Internet Explorer]
2. Enter the IP Address of the Camera in the “ADDRESS” field
ex: 192.168.1.52 or http://192.168.1.52
3. The Home Page of the Camera is displayed.
4. What happens if ActiveX is not installed on the PC?
5. What is prerequisite for downloading ActiveX.
Pls. NOTE: To enable the updating of images in Microsoft Internet
Explorer, you must set your browser to allow ActiveX controls and
perform once-only installation of the Axis ActiveX component onto your
workstation. Contact the Administrator if your computer environment
restricts or prohibits the installation of additional software components.
Another possibility to enable the ActiveX download is to change the
Security Level of the Web Browser. Tools / Internet Options /
Security / Default Level; set Security Level for this Zone to Medium.
Important: Do not jeopardize security of the Network, query your
Administrator for details.
If ActiveX is not allowed on your Browser you can use Java Applet
instead. Admin / Image change Default Viewer to Java Applet.
Netscape: It is possible to view the camera in web browser Netscape.
Use Java Applet.
Macintosh: It is possible to view the camera but Netscape has to be
used (no support for Microsoft Internet Explorer). Use Java Applet.
Own notes:
7
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Configure TCP/IP parameters
1.
2.
3.
4.
Click Admin in Camera Home Page.
Enter Network and configure these parameters.
Subnet Mask, Default Router, Host Name.
Discuss all other parameters.
Own notes:
8
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Focus Assistant
Browse to the Home Page of your Camera.
Enter Administrator page.
Click “Image / Focus”.
Enable “Focus Assistant” function, click “Enable”.
Turn Camera Lens Focus slowly and observe the Status Indicator
(green / yellow / red lamp) on front of Camera. Turn lens until
green indication.
6. Check in Web Browser if focus is correctly adjusted.
1.
2.
3.
4.
5.
Own notes:
9
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Choose Resolution , Compression.
1.
2.
3.
4.
Browse to the Home Page of your Camera.
Enter Administrator page (User: root; Password: pass).
Chose Resolution and Compression.
Click on “Image” and change image Resolution, Compression.
Click “Save” and “Live View” to view the entered changes.
5. Choose and enter your image settings and check the result:
Brightness, Color Level, Text, Date, Time.
Own notes:
10
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Users & Password.
1.
2.
3.
4.
Enter Admin / System / Users.
Check User Rights radio buttons.
Enter Name Password and Verify.
Change ROOT password, this is outmost important to safeguard
your camera.
5. Note that the Web cache remembers your settings. Always exit
the Web Browser after use.
Own notes:
11
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Save Configurations and Server Report.
1.
2.
3.
4.
5.
6.
7.
8.
9.
Enter
Admin / Support / Parameters
You will be prompt to save file as paramlist.cgi
Click
Save and chose directory to save this file.
Read and examine this paramlist.cgi, you have to open an editor
such as WordPad.
Attach this file to your mail-communication with Axis Customer
Services
Enter
Admin / Support / Server Report
Save the Server Report in HTML format
Click
File / Save As….
Attach this file to your mail-communication with Axis Customer
Services
Own notes:
12
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Upgrade Firmware
1. Obtain the latest Firmware suitable for your Camera and store it on
your computer.
2. Disable camera applications.
3. Change directory on your PC to directory containing the firmware
upgrade file.
4. Start Command Prompt on your PC.
5. Open FTP connection ex. FTP 10.13.3.90 
6. Login as root, default password is “pass”.
7. Type “bin”  for binary transfer.
8. Type “hash” 
9. Type “put XXX.bin flash_all” where XXX.bin is the firmware upgrade
file name. Ex. put 2120_234.bin flash_all 
10.Wait for the flash to finish, this may take 1-10 minutes.
11.The unit will automatically restart.
You have to login as ROOT. If you have disabled this user then you have
to add Root user once more.
“put XXX.bin flash_all” does set the Camera to Factory Default. Use
command “put XXX.bin flash” to retain your settings.
Own notes:
13
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Test - Upload to FTP.
1. Click Operation. Select Sequential Mode.
2. Enter Scheduler. Restrict Alarm to one day (today) and choose
Image Frequency. Enter Upload. Use FTP method to upload
pictures. Your instructor provides you with FTP Server details.
3. (Host Name, User Name, Password and Upload Path)
4. Enter Enable. Click on Enable button to start this operation.
5. Examine the Log File. Support / Log File. Reconfigure Upload if
the Log shows errors.
Own notes:
14
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Lens calculation – Focal Length
1. Calculate by hand the Focal Length according to equation given
below.
2. Get the specification of your camera CCD sensor (e.g. 1/3”).
3. Get the specification of your camera lens, specifically the range of
f=focal length.
4. Remember the ratio 4x3 for Width and Height.
5. Calculate f for several objects.
Note: H = horizontal object dimension = width
15
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Lens calculation – Focal Length
h = ____________
D = distance to
object
H = width of
object
20 m
10
2m
50
Calculate f
100 m
2m
16
Camera Workshop
Advanced Level
Version 1.0
Height of object
______________________________________________________ Axis Technical Training
Pixel calculation
1. Direct your camera to a picture of a face and adjust the vari-focal
so the face covers about 10% of the frame.
2. Is it possible to recognize this face?
3. Calculate by hand horizontal number of pixels for a face that
occupies 10% of the frame (horizontally).
4. Choose different resolutions (large, small) and repeat the above.
5. What happens if the face covers 5% of the frame?
6. Is it still possible to recognize this face?
7. -------------8. Direct your camera to a picture of a car with license plate visible.
9. Adjust the vari-focal so the whole car covers about 50% of the
frame horizontally.
10.Can you read the license plate?
11.Measure license plate coverage of the frame.
12.Calculate license plate coverage expressed in pixels.
13.-------------14.Calculate one character width (on the license plate) expressed in %
and in pixels.
15.How many pixels are needed to express a character?
Note: These are just simple guidance to get a feeling of picture resolution.
In any official discussions Always refer to standard EN 50132-7.
17
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Mr. ROTAKIN
1.
2.
3.
4.
Review CENELEC standard regarding recognition.
Rotakin is 1.60 meters high, estimate height of the face.
Calculate percentage of frame and compare to previous exercise.
Is it possible to recognize this face?
18
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Mr. ROTAKIN con’t
http://www.homeoffice.gov.uk/docs/or_manual.pdf
CENELEC standard EN 50132-7
WWW.CENELEC.ORG
19
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Bandwidth calculation
1.
2.
3.
4.
5.
Calculate by hand bandwidth needed in the following table.
Choose and get the size of the picture in Kbytes (frame size).
Multiply with number of frames per second (sample per sec).
Multiply by ten to get Kbits per second (10).
Bandwidth = frame size x sample per sec x 10.
Resolution
Compression
352 x 288
352 x 288
Medium
Low
704 x 576
704 x 576
Medium
Low
Own notes:
20
Camera Workshop
Advanced Level
Version 1.0
Kbyte/frame
Calculated Bandwidth (Kbit/s)
______________________________________________________ Axis Technical Training
Bandwidth measurement on your PC
1. Choose resolution and compression on the Admin page.
2. Make your own temporary directory on HDD.
3. Start downloading stream according to following HTTP command
http://cam_IP_addr/axis-cgi/mjpg/video.cgi?req_fps=xx
ex: http://10.13.3.90/axis-cgi/mjpg/video.cgi?req_fps=10
fps refers to frame per second – choose several rates.
4. Camera prompts you to save or open file download.
5. Click Save and choose your own temporary directory
6. Read the Transfer Rate given in the dialogue.
7. Click Cancel to stop.
8. Fill the following table.
Resolution
Compression
352 x 288
352 x 288
Medium
Low
704 x 576
704 x 576
Medium
Low
Kbyte/frame
Measured Bandwidth (Kbit/s)
Note: This method saves the “file” in temporary memory. Close this file
download as soon as possible.
Own notes:
21
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Bandwidth measurement using software
1.
2.
3.
4.
5.
6.
7.
8.
9.
Start Bandwidth Controller application on your PC.
Click New to add new Filter.
Choose Direction to Receive and Protocol to IP.
Leave Source IP address unchanged at Any.
Change Destination IP address to Equal to.. and enter your
computer IP address.
Click OK and Accept.
Start the measurement by Statistics…
Read the Bandwidth. Note this value is in bytes per second.
Multiply by 10 to get bits per second.
Note: The measurement applies your PC only. Traffic to or from your
computer only.
Own notes:
22
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Camera bandwidth measurement
1.
2.
3.
4.
Run Bandwidth Controller according to above.
Start viewing one camera in Internet Explorer.
Read the bandwidth in Bandwidth Controller.
Change camera resolution and compression to several values
and read the required bandwidth.
5. Fill the following table with the recommended compression ratio.
6. Compare with your calculation in previous exercises.
Resolution
Compression
352 x 288
352 x 288
Medium
Low
704 x 576
704 x 576
Medium
Low
Own notes:
23
Camera Workshop
Advanced Level
Version 1.0
Kbyte/frame
Measured Bandwidth (Kbit/s)
______________________________________________________ Axis Technical Training
Camera bandwidth measurement con’t
1.
2.
3.
4.
5.
6.
7.
8.
9.
Start several Internet Explorer browsers on your PC.
View more cameras in these browsers.
Measure bandwidth.
Do you reach a limit of your computer?
Change Max Bandwidth in Admin / Network on one camera.
Measure bandwidth of this camera.
---------------------------------Use a FTP server and repeat the above measurements.
Measure ACR bandwidth.
Own notes:
24
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Axis Camera Recorder
1. Configure ACR, Axis Camera Recorder.
2. Start Administrator on your PC: Start / Programs / AXIS
Camera Recorder / Administrator.
3. Add Device… add several camera. Use default password “pass” or
your individual password. OK to exit.
4. Monitor Manager… Choose Layout Size and Hot Spot. Select
Camera and arrange your cameras in different frames of Monitor
Manager. OK to exit.
5. Exit Administrator.
6. Start Monitor. Start / Programs / AXIS Camera Recorder /
Monitor. Click Manual and Start All.
7. Click on one Camera Window, this camera is shown in Hot Spot
Window as well.
8. Choose Quick Browse. Use forward/backward arrows
underneath to Browse recorded images.
9. Choose Recordings.
10.Left click and hold the Time Line, this is the yellow graph below
the picture. Drag left and right to view recorded pictures.
11.Use Play Arrow button and Double-Arrow buttons situated left
and right from Time Line.
25
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Axis Camera Recorder – I/O
1. Start ACR Administrator
2. Enter I/O Setup..
3. Click on camera and enter “Add new output event”.
4. Enter your data and test the output by “Test Output”.
5. Exit back to Administrator, OK twice.
6. Click on + to expand to Camera 1. Click “Settings”.
7. Click Outputs.
8. Expand your camera, click + and click on your output.
9. Click on double arrow On Manual Control.
10.Exit Administrator by clicking Exist, OK.
11.Start ACR Monitor.
12.New button with your output name is visible, click this button to
activate your output.
13.--------------------14. Elaborate Output on Motion Detection.
26
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Axis Camera Recorder – Scheduler
1. Start ACR Administrator
2. Enter Scheduler..
3. Enter your scheduled timing of camera. Your monitoring should
start soon after you finish this entry, choose appropriate time.
4. Start ACR Monitor, do not click on Start All or Start.
5. Wait and see if the ACR start recording according to your entry.
27
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Session 2: External Devices, Internet considerations.
Objectives: After completing this Lab you will be able to:




Connect and configure Audio accessories and compare sound
quality.
Connect and configure PTZ camera and use it in ACR.
Connect and configure W-LAN accessories and understand security
aspects.
Configure DynDNS router and understand Internet connectivity
possibilities with regards to camera.
28
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Audio Module
1. Power Off your Camera.
2. Connect the supplied Serial Cable Audio Module and Camera.
3. Connect Power Supply to Audio Module.
4. Power On your Camera.
5. Configure Audio Module on Camera Web page.
6. Enter Admin / External Devices / Audio.
7. Choose your settings.
8. Enable Audio function: External Devices / Selection.
9. Enter Live View and test the Audio function.
10.Configure Audio module in different settings on Audio page and
test these functions.
Own notes:
29
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Wireless LAN
1. Connect Axis 802.11b Wireless Device Point to your Camera using
cross-over Ethernet cable.
2. Power up the Device Point.
3. Connect Axis 802.11b Wireless Access Point to a Hub using regular
Ethernet cable. Power it up.
4. Start Smart AP Utility on your computer and log in, password is
“default”.
5. Configure the Network Settings and press Apply button. (IP
address, Subnet Mask, Default Router).
6. Exit Smart AP Utility.
7. Enter the camera Home Page and check the function.
Own notes:
30
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Wireless LAN advanced settings
1. Connect Axis 802.11b Wireless Device Point to your Computer using
cross-over Ethernet cable.
2. Change Computer IP to 192.168.1.10. Default IP of the Device
Point is 192.168.1.1. Browse to Device Point Home Page, URL
192.168.1.1.
3. Default password is “default”.
4. Change the IP address to your Network address, ex. 10.13.3.105.
Change the Computer IP back to its original IP.
5. Change the parameters of the Device Point and the Access Point.
Security, Hide AP access, MAC access control.
6. Elaborate different settings.
Own notes:
31
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Install PTZ Camera
1.
2.
3.
4.
Connect Axis EVI-D31 PTZ Camera to Axis Video Server 2400+.
Set IP address to 2400+.
Enter Video server Home Page.
Go to Admin / External Devices / PTZ and Select Driver for the
particular PTZ Camera.
5. Click External Devices / Selection and check radio button “PTZ
or other external device”.
6. Save the settings and enter Live View.
7. Explore all possibilities of the PTZ.
Own notes:
32
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Session 3: HTTP commands, Web design.
Objectives: After completing this Lab you will be able to:






Understand camera HTTP commands.
Seek HTTP command in manual and use these.
Understand HTML structure.
Make own HTML Web page.
Construct own camera Web page on Web Server.
Construct own camera Web page placed in camera.
33
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
HTTP - API introduction
1. Review the HTTP-API manual on Web page:
http://www.axis.com/techsup/cam_servers/dev/cam_http_api.htm
or added on the enclosed CD.
2. Commands has the following syntax:
http://<server_name>/jpg/image.jpg
where server_name is the IP address of your camera.
3. This HTTP command could be written in URL address field of the
Web browser in use. It can be inserted in your Web page and script.
4. --------------------5. Write this command in URL address field,
http://<server_name>/jpg/image.jpg
ex: http://10.13.3.90/jpg/image.jpg
6. The resolution and compression are taken from the camera
settings.
7. Change resolution and repeat the HTTP command:
http://<server_name>/jpg/image.jpg
8. Note that the camera responses back to your Web browser
HTTP://1.0 200 Ok\r\n that’s why your browser might get white at
same HTTP commands. You might recognize the response:
HTTP://1.0 404 Not Found\r\n
9. ---------------------10.You may enter parameters at the end of HTTP command such as:
http://10.13.3.90/axiscgi/jpg/image.cgi?resolution=704x576&clock=1&compression=50
Note:
? = delimiter to parameters
& = delimiter to the next parameter.
34
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
HTTP - API Image commands
1. Go to HTTP-API manual section 5.2
2. Enter the command:
http://myserver/axiscgi/jpg/image.cgi?resolution=353x288
Note: resolution has to be exact according to you camera.
2120 -> 352x288
2110 -> 320x240
3. Choose different resolution 640x480 (2120 -> 704x576)
4. http://10.13.3.90/axiscgi/jpg/image.cgi?resolution=704x576&clock=1
5. Change the resolution : http://10.13.3.90/axiscgi/jpg/image.cgi?resolution=704x576&clock=1&comression=50
Note: 0 to 100 % compression. (0% = no compression)
6. Change and experiment with this command according to 5.2.2
35
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
HTTP - API Parameter commands
1. Go to HTTP-API manual section 5.1
2. Enter the command:
http://10.13.3.90/axiscgi/admin/getparam.cgi?Network.IPAddress
Camera answers with IP address.
3. Enter Network request:
http://10.13.3.90/axis-cgi/admin/getparam.cgi?Network
4. --------------------5. View the Log:
http://10.13.3.90/axis-cgi/admin/systemlog.cgi
6. Finally Reset the camera:
http://10.13.3.90/axis-cgi/admin/restart.cgi
36
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
HTTP - API Input / Output
1. Connect LED (light emitting diode) and switch button to your
camera I/O connector. The LED indicates camera output level. The
switch is simulating an external Alarm input, such as Door switch,
Infrared Sensor etc.
2. Activate the I/O with this URL address: 'http://10.13.3.90/axiscgi/io/output.cgi?action=1:/
3. Deactivate: 'http://10.13.3.90/axiscgi/io/output.cgi?action=1:\
4. Activate output for 1 second: 'http://10.13.3.90/axiscgi/io/output.cgi?action=1:/1000\
5. Blink 4 times with 0.5 sec interval: http://10.13.3.90/axiscgi/io/output.cgi?action=1:/500\500/500\500/500\500/5
00\
6. Examine input: http://10.13.3.90/axiscgi/io/input.cgi?check=1 Push and release the switch button
intermittently and Refresh the Web Browser.
7. -------------------------8. Input simulation is possible using the Virtual Input:
http://10.13.3.90/axis-cgi/io/virtualinput.cgi?action=1:/
Own notes:
37
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Your Own Web Page
1. Use HTML editor such as Microsoft FrontPage or preferably write
your code in HTML in a text editor.
Note: Web editor inserts its own codes, sometimes erroneous
2. Write small test Web page.
3. Save and FTP it to the Web server.
4. Surf to the page and view your test page.
38
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Camera Web Page stored on Web Server
5.
6.
7.
8.
Enter your camera Home Page and click Demo Web.
Right click on the white background and View Source.
You see the HTML code of the Demo page. We will modify it:
Scroll down to middle of the page to line
<!-- End of image display part -->
9. Delete all lines below except the last line: </BODY></HTML>
10. Save As.. this new file on your directory webdirectory. Ex. myweb-page.html
Note: must be HTML file
11.Start Command Prompt.
12.Change Directory to your own.
Ex. C: 
CD webdirectory 
13.Launch FTP, use your user and password such as “elev-1” and
“elev-1”. Ex. FTP 10.13.3.200 
14.Change directory on your Web server to your directory.
15.Transfer the file from your computer to camera:
put my-web-page.html
16.Enter new URL in your Web Browser:
http://10.13.3.200/web/my-web-page.html
17.--------------------------18.Change some text and settings of the picture.
19.Go back to your HTML file in Notepad and change the following:
line <title>352x288 MJPG Live Demo</title> change the text
between the tags.
line <h2>Motion JPEG of 352x288 image</h2> change the text.
20.Change displayed width and height:
// DisplayWidth & DisplayHeight specifies the displayed width &
Height of the image.
// You may change these numbers, the effect will be a stretch or a
shrink of the image
var DisplayWidth = "352";
var DisplayHeight = "288";
39
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Camera Web Page stored in Camera
1.
2.
3.
4.
Enter your camera Home Page and click Demo Web.
Right click on the white background and View Source.
You see the HTML code of the Demo page. We will modify it:
Scroll down to middle of the page to line
<!-- End of image display part -->
5. Delete all lines below except the last line: </BODY></HTML>
6. Save As.. this new file on your directory. Ex. my-web-page.html
7. Start Command Prompt.
8. Change Directory to your own.
Ex. C: 
CD webdirectory 
9. Launch FTP, use “root” and “pass”. Ex. FTP 10.13.3.90 
10.Change directory on your camera to etc / httpd / html
11.Transfer the file from your computer to camera:
put my-web-page.html
12.Enter new URL in your Web Browser:
http://10.13.3.90/local/my-web-page.html
13.Change some text and settings of the picture.
14.Go back to your HTML file in Notepad and change the following:
line <title>352x288 MJPG Live Demo</title> change the text
between the tags.
line <h2>Motion JPEG of 352x288 image</h2> change the text.
15.Change displayed width and height:
// DisplayWidth & DisplayHeight specifies the displayed width &
Height of the image.
// You may change these numbers, the effect will be a stretch or a
shrink of the image
var DisplayWidth = "352";
var DisplayHeight = "288";
16. Enjoy your own Web Page.
Note: Camera posses its own Text Editor, HTML and Script text can
be modified and saved directly in the Camera. URL Address to the
editor: http://10.13.3.90/admin-bin/editcgi.cgi
Click Submit without entering file name, directory tree is displayed.
Own notes:
40
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Camera Web Page - variations
1. Change your page and test the results:
2. Change the Text
<h2>Motion JPEG of 352x288 image</h2>
3. As an example <h1>Motion JPEG of 352x288 image</h1>
4. Save As… this file and FTP it to the web server to test it.
5. Change background color:
<body bgcolor="#FFFFFF">
6. change the hex no ex: <body bgcolor="#1E95F0">
you got a blue color.
7. Save As… this file and FTP it to the web server to test it.
8. ------------------------9. Use Web Editor to change other element in your page.
10.Take picture of yourself with the camera you posses and save it as
JPG file.
11.Enter this JPG file as a logo on your Web page.
12.Try to enter it as a background.
13.Add different text and JPG picture to your professional Web Page.
41
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Session 4: Scripting.
Objectives: After completing this Lab you will be able to:




Understand Camera File Structure.
Use the Camera Editor.
Understand and use FTP and Telnet.
Make simple scripts.
42
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
43
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
Embedded scripting – Hands-on
44
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
1 Create a small script and run it
1.1 Enable telnet
Open the built-in editor in a browser;
http://<IPaddress>/admin-bin/editcgi.cgi
Press the Submit button.
Click on etc.
Open the inittab file.
Remove # in front of the telnet daemon (telnetd:3:respawn:/bin/telnetd).
Press Save file.
Restart the server from its web pages.
1.2 Open a telnet session to the Axis device
and create a new scripts directory in /etc/
Open a Command Prompt window.
Type; telnet <IP address>
Type; root
Type; pass
Type; ls -l to view files and directories.
Type; cd etc to change directory to etc.
Type; mkdir scripts
Type; ls -l to make sure the directory is present.
1.3 Create the script
Open a file, for example, the file /etc/inittab, with editcgi.
Type; /etc/scripts/myscript in the “Save as:” field.
Replace all text in the textfield with these two lines;
#!/bin/mish
echo "Hello, myscript is running!"
Press the Save file button.
1.4 Run the script
Open a telnet session to the Axis device.
Change directory to /etc/scripts (cd /etc/scripts).
Check that the file is present and the file's user properties (ls
Make the file executable; chmod 755 myscript
Type; ls -l to chech that the file has correct properties.
Run the script by typing; ./myscript
45
Camera Workshop
Advanced Level
Version 1.0
-l).
______________________________________________________ Axis Technical Training
2 Run built-in applications from the shell prompt
2.1 Print a message to the log file
The logger application print messages to the log file.
Open a telnet session to the Axis device.
Type; logger to see which options are available.
Type; logger "Hello world!"
Check the log file by reading it, type; cat /var/log/messages
2.2 Get the network parameters to standard
out
The parhandclient is a parameter handler that can be used to get and set
parameters.
Type; parhandclient to see which options are available.
Get the network parameters as the type NAMEVALUE, type;
parhandclient getgroup root.Network - NAMEVALUE
Get the same parameters as the type RAW to the file /tmp/nwparams, type;
parhandclient getgroup root.Network /tmp/nwparams RAW
Check the result by reading the file created, type; cat /tmp/nwparams
2.3 Take a snapshot image
The shttpclient can be used to open an HTTP connection internally to local host or
externally to a remote Web server.
Type; shttpclient to see which options are available.
Save an image in the tmp directory, type;
shttpclient -o /tmp/mysnapshot.jpg http://127.0.0.1/axiscgi/jpg/image.cgi
Change directory to /tmp (cd /tmp) and check that the image is present (ls).
2.4 Upload the image to an FTP server
The sftpclient can be used to upload images to an FTP server.
Type; sftpclient to see which options are available.
Upload the image to the FTP server, type;
sftpclient -p <IP address the to FTP server> -c <upload
path> -l /tmp/mysnapshot.jpg -u <user name> -w <password>
Check that the image where uploaded to the FTP server.
2.5 Start an image buffer
Open a telnet session to the Axis device
Type; bufferd to see which options are available
Type; bufferd -start -buffername mybuffer
-pre 3 -post 10
-uri ftp://jpg/1/fullsize.jpg
Change directory to /tmp (cd /tmp) and check that an image buffer mybuffer is
created (ls -l)
Change directory to mybuffer (cd mybuffer) and check the image files created
46
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
(ls). Do several ls to see that the files are continuously updated and that there
always are 3 files present (could sometimes be two files if you catch the moment
when one file is removed and the new one has not been created yet).
2.6 Stop the image buffer
Stop the image buffer to make the camera save the pre images and start saving the
post images;
bufferd -stop -buffername mybuffer
Check that the camera has stopped the image buffer and is now saving the post
images, do several ls until the status file shows up.
2.7 Send the images in an e-mail to yourself
The smtpclient can be used for sending e-mails with attachments.
Type; smtpclient --help to see which options are available.
Create a file to use as body text in the e-mail;
echo "Alarm on my camera" > /tmp/bodytext
Read the body text file; cat /tmp/bodytext
Send the e-mail;
smtpclient -S <mail server IP address> -s 'Testing' -b
/tmp/bodytext -f <IP address of the camera>@axis.com -M 2
-d /tmp/mybuffer <your e-mail address>
Check your e-mail account to see if the e-mail has arrived.
2.8 Remove the image buffer
Go back to the /tmp directory (cd
Remove the image buffer;
/tmp).
bufferd -reset -buffername mybuffer
Check that the image buffer is removed (ls).
47
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
3 Run built-in applications from a shell script
3.1 Create the script
Open the file /etc/scripts/myscript in editcgi.
Add these lines;
#!/bin/mish
# Start the image buffer
bufferd -start -buffername mybuffer -pre 3 -post 3 -uri
ftp://jpg/1/fullsize.jpg
# Sleep for 4 seconds to make sure that all pre images
has been taken
sleep 4
# Stop the image buffer
bufferd -stop -buffername mybuffer
# Wait until the status file shows up
status_file="/tmp/mybuffer/status"
while [ ! -f $status_file ]; do
sleep 1
done
# Upload the images to an FTP server
sftpclient -L -m <FTP server IP address> -c <upload path>
-k /tmp/mybuffer -u user -w pass
# Remove the buffer
bufferd -reset -buffername mybuffer
Save the file.
3.2 Run the script
Open a telnet session to the Axis device.
Change directory to /etc/scripts/.
Make sure the script file is executable; ls
-l, if not, type; chmod 755
myscript
Run the script; ./myscript
Check that the files where uploaded to the FTP server.
48
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
4 Run shell scripts from task.list
4.1 Create the task.list file
Check if the task.list or user.task.list file is present in the directory /etc. If not, open
the file /etc/inittab with editcgi;
http://<IP address>/adminbin/editcgi.cgi?file=/etc/inittab
Type; /etc/task.list in the "Save as:" field.
Replace all text in the text field with this;
# Start the script at boot
once % /etc/scripts/myscript;
Save the file.
Restart the Axis device to make utask schedule the new task and trigger it.
Check that the images were uploaded to the FTP server.
4.2 Modify the task.list file
Open the task.list file with editcgi.
Replace the text in the text field with this;
# Start an image buffer at boot
once % /bin/bufferd : -start -buffername mybuffer -pre 3
-post 8 -uri ftp://jpg/1/fullsize.jpg;
# Start the script on an alarm
pattern((IO0:/)) immune once % /etc/scripts/myscript;
Save the file.
4.3 Modify the script file
Open the /etc/scripts/myscript file with editcgi.
Replace the text in the text field with this;
#!/bin/mish
# An alarm has occurred. Stop the image buffer.
bufferd -stop -buffername mybuffer
# Wait until the status file shows up
status_file="/tmp/mybuffer/status"
while [ ! -f $status_file ]; do
sleep 1
done
# Upload the images to an FTP server
sftpclient -L -m 10.13.9.40 -c /alarm -k /tmp/mybuffer -u
user -w pass
# Remove the buffer
bufferd -reset -buffername mybuffer
# Start the buffer again so that we can catch the next
alarm
bufferd -start -buffername mybuffer -pre 3 -post 8 -uri
49
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
ftp://jpg/1/fullsize.jpg
Save the file.
4.4 Trigger the script
Restart the Axis device to make utask read its new tasks.
Check that the image buffer is started by opening the directory /tmp/mybuffer in
editcgi.
Do refresh on the page to see that the images are continuously updated.
Press the alarm-button and keep on refreshing the page to see that the post images
are saved. (If you don't have any alarm-button, the input connector can be
triggered by Virtual input according to the HTTP API; http://<IP address>/axiscgi/io/virtualinput.cgi?action=1:/)
Soon the image buffer is restarted and new pre images are continuously updated.
Check that the alarm images where uploaded to the FTP server.
50
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
5 Create a custom web page
5.1 Create the html file
Open a file, for example /etc/inittab, with editcgi.
Type; /etc/httpd/html/index.html in the “Save as:” field.
Type;
<html>
<body>
My custom web page!<br>
</body>
</html>
in the text field.
From another IE-window, open the main web page to the Axis device.
Right click (outside the image) with the mouse and select "View Source".
Copy the java script code containing <OBJECT>, the ActiveX control and
</OBJECT> and paste it at the empty line in the text field.
Save the file.
Open http://<IP address>/local/index.html and check that you are able to see the
image stream.
5.2 Make your web page to the default page
Open the file /etc/httpd/conf/boa.conf in editcgi.
Add these two lines to the file;
Alias /index.html /etc/httpd/html/index.html
Alias / /etc/httpd/html/
Save the file.
Restart the Axis device to make Boa reread its configuration file.
Browse to http://<IP address> and you should get your own web page. If not, IE
probably has cached the page. Empty the cach by clicking Tools -> Internet Options,
Press Delete Files and OK. Try to browse to the IP address of your Axis device again.
51
Camera Workshop
Advanced Level
Version 1.0
______________________________________________________ Axis Technical Training
6 Create CGI scripts
6.1 Create the script directory
Open a telnet session to the Axis device.
Change directory to /etc/httpd/html/.
Create a new directory, scripts; mkdir
scripts
6.2 Modify boa.conf
Open the file /etc/httpd/conf/boa.conf in editcgi.
Add this line to the file;
ScriptAlias /scripts/ /etc/httpd/html/scripts/
Save the file.
6.3 Create the CGI script
Open your script file, /etc/scripts/myscript, in editcgi.
Type /etc/httpd/html/scripts/mycgi in the "Save as:" field.
Replace the text with this;
#!/bin/mish
echo -e "Cache-Control: no-cache\r"
echo -e "Pragma: no-cache\r"
echo -e "Expires: Thu, 01 Dec 1994 16:00:00 GMT\r"
echo -e "Content-Type: text/html"
echo -e "\r"
echo
echo "<html><body>My CGI script is
running!</body></html>"
Save the file and restart the Axis device to make Boa reread its configuration file.
Execute your CGI script by browsing to http://<IP
address>/scripts/mycgi and check that your CGI script is working.
52
Camera Workshop
Advanced Level
Version 1.0
Download