FAQ FAQ  Forum Search   Events   Register Register  Login Login

E-mount electronic protocol reverse engineering

Page  <1 11121314>
Author
QuietOC View Drop Down
Senior Member
Senior Member

Joined: 28 February 2015
Country: United States
Location: Michigan
Status: Offline
Posts: 2904
Post Options Post Options   Quote QuietOC Quote  Post ReplyReply Direct Link To This Post Posted: 09 August 2019 at 14:51
I am curious about the Techart TZE-01. It seems like they got it working quite quickly. Is Nikon using similar protocols to Sony? Why do Samyang AF FE lenses not work on it?
Sony A7III HVL-F45RM LA-EA3 LA-EA4 MB-IV MC-11 EF-E II MD-NEX KR-NEX DA-NEX
Minolta Maxxum 600si
Pentax Q7 5-15 15-45/2.8 8.5/1.9 11.5/9 AF-P/Q
 



Back to Top
Athiril View Drop Down
Newbie
Newbie

Joined: 02 July 2020
Country: Australia
Status: Offline
Posts: 3
Post Options Post Options   Quote Athiril Quote  Post ReplyReply Direct Link To This Post Posted: 02 July 2020 at 22:03
Is this far enough along to make a “dumb” adapter?

IE rather than translating between two protocols, just take output from an E mount body into an Arduino, and drive a stepper motor directly with a motor driver circuit? All that’s really needed would be “move back” “move forward” and “stop” or “off”.
Back to Top
Entropy512 View Drop Down
Groupie
Groupie

Joined: 22 July 2015
Country: United States
Status: Offline
Posts: 54
Post Options Post Options   Quote Entropy512 Quote  Post ReplyReply Direct Link To This Post Posted: 02 July 2020 at 22:22
Originally posted by Athiril Athiril wrote:

Is this far enough along to make a “dumb” adapter?

IE rather than translating between two protocols, just take output from an E mount body into an Arduino, and drive a stepper motor directly with a motor driver circuit? All that’s really needed would be “move back” “move forward” and “stop” or “off”.

bostwickenator (Lex Optical) got to the point of emulating a "fake" lens and having it accepted by a body... I think?

So I think he was close. I haven't touched this in over a year (I'll get back to it eventually...) and I'm not sure what he's done.

Doing something like that with a manual focus legacy lens and a focus gear was something I always wanted to experiment with, never got around to it though.
Back to Top
bostwickenator View Drop Down
Newbie
Newbie

Joined: 19 June 2009
Status: Offline
Posts: 28
Post Options Post Options   Quote bostwickenator Quote  Post ReplyReply Direct Link To This Post Posted: 03 July 2020 at 02:23
I could fool a camera into detecting an emulated lens and then change the aperture values the camera was receiving. The focus commands are harder to interpret I never got to the point of deciphering the protocol to a fwd/stop/back. It's more complicated than that because the camera can command the lens to an absolute position not just a direction. In fact there are quite a few focusing modes. That said I don't think I was far off that I just haven't figured out that detail. I actually have a stepper motor attached to an old lens to do exactly what you were suggesting lol.

If you wanted to make a chip to talk to the camera and return the focal length of a lens for setting the image stabilizer that is possible with what I currently have.
Back to Top
Athiril View Drop Down
Newbie
Newbie

Joined: 02 July 2020
Country: Australia
Status: Offline
Posts: 3
Post Options Post Options   Quote Athiril Quote  Post ReplyReply Direct Link To This Post Posted: 03 July 2020 at 12:21
Originally posted by Entropy512 Entropy512 wrote:

Originally posted by Athiril Athiril wrote:

Is this far enough along to make a “dumb” adapter?

IE rather than translating between two protocols, just take output from an E mount body into an Arduino, and drive a stepper motor directly with a motor driver circuit? All that’s really needed would be “move back” “move forward” and “stop” or “off”.

bostwickenator (Lex Optical) got to the point of emulating a "fake" lens and having it accepted by a body... I think?

So I think he was close. I haven't touched this in over a year (I'll get back to it eventually...) and I'm not sure what he's done.

Doing something like that with a manual focus legacy lens and a focus gear was something I always wanted to experiment with, never got around to it though.


That’s exactly what I was thinking, a gear around the focus ring.

Then the techart adapter came out and I figured I could mod it and take the motor output directly into a tiny duino, and send it to a motor on the focus ring instead snd when it reaches full throw, send it to the motor for the auto extension tube for closer focus, maybe with a switch for close AF like some lenses have.

Though given the price of it I didn’t want to gamble.

Maybe it’s easier to do this via a cheap EF AF adapter since the commands are published.

Edited by Athiril - 03 July 2020 at 12:25
Back to Top
Athiril View Drop Down
Newbie
Newbie

Joined: 02 July 2020
Country: Australia
Status: Offline
Posts: 3
Post Options Post Options   Quote Athiril Quote  Post ReplyReply Direct Link To This Post Posted: 03 July 2020 at 12:28
Originally posted by bostwickenator bostwickenator wrote:

