LANC and WiFi Remote control for Canon XA25 HD Camcorder


The Netlinx NI-700 controller and the AXP-PLV touchscreen and joystick control panel

 

Version 1

When upgrading my video production equipment to HD I had to find a replacement for my two Sony BRC300 Pan-Tilt-Zoom cameras.
There are several brands and models of HD PTZ cameras available but as I mostly do this as a hobby, I’d rather use the money for
other stuff so when Canon released their XA25 HD camcorder with HD-SDI output I bought one and mounted it on an old AXB-PT10
Pan-Tilt-head from AMX. The PT10 is controlled from a AMX NI-700 control system and a AXP-PLV touchscreen and joystick camera
controller that was bought cheap from EBay.


Canon XA25 camera monted on AMX (Panja) AXB-PT10 Pan-Tilt unit



Pan and Tilt movement was now working but still no Zoom and Focus. The PT10 head was used with CCTV cameras with regular
motorized lenses but as the XA25 is a compact camcorder there was no way to connect drive signals to the lens.
The XA25 however can be remote controlled in three ways, some controls by LANC, some by IR and many more functions by WiFi
and a builtin web-remote.

For some reason the PT10 head has a RS232 serial connector as a second way of controlling the camera!

After some modifications to the Netlinx program that the AMX system is running I managed to get it to send Zoom and Focus
commands to the serial port. The serial port was then connected to an Arduino Micro that runs code to convert the Zoom and
Focus commands to the LANC protocol that the camera can understand.


The small box in top of the PT10 contains the Arduino Micro that converts
RS232 commands to LANC
.


This setup was used mostly as a proof of concept for a few concerts that I made the video production for and it worked great!
I also had a small WiFi to TP bridge close to the camera and a CAT5 cable to a computer that could be used to run the built in
web-remote in the camera from a distance. This was used to control all the less time critical but still important things that
couldn’t be controlled by LANC, mostly white-balance, iris and gain.

 

Version 2

As everything can be improved, I started to think about controlling all the camera functions from the AMX touchscreen. Another
“problem” was that I'm planning on buying another camera, and the camera WiFi remote just seems to be an access point with
a fixed IP-address for the camera. This made it harder to connect more than one camera without doing some kind of NAT to be
able to “move” one of the cameras to another IP. Instead I’m now working on another solution.

The Arduino Micro that did the RS232 to LANC conversion was replaced with an Arduino Mega with a WiFi shield. I then added
a few pages and buttons to the AMX touch screen and once again modified the control system software to send serial commands
for my new buttons.


The new "Mode" menu. First row selects "Recording Program"
Second row selects White-Balance mode.
The big textbox contains responses from the Arduino.
Far right buttons are used to power the camera on or off.

 


"Kelvin menu" - Manual white balance

 


Gain & Exposure menu

 

Then the little bit tricky part began. I started to reverse engineer the XA25 web-remote. Wireshark was used to record the TCP
packets as I clicked thru all the functions in the remote.

The client sends HTTP GET requests and the camera responds with json formatted data.

A cookie named “acid” (in the range 0x0000 to 0xFFFF is sent by the camera in the first response and is then used for session control.

To keep the connection, a “request status” packet must be sent every 10 seconds or so. As for now I think that the sequence
counter in the “request status” package doesn’t matter. I just set it to "1" all the time.


All the commands:

Function WEBAPI Possible values / Note Active in program RS232 to Arduino
Session
Login /api/acnt/login returns a redirect page and a cookie, "acid=****"
Keep alive and request status update /api/cam/getcurprop?seq=1 Returns camera status.
First response after a regular command contains all settings
and a new value for counter "seq"
 
Program
List all programs /api/cam/getprop?r=recp see below
M /api/cam/setprop?recp=M Pm
Av /api/cam/setprop?recp=Av Pa
Program /api/cam/setprop?recp=P Pp
Tv /api/cam/setprop?recp=Tv Pt
SCN /api/cam/setprop?recp=SCN Ps
 
Lens Drive
Zoom Wide 1 /api/cam/drivelens?zoom=wide1 W1
Zoom Wide 2 /api/cam/drivelens?zoom=wide2 W2
Zoom Wide 3 /api/cam/drivelens?zoom=wide3 W3
Zoom Tele 1 /api/cam/drivelens?zoom=tele1 T1
Zoom Tele 2 /api/cam/drivelens?zoom=tele2 T2
Zoom Tele 3 /api/cam/drivelens?zoom=tele3 T3
Focus Far 1 /api/cam/drivelens?fl=far1 F1
Focus Far 2 /api/cam/drivelens?fl=far2 F2
Focus Far 3 /api/cam/drivelens?fl=far3 F3
Focus Near 1 /api/cam/drivelens?fl=near1 N1
Focus Near 2 /api/cam/drivelens?fl=near2 N2
Focus Near 3 /api/cam/drivelens?fl=near3 N3
 
Focus MF/AF /api/cam/drivelens?sw=focus Af
 
Iris Plus /api/cam/drivelens?iris=plus Av,M Ip
Iris Minus /api/cam/drivelens?iris=minus Av,M Im
 
List all Aperture values /api/cam/getprop?r=av Av,M
Set Aperture /api/cam/setprop?av=2.0 ["2.2","2.4","2.6","2.8","3.2","3.4","3.7","4.0","4.0N1/1.2",
"4.0N1/1.4","4.0N1/1.7","4.0N1/2","4.0N1/2.4","4.0N1/2.8",
"4.0N1/3.4","4.0N1/4","4.0N1/4.8","4.0N1/5.7","4.0N1/6.7",
"4.0N1/8","4.4N1/8","4.8N1/8","5.2N1/8","5.6N1/8","6.2N1/8",
"6.7N1/8","7.3N1/8","8.0N1/8"]
Av,M B{0x00-0x1B}
 
List all Shutter Speeds /api/cam/getprop?r=ssv Tv,M
Set Shutter Speed /api/cam/setprop?ssv=1/50 ["1/6","1/12","1/25","1/50","1/120","1/250","1/500","1/1000","1/2000"] Tv,M S{0x00-0x08}
 
List all Gain values /api/cam/getprop?r=gcv M
Set Gain value /api/cam/setprop?gcv=2.0 ["0.0","1.0","2.0","3.0","4.0","5.0","6.0","7.0","8.0","9.0","10.0","11.0",
"12.0","13.0","14.0","15.0","16.0","17.0","18.0","19.0","20.0","21.0",
"22.0","23.0","24.0","MAX"]
M G{0x00-0x19}
 
Enable Exposure Compensation /api/cam/drivelens?sw=expcomp P,Tv,(Av),SCN Ee
List all Exposure values /api/cam/getprop?r=ev P,Tv,(Av),SCN
Set Exposure value /api/cam/setprop?ev=-1.0 ["-3.0","-2.75","-2.5","-2.25","-2.0","-1.75","-1.5","-1.25","-1.0",
"-0.75","-0.5","-0.25","0","0.25","0.5","0.75","1.0","1.25","1.5",
"1.75","2.0","2.25","2.5","2.75","3.0"]
P,Tv,(Av),SCN E{0x00-0x18}
 
White Balance
List all WB modes /api/cam/getprop?r=wbm see below
Automatic /api/cam/setprop?wbm=Automatic Ca
Daylight /api/cam/setprop?wbm=Daylight Cd
Shade /api/cam/setprop?wbm=Shade Cs
Cloudy /api/cam/setprop?wbm=Cloudy Cc
Fluorescent /api/cam/setprop?wbm=Fluorescent Cf
Fluorescent H /api/cam/setprop?wbm=FluorescentH Ch
Tungsten /api/cam/setprop?wbm=Tungsten Ct
Preset A /api/cam/setprop?wbm=PresetA C1
Preset B /api/cam/setprop?wbm=PresetB C2
Kelvin /api/cam/setprop?wbm=Kelvin Ck
Set WB in
K-mode
/api/cam/setprop?wbv=5600 ["2000","2100","2200","2300","2400","2500","2600","2700","2800",
"2900","3000","3100","3200","3300","3400","3500","3600","3700",
"3800","3900","4000","4100","4200","4300","4400","4500","4600",
"4700","4800","4900","5000","5100","5200","5300","5400","5500",
"5600","5700","5800","5900","6000","6100","6200","6300","6400",
"6500","6600","6700","6800","6900","7000","7100","7200","7300",
"7400","7500","7600","7700","7800","7900","8000","8100","8200",
"8300","8400","8500","8600","8700","8800","8900","9000","9100",
"9200","9300","9400","9500","9600","9700","9800","9900","10000",
"10100","10200","10300","10400","10500","10600","10700","10800",
"10900","11000","11100","11200","11300","11400","11500","11600",
"11700","11800","11900","12000","12100","12200","12300","12400",
"12500","12600","12700","12800","12900","13000","13100","13200",
"13300","13400","13500","13600","13700","13800","13900","14000",
"14100","14200","14300","14400","14500","14600","14700","14800",
"14900","15000"]
WB Kelvin K{0x00-0x82}
List all WB values (in K-mode) and store preset in preset mode /api/cam/getprop?r=wbv Cx
 
REC Button Push /api/cam/rec?cmd=trig Rc
 
Other (not sent to camera, handled by the Arduino)
Power Cam On Done by Arduino Hardware I/O On
Power Cam Off Done by Arduino Hardware I/O Of
Tally LED Red Done by Arduino Hardware I/O Lr
Tally LED Green Done by Arduino Hardware I/O Lg
Tally LED Yellow Done by Arduino Hardware I/O Ly
Tally LED OFF Done by Arduino Hardware I/O Lo

 


Arduino Mega, WiFi Shield, "Mega Extension Shield", RS232-driver.
The led will be replaced with a relay that controls camera power.
The LANC circut wasn't connected when this picture was taken, It will probably
be built on the spare pads on my "Mega Extension Shield" (built for an earlier project).

 

An early and dirty but working version of the Arduino sketch:

The LANC code is based on the work of Martin Koch: "Arduino powered simple LANC remote"

More great information on the LANC protocol can be found HERE