Shop OBEX P1 Docs P2 Docs Learn Events
Camera LANC Controller — Parallax Forums

Camera LANC Controller

Hi Guys,

The 'amazing' Jon McPhalen (JonnyMac) wrote some code to control Sony LANC cameras' zoom, focus and such, using PST and keyboard to command.

It is based on an 8 byte packet standard LANC protocol, of which bytes 0 & 1 are the 'common command codes' sent to the camera, while bytes 2 & 3 are not used and bytes 4, 5, 6 & 7 are data coming back from the camera. This works great on Sony Cameras and pretty good on Canon & JVC cameras that use this protocol.

The newer Canon cameras employ a different protocol. They call it 'Extended LANC' and it is 16 bytes. The first 8 bytes come from the camera and the second 8 bytes are commands sent to the camera.

I am trying to modify this 8 byte code and Spin object to work with the 16 byte protocol and I'm not having much luck. I have the basic structure in place...

Would anyone like to take a crack at this? (Jon is too busy right now) There are $ available...

I attached the original 8 byte code, my non working 16 byte code and the other required objects.

Thanks in Advance...

John Huffman
209-202-7740

Comments

  • BeanBean Posts: 8,129
    John had contacted me about this project.

    I took a stab at it, but I have never used LANC and I don't have any LANC equipment.

    Sorry John, I just really don't have the time right now to get my head around how this all works.

    Bean
  • JonnyMacJonnyMac Posts: 9,102
    edited 2019-05-03 14:19
    Thanks for your kind comments, John.

    If you'll point me to a detailed spec for the Extended LANC protocol, I will have a look -- at first blush it doesn't seem like it should be much trouble (but I haven't seen the spec). I'm looking at purchasing a new camera (Black Magic) that has a LANC port, but I don't know what protocol version it uses.

    Wait... does putting 'amazing' in quotes mean you're being sarcastic about my abilities?....
  • JonnyMac wrote: »
    Thanks for your kind comments, John.

    If you'll point me to a detailed spec for the Extended LANC protocol, I will have a look -- at first blush it doesn't seem like it should be much trouble (but I haven't seen the spec). I'm looking at purchasing a new camera (Black Magic) that has a LANC port, but I don't know what protocol version it uses.

    Wait... does putting 'amazing' in quotes mean you're being sarcastic about my abilities?....

    No, on the contrary, after working with you for years and seeing how ‘fluent’ you are in this stuff, you are truly ‘amazing’!
  • JonnyMac wrote: »
    Thanks for your kind comments, John.

    If you'll point me to a detailed spec for the Extended LANC protocol, I will have a look -- at first blush it doesn't seem like it should be much trouble (but I haven't seen the spec).

    The new protocol isn't in Wiki yet. The net is pretty quiet about it. Curious myself.

  • Hello!
    I confess that what I know about LANC hardware control methods would easily fit into any of the early PROM chips, and those were Programmable Read Only Memory chips. (About 2K in size.) So here goes:
    I do know that basically the whole idea in the beginning is correct. Since I don't grok at all the whole idea using such technology to control cameras, I wasn't aware that it was possible to do that much further.

    Anyway this site ELM Electronics taught me more than enough to understand the way it works. They sell a chip who does grok the whole idea behind it. Plus two others who do other related functions.

    So to understand the process further where I would go to read up on it?
    ---
    As always this is being sponsored by the friends of one Donald Duck.
  • Hello!

    So to understand the process further where I would go to read up on it?

    boehmel.de/lanc

    http://www.boehmel.de/lanc
  • Standard LANC isn't an issue -- I've long had working Propeller code for that connecting to a variety of cameras.

    The Extended LANC uses 16 bytes at 19.2K (instead of 8 at 9600). Reading and accepting the data won't be a problem, it's knowing what things mean that is in question at the moment as there is no released specification.
  • RaymanRayman Posts: 14,640
    Extended sounds like it should be backwards compatible ...

    Does just changing baud and making commands 16 bit work?
  • Possibly? I just don’t know how to change those parameters in the object...
  • JonnyMac wrote: »
    Standard LANC isn't an issue -- I've long had working Propeller code for that connecting to a variety of cameras.

    The Extended LANC uses 16 bytes at 19.2K (instead of 8 at 9600). Reading and accepting the data won't be a problem, it's knowing what things mean that is in question at the moment as there is no released specification.

    If you modify your object and LANC commander structure to receive 8 bytes and send 8 bytes, then I think I can decipher the codes and make it talk to the camera. We have many of the codes figured out already via serial sniffer...
  • BeanBean Posts: 8,129
    Can anyone recommend a cheap (ebay) camera that I could buy to experiment with LANC ?
    I don't really care if it works 100% as long as the LANC interface works.

    Thanks,
    Bean
  • JonnyMacJonnyMac Posts: 9,102
    edited 2019-05-06 14:52
    jonyjib wrote: »
    JonnyMac wrote: »
    Standard LANC isn't an issue -- I've long had working Propeller code for that connecting to a variety of cameras.

    The Extended LANC uses 16 bytes at 19.2K (instead of 8 at 9600). Reading and accepting the data won't be a problem, it's knowing what things mean that is in question at the moment as there is no released specification.

    If you modify your object and LANC commander structure to receive 8 bytes and send 8 bytes, then I think I can decipher the codes and make it talk to the camera. We have many of the codes figured out already via serial sniffer...

    What you actually need is a sniffer tool so that you can examine the packets going between the controller and a compatible camera. You could do this in Spin (with FDS) using the circuit below.
    1) Wait for 5m idle period on serial line
    2) Capture and display 16 bytes
    3) GOTO 1

  • For those interested, here is my standard LANC object. Creating a similar object that uses 19.2K and 16 bytes will not be a problem. The problem is that RCA has not released details on the reporting and control packets. An Austrian student claims to have reverse-engineered the RC-V100 protocol and wrote it as part of his bachelor's degree school work. I have reached out to see if that paper is available.

    I seem to have pulled down the schematic (referenced in my code). Here it is. This can be connected to a device or to the line between a controller and camera for sniffing.

    106627.jpg

  • Bean wrote: »
    Can anyone recommend a cheap (ebay) camera that I could buy to experiment with LANC ?
    I don't really care if it works 100% as long as the LANC interface works.

    Thanks,
    Bean

    You should be able to pick one up for around $50. Just make sure when you check the model that is has the LANC jack in the specs. Selected Sony, JVC and Canon model camcorders use the LANC protocol. (not Panasonic)

    John
  • Here's some code to try, John. Fair warning, when the signal is active's going to be a lot of data flying by (60 lines per second).
  • JonnyMac wrote: »
    Here's some code to try, John. Fair warning, when the signal is active's going to be a lot of data flying by (60 lines per second).

    Yep, that works! It allows me to see what is coming out of the camera. I'll need to send the handshake commands back to the camera in order to control it.
  • I think you should connect that between a controller and the camera to spy on the transactions. Apparently, there's a big handshake at the beginning which this program does not yet capture.
  • Yes we have the big handshake data. It is in the email I sent you...
  • Handshake exchange = 82 bytes (41 from each device)
  • I will be receiving the official spec from Canon soon...
  • Any news about progress? Is there somewhere captured LANC data available?
  • I will be receiving the official spec from Canon soon...

    Canon never delivered on the official request for their Extended LANC protocol so we ended up using the basic LANC protocol... : (
  • May I ask captured data of RC-V100 somebody did?
Sign In or Register to comment.