I could fool a camera into detecting an emulated lens and then change the aperture values the camera was receiving. The focus commands are harder to interpret I never got to the point of deciphering the protocol to a fwd/stop/back. It's more complicated than that because the camera can command the lens to an absolute position not just a direction. In fact there are quite a few focusing modes. That said I don't think I was far off that I just haven't figured out that detail. I actually have a stepper motor attached to an old lens to do exactly what you were suggesting lol.

If you wanted to make a chip to talk to the camera and return the focal length of a lens for setting the image stabilizer that is possible with what I currently have.


I don’t know if it helps but I still have an A7s I, which is CDAF only, I remember gen III coming out and Sony making adapters work way better then they do on previous gen. So I guess the adapters are buggy and gen III is more flexible and compensating for known problems, where as older gen is more ‘strict’ in the protocol
 



Back to Top
Entropy512 View Drop Down
Groupie
Groupie

Joined: 22 July 2015
Country: United States
Status: Offline
Posts: 54
Post Options Post Options   Quote Entropy512 Quote  Post ReplyReply Direct Link To This Post Posted: 05 August 2020 at 12:13
Originally posted by Athiril Athiril wrote:

Originally posted by bostwickenator bostwickenator wrote:

I could fool a camera into detecting an emulated lens and then change the aperture values the camera was receiving. The focus commands are harder to interpret I never got to the point of deciphering the protocol to a fwd/stop/back. It's more complicated than that because the camera can command the lens to an absolute position not just a direction. In fact there are quite a few focusing modes. That said I don't think I was far off that I just haven't figured out that detail. I actually have a stepper motor attached to an old lens to do exactly what you were suggesting lol.

If you wanted to make a chip to talk to the camera and return the focal length of a lens for setting the image stabilizer that is possible with what I currently have.


I don’t know if it helps but I still have an A7s I, which is CDAF only, I remember gen III coming out and Sony making adapters work way better then they do on previous gen. So I guess the adapters are buggy and gen III is more flexible and compensating for known problems, where as older gen is more ‘strict’ in the protocol

Sorry for the slow reply - I thought I had replied to this before.

The adapters aren't buggy - Sony explicitly limited the adapters to speaking a subset of the protocol that older lenses were capable of "playing nice" with. Among other things, the "native" protocol has some additional AF commands that allow a body to command a lens to not only move to a specific position/in a specific direction, but to do it at a specific speed. The "legacy adapter" subset only allows relative/absolute movements at maximum speed, because A-mount lenses appear to only be commandable in this way.

Moving at a controlled speed is critical to CDAF, which is why legacy-adapter CDAF is so horrible. It still is on even the latest bodies. I don't know what Sony did body-side to add legacy-adapter PDAF, but that's really what changed everything for legacy adapters. Any functionality that requires CDAF has generally taken much longer for Sony to figure out how to do with legacy adapters, or simply has not/likely will never figure out. They eventually figured out eye-AF, likely by using PDAF to get things really close to a CDAF solution and/or using PDAF to get close enough to find an eye and then use PDAF on the eye itself, but video AF is still horrible.

The A7S/S2/original R have no PDAF capability, so they need native lens CDAF to be acceptable. Emulating a native lens is a LOT harder.
Back to Top
profhankd View Drop Down
Newbie
Newbie

Joined: 11 February 2010
Country: United States
Location: Lexington, KY
Status: Offline
Posts: 27
Post Options Post Options   Quote profhankd Quote  Post ReplyReply Direct Link To This Post Posted: 31 August 2020 at 15:21
Hi. I'm an electrical & computer engineering professor at the University of Kentucky. Way back in 2014, I looked at making something like the TechArt pro LM-EA7... but I backed off when Sony refused my formal request for E mount details because I was afraid future protocol changes might break my device (a fear that has been confirmed). Anyway, I never got very far on the protocol and haven't looked at it again -- until now.

In the DPReview Adapted Lens forum, I recently brought-up the topic of Trap Focus for manual lenses. Trap focus normally means to pre-focus where your subject will be and delay shutter firing until something moves into focus -- however, for manual lenses, it can mean that the shutter doesn't fire until you've manually hit focus on your subject. That's really useful for various circumstances. On some Sony A-mount cameras, this could be done by using a chipped adapter, focus priority, and letting the screw drive (apparently harmlessly) spin while the shutter was depressed until focus was detected and the shutter fired.

So, I'm thinking again about making a custom adapter: this time, it would be one that simply tells the camera the lens is an autofocus lens with the appropriate focal length for IBIS, but it simply doesn't do anything -- thus allowing the above type of trap focus behavior (without a spinning screw drive) using the AF-S or AF-C Focus Priority setting on the A7RII and later E bodies. I've designed & made tons of dumb 3D-printed adapters (my things on Thingiverse), so the idea would be to make an adapter that did this and provided something like a thumbwheel and maybe a little OLED display to select EXIF data. It seems like something on the scale of an Arduino Nano should be able to do it (if it can be coaxed into doing 750K baud).

Any interest?

PS: Using an LA-EA2/4 with an AF lens on my A7RII does implement trap focus, but with the 3rd-party chip on a manual lens it didn't work. It's been a long time, and 3rd-party A-mount chips vary in what they say the lens can do, so I'm not sure if a different chip would have worked.

Edited by profhankd - 31 August 2020 at 15:48
Back to Top
bostwickenator View Drop Down
Newbie
Newbie

Joined: 19 June 2009
Status: Offline
Posts: 28
Post Options Post Options   Quote bostwickenator Quote  Post ReplyReply Direct Link To This Post Posted: 31 August 2020 at 19:47
You should pull my Teensy code. It does all the negotiation stages and enters the main message loop. From there it should be pretty easy to do what you are talking about. Also I have docs for the message sequence. Just please don't start from scratch again 3 of us have gotten to roughly this point before giving up. https://github.com/LexOptical/E-Mount
Back to Top
profhankd View Drop Down
Newbie
Newbie

Joined: 11 February 2010
Country: United States
Location: Lexington, KY
Status: Offline
Posts: 27
Post Options Post Options   Quote profhankd Quote  Post ReplyReply Direct Link To This Post Posted: 31 August 2020 at 23:57
Originally posted by bostwickenator bostwickenator wrote:

You should pull my Teensy code. It does all the negotiation stages and enters the main message loop. From there it should be pretty easy to do what you are talking about. Also I have docs for the message sequence. Just please don't start from scratch again 3 of us have gotten to roughly this point before giving up. https://github.com/LexOptical/E-Mount


Seeing your teensy code (which I grabbed) is part of why I'm thinking this should be doable now... although I'm less fond of you board choice. Might try an ESP32 if it needs the power, but I was really hoping a 3.3V nano might be able to handle 750K baud....
Back to Top
bostwickenator View Drop Down
Newbie
Newbie

Joined: 19 June 2009
Status: Offline
Posts: 28
Post Options Post Options   Quote bostwickenator Quote  Post ReplyReply Direct Link To This Post Posted: 01 September 2020 at 01:35
Sorry about the tone of that post I've been having quite the day. Glad that code is helping you.

I opted for something way too powerful because I wanted to eliminate that as a concern while in the POC phase. For building a product it would make sense to optimize and use something more appropriate. Best to prove it out first though IMO.
Back to Top
profhankd View Drop Down
Newbie
Newbie

Joined: 11 February 2010
Country: United States
Location: Lexington, KY
Status: Offline
Posts: 27
Post Options Post Options   Quote profhankd Quote  Post ReplyReply Direct Link To This Post Posted: 24 September 2020 at 05:30
Originally posted by bostwickenator bostwickenator wrote:

I opted for something way too powerful because I wanted to eliminate that as a concern while in the POC phase. For building a product it would make sense to optimize and use something more appropriate. Best to prove it out first though IMO.


Well, your code definitely seems like the right starting point.... Do you have a diagram of your pin connections for the Teensy 3.5 posted?

I've been busy with other things, but I did open an extension tube and I'm thinking literally running your code on a Teensy 3.5 might be a safer first step than using one of the other chips. I hand't realized that the Teensy 3.5 is actually pretty different from other so-called Arduinos....
Back to Top
bostwickenator View Drop Down
Newbie
Newbie

Joined: 19 June 2009
Status: Offline
Posts: 28
Post Options Post Options   Quote bostwickenator Quote  Post ReplyReply Direct Link To This Post Posted: 24 September 2020 at 16:10
Pin assignments are https://github.com/LexOptical/E-Mount/blob/master/E-Mount.ino#L7

Teensy pinouts are here (make sure you are looking at the 3.5 I've made the mistake of referencing the wrong board before) https://www.pjrc.com/teensy/pinout.html

Wiring is direct no need for voltage translation or anything.
Back to Top
profhankd View Drop Down
Newbie
Newbie

Joined: 11 February 2010
Country: United States
Location: Lexington, KY
Status: Offline
Posts: 27
Post Options Post Options   Quote profhankd Quote  Post ReplyReply Direct Link To This Post Posted: 24 September 2020 at 23:20
Originally posted by bostwickenator bostwickenator wrote:

Pin assignments are https://github.com/LexOptical/E-Mount/blob/master/E-Mount.ino#L7

Teensy pinouts are here (make sure you are looking at the 3.5 I've made the mistake of referencing the wrong board before) https://www.pjrc.com/teensy/pinout.html

Wiring is direct no need for voltage translation or anything.


I saw the 3 PIN_ constants in the code, and I see some magic constants in the code for things like pin 1 and 5. I was hoping there was a diagram somewhere just to be sure.

In particular, I was wondering about power & ground. I assume you powered the Teensy 3.5 off a USB supply, tied the grounds together, and probably didn't connect the E power pins to anything? Or did you use that to see when the camera is turned on?

Did you have to do any jumpers to play with 3.3v vs. 5V signaling? I've never used a Teensy before....
Back to Top
Dyxum main page >  Forum Home > Dyxum Community > Knowledge Base Page  <1 11121314>

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.076 seconds.

Monitor calibration strip

Dyxum.com - Home of the alpha system photographer

In memory of Cameron Hill - brettania

Feel free to contact us if needed.