Wireless remote follow focus via remote roadmap

969 views
Skip to first unread message

Sherry

unread,
Jul 1, 2011, 3:55:53 PM7/1/11
to Magic Lantern firmware development
Hello everyone, I searched the net, this mailing list and the wiki
extensively and have found no data other than an occasional request
for infrared remote (IR) integration with Magic Lantern.The 550d T2i
and 5dmk2 5dmkii have integrated infrared sensors.

With infrared remotes and Magic Lantern, I believe a wireless follow
focus or wireless remote follow focus is possible.If you don't know
the cheapest wireless remote follow focus systems cost several
hundreds of dollars and are louder, read: louder than the sound of
that the camera's motor creates when controlling focus. Wireless
follow focus is especially great (often required) for steadicam and
jib crane situations.
In addition to follow focus, the infrared would allow customized
control of the camera's operations.

I am here to shed some light on infrared remote (IR) technology and
contribute some ideas that may help more knowledgeable people proceed
with development.

When a button is pressed on an infrared remote, "the IR light source
(the IR emitter) is on, it is actually turning itself on and off
thousands of times per second" (http://www.hifi-remote.com/infrared/IR-
PWM.shtml). You could also say that the light "pulses" at different
speeds.

So each button, as you know can do something different, because no
button pulses exactly the same as another button.

As a prerequisite, a common infrared remote would need to be agreed
upon, because if we all used different remotes, a lot of time would be
wasted creating code for each remote. Imagine if 1/3 of the people
used an apple remote, 1/3 used their tv remote, and 1/3 used some
other remote. The developers would need one of each remote AND have to
develop code for each remote...that is absurd.

Some people might think aliexpress or something to source remote, but
the dollartree and the 99c only stores all sell infrared remotes. If
this project comes to fruition, I believe it would be beneficial to
have a source buy/distribute in bulk (maybe amazon, definitely not
ebay or any paypal affiliate) and distribute the common controller.
There would be a markup to compensate the distributor and give
proceeds to Magic Lantern development. All in all, the controller at a
worst case scenario would cost everyone $10 each after taxes and
shipping, oh wow! In my opinion (IMO) that would be better than using
a branded, say apple a1156 remote. It would also allow for crazy
expansion and flexibility due to the number of buttons on the remote.
(If you want to use your learning remote instead of supporting the
Magic Lantern via proceeds, that's your choice).

As far as I know (AFAIK), code would need to be written or translated
in order to
a) gain access to the IR sensor

b) interpret the pulses sent by our agreed upon, possibly branded
"Magic Lantern" remote
(hmmm maybe we can just print out stickers and apply to our
remotes ?) :) )

c) after a pulse is recognized by the program, it would be converted
to a Magic Lantern command.
For instance, lets say for our "volume up" and "volume down" commands.
Volume up could be bound to "lens_set_shutter(SHUTTER_250);" ,so that
anytime volume up is press, the shutter speed of the camera would
change to 250.

Additionally, regarding the need for Canon lenses, I suggest people
try nikon adapters with the "focus confirm" and see if that works, I
doubt it, but would try.

I use a lot of non-canon lenses, but though this "remote capability"
would be cool to have.
Thanks to all

Alex

unread,
Jul 8, 2011, 7:21:14 AM7/8/11
to ml-d...@googlegroups.com
First steps for investigation:

In the firmware, look for REMIN_ISR; I believe we can see something
interesting at the structure from 0x2a90 (550D), or 0x2c18 (60D).

Debug code (put it in debug_loop_task and see if it reacts to remote
control pulses)
bmp_hexdump(FONT_SMALL, 0, 20, 0x2a90, 32*10);

See also http://www.lirc.org/ .

> --
> http://magiclantern.wikia.com/
>
> To post to this group, send email to ml-d...@googlegroups.com
> To unsubscribe from this group, send email to ml-devel+u...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/ml-devel?hl=en

Alex

unread,
Jul 8, 2011, 1:31:34 PM7/8/11
to ml-d...@googlegroups.com
Just tested with an AC remote, it works :)

There is a counter of how many pulses were received, at 0x2ac8 on 550D.

Alex

unread,
Jul 8, 2011, 1:57:53 PM7/8/11
to ml-d...@googlegroups.com
Here's a quick demo for you to try and improve. Set your camera to
"self timer / remote" and point any infrared remote at it (like your
TV remote).

Autoexec.bin and addresses from this patch are for 550D only.

autoexec.bin
remocon.patch

Simon Larcher

unread,
Jul 8, 2011, 2:36:32 PM7/8/11
to ml-d...@googlegroups.com
It could be great to control the cam from a short distance with an IR remote for things like white bal, aperture, focus and various display and magic lantern settings as well.
I think it could even be possible to us an USB IR led and write a software to control the cam from a laptop.

2011/7/8 Alex <broscu...@gmail.com>

AaronB

unread,
Jul 12, 2011, 9:01:24 PM7/12/11
to ml-d...@googlegroups.com
This is an awesome idea. Wonder how this would work for remote FF.

Alex

unread,
Jul 20, 2011, 2:47:56 PM7/20/11
to ml-d...@googlegroups.com
Here's some analysis of the infrared impulse decoder. Plug these names
into latest arm-console and run:

dec [REM]WirelessRemoteISR
dec [REM]RemTimeOut

I believe the first one is an interrupt handler triggered by some kind
of pulse, on both transitions (0->1 and 1->0). Here, you'll see a
state machine which looks for a signal like this:

___|-----|____|----|____

The timestamps for these 4 transitions are saved in:
NSTUB( 0x2E6AC, remocon_timing_struct.t0_digic_time_maybe)
NSTUB( 0x2E6B0, remocon_timing_struct.1stpulse_digic_time)
NSTUB( 0x2E6B4, remocon_timing_struct.sigwait_digic_time)
NSTUB( 0x2E6B8, remocon_timing_struct.2ndpulse_digic_time)

Values are in DIGIC_TIME units, see AJ_guess_get_DIGIC_time.

#define MAX_DIGIC_TIME (0xFFFFF)
unsigned int time_ms = (999 * digic_time) / MAX_DIGIC_TIME;

Then, after 38ms from the last signal transition, [REM]RemTimeOut
checks pulse widths against some predefined values, prints some
messages, and if everything is OK, it calls the function stored at
NSTUB( 0x2A9C, remocon_struct.handler_function_maybe)

which is ff07bfbc, and seems to send an event into MainCtrl message
queue. The event contains a pointer to FF07BF00
RemOff_secret_mode_RemOn

which turns off IR remote, calls 0xff05a628 (which was named
secret_mode, not sure why), and then it turns on IR remote again.

So probably 0xff05a628 does the remote control action (take a
picture, record a movie maybe?), but I don't understand how it works;
at some point, it reaches something from Siodriver.c.

Now... newbie question (I don't have a Canon infrared remote, but I'll
get one if there is any interest in using it). What can you do with
it? Only take pictures, or also record movies or change any settings?

remocon.550.109.S

Pelican

unread,
Jul 20, 2011, 5:11:06 PM7/20/11
to ml-d...@googlegroups.com
With Canon RC1 you can start/stop video and take shots on 7D and 5D2.

Ramt

unread,
Jul 20, 2011, 6:06:25 PM7/20/11
to ml-d...@googlegroups.com, <ml-devel@googlegroups.com>
I'm using this one. It can take pix and start/stop movie record.
http://www.dealextreme.com/p/jianisi-digital-slr-remote-for-canon-5577

Ramtin
Sent from my iPhone.

Sherry

unread,
Jul 21, 2011, 6:22:32 PM7/21/11
to Magic Lantern firmware development
Hey everyone, I've been away, and pretty much still am, but am so
excited to see people working on this, thanks a ton Alex!
Also Alex, sorry this is late, but I believe the remote is worthless,
as we'd want more than 1 button to customize :) (if you want one, I'll
mail an extra one to you, so lmk). Assuming you (or the community) is
able to gain access to all incoming IR pulses, I think it would be
best to have a standard regular tv remote we can agree on. I was at
the 99c store again and they are still selling tons of remotes. If
there are multiple programmers working on this, or just you, and you
think it would help, let me know who to send some controls to, I'll
pick some up.

The canon infared remotes are very limited as Pelican stated. That is
how all of the Canon remotes are pretty much, just a single button.
Some for cheaper cameras actually have more buttons.
Maybe these guys can help out:
http://www.canoremote.de/

And on youtube:
CHDK Zoom and Shutter control with Infrared Remote
http://www.youtube.com/watch?v=bsIFyXFIR_I

@Aaron B, exactly what I'm thinking :)

Keep in mind, that if IR ends up working, then all you have to do is
buy an RF to IR converter and you have full WIRELESS remote
capabilities from a distance.
Just search the net for the phrase "ir to rf" without quotes.

Thank you to everyone responding and working on this. I'm not a
programmer, but will test as needed when I can in the next couple of
weeks.

Take care!
> On Wed, Jul 13, 2011 at 4:01 AM, AaronB <abah...@gmail.com> wrote:
> > This is an awesome idea. Wonder how this would work for remote FF.
>
> > On Fri, Jul 8, 2011 at 1:36 PM, Simon Larcher <slarche...@gmail.com> wrote:
>
> >> It could be great to control the cam from a short distance with an IR
> >> remote for things like white bal, aperture, focus and various display and
> >> magic lantern settings as well.
> >> I think it could even be possible to us an USB IR led and write a software
> >> to control the cam from a laptop.
>
> >> 2011/7/8 Alex <broscutama...@gmail.com>
>
> >>> Here's a quick demo for you to try and improve. Set your camera to
> >>> "self timer / remote" and point any infrared remote at it (like your
> >>> TV remote).
>
> >>> Autoexec.bin and addresses from this patch are for 550D only.
>
> >>> On Fri, Jul 8, 2011 at 8:31 PM, Alex <broscutama...@gmail.com> wrote:
> >>> > Just tested with an AC remote, it works :)
>
> >>> > There is a counter of how many pulses were received, at 0x2ac8 on 550D.
>
> >>> > On Fri, Jul 8, 2011 at 2:21 PM, Alex <broscutama...@gmail.com> wrote:
> >>> >> First steps for investigation:
>
> >>> >> In the firmware, look for REMIN_ISR; I believe we can see something
> >>> >> interesting at the structure from 0x2a90 (550D), or 0x2c18 (60D).
>
> >>> >> Debug code (put it in debug_loop_task and see if it reacts to remote
> >>> >> control pulses)
> >>> >> bmp_hexdump(FONT_SMALL, 0, 20, 0x2a90, 32*10);
>
> >>> >> See alsohttp://www.lirc.org/.
>
>  remocon.550.109.S
> 2KViewDownload

Sherry

unread,
Jul 21, 2011, 6:26:12 PM7/21/11
to Magic Lantern firmware development
I just wanted to clarify that when I said, "I think it would be
best to have a standard regular tv remote we can agree on," it's
because each brand of remote will send different pulse commands.

Also, just because the RC1 limits us, it does not mean the camera
itself does. I believe we can gain access to incoming IR pulses, and
then assign internal camera commands (as ML does) to incoming pulses
(as the CHKDK video on youtube demonstrates).

Morgan Look

unread,
Jul 21, 2011, 8:47:42 PM7/21/11
to ml-d...@googlegroups.com
Would be awesome if they could be configurable.
There are lirc config files for many different types of remote here http://lirc.sourceforge.net/remotes/
Maybe they would need to be parsed into a format ML can read, and maybe only certain types of decoding might be able to be supported.
But it would greatly improve the availability of usable remotes.

This page has some information about how to interpret lirc remote config files
http://www.arcfn.com/2010/03/understanding-sony-ir-remote-codes-lirc.html

Morgan.

Morgan Look

unread,
Jul 21, 2011, 10:42:19 PM7/21/11
to ml-d...@googlegroups.com
Hi.

Having read this page http://www.arcfn.com/2010/03/understanding-sony-ir-remote-codes-lirc.html in more detail, I would say a good goal would be to implement the sony 12/15/20-bit protocol. This protocol is used in many remotes, which are easy to find, and cheap to buy second hand.

The IR pulses are received least significant bit first, which once received and the order reversed, the code can be determined depending on the number of bits.
12 bit codes have 5 device bits followed by 7 command bits. 15 bit codes have 8 device bits, and 7 command bits. Finally 20 bit codes have 5 device, 8 extended device, and 7 command bits.

Once understood in this form the commands are easily found at this website http://www.hifi-remote.com/sony/
eg a sony TV power button could be represented as 1.21(a 12 bit code)
a camcorder record button might be 22.101.29 (I assume an example of a 20 bit code)

This should allow a fairly extensive range of remotes to be supported with just a few entries in magic.cfg

#example magic.cfg entry for sony VCR/Camcorder remote control record button
remote.record = 22.101.29

With a defined protocol, it would be easier to display these codes on the camera, or log them to a file. Since they are now sensible data not just strings of bits.
This would make getting your sony remote to work with your camera a fairly quick process.

One final note, IR codes are typically modulated at 40kHz. These should be demodulated by the receiver, and not a concern as far as programming. But might be worth watching out for.

Morgan.

On 22/07/2011, at 10:26 AM, Sherry wrote:

Reply all
Reply to author
Forward
0 new messages