Forgot Password
Pentax Camera Forums Home
 
Log in or register to remove ads.

Showing results 1 to 8 of 8 Search:
Forum: Pentax DSLR Discussion 04-30-2014, 10:13 AM  
Resurrecting Pentax firmware hacking
Posted By lister6520
Replies: 765
Views: 298,188
Hi Rayer, unfortunately I have had to suspend work on the O-GPS1 for the time being as I am into another project which isn't leaving me much time. I will eventually return to this though, unless of course someone else sorts it out before I do. I had done some more work after my last post on the subject. Haven't got far but have collected some traces that might be useful and have attached them to this post. There are some notes embedded in the traces noting what was happening at the time. For instance in one of the traces I turn the camera gradually in the hope of seeing the field containing the heading change correspondingly and then remain constant when I stop turning.

I am thinking the 'fix' messages are actually the long ones, but what the other short ones could be is a bit of a mystery. If I remember correctly it was locked onto a signal but probably in 2D as it was indoors. I'm not sure though as unfortunately I did not note that down. The attached files do have a trace from switch on so it might be visible in that. I would not count on there being zeros in the Lat/lon initially though. The other project I am working on also happens to involve GPS and the module I am using often has either the co-ordinates as they were at last switch off or some odd co-ordinates such as 89.9999 N 89.999 E or something similar, so I guess the O-GPS1 could well have some similar peculiarity.

The protocol is necessarily two way for just one reason - that from the camera you can command the GPS to go into calibration mode. There may also be some configuration commands sent at startup.

The communication protocol seems very similar to I2C in some ways but different in others and is probably some proprietary variant of it. I have not fully understood it yet but the way it switches between transmit and receive mode seems to be almost the same as I2C. The clock is always generated by the camera acting as master.

Regarding the frequency of the longer messages it seems quite random, sometimes they can be as often as once every two seconds whereas at other times it could be 30 seconds between each, while the other shorter messages are almost continuous except when the camera goes into standby.




O-GPS1.rar
Forum: Pentax DSLR Discussion 04-03-2014, 03:31 PM  
Resurrecting Pentax firmware hacking
Posted By lister6520
Replies: 765
Views: 298,188
I finally got to work on the O-GPS1 protocol but it turns out it was not as straightforward as I was hoping. The communication seems to work in the exact same way as the P-TTL communication in terms of the synchronisation pulses, the formatting of the bits and so on.

Here is just a preview of what I am seeing - but I haven;t understood much of it yet - it will need some more time.

From what I can see the camera still starts off sending and expecting data to/from the flash but the flash return is just empty (because the flash isn't there) whereas the camera then proceeds anyway to send the ISO, focal length, aperture and such details to the non existent flash a few time but after a few tries just sends all zeros in that slot.

What changes with the GPS is that after conclusion of that sequence the exchange between the GPS and camera then takes place. It is still early for me to figure out what exactly is going on at this point. There is no obvious NMEA encoded as ASCII in the bit sequences but I haven;t ruled out it being buried in there somewhere.

Just to get an idea, this is a typical sequence I get from my decoder with the P-TTL flash in place:
<-+_-+-+_014411380D0C_-+_-+_08638750004_-+-+-+-+-+_E8D0_-+4C50_00-+>
The first sequence being the data the flash sends to the camera and the second one is from thecamera to the flash. The third one I can;t quite remember what it was but I think it has something to do with AF


Whereas this is a typical sequence with the GPS:
<-+_-+-+_00000000_-+_-+_000000000_-+4C50_C0-+-+4C14_C036FF007F-+>
Here we see the first two sequences being all zeros, as there is n othing to communicate between the flash and the camera, but it seems that slot is still reserved for that. Then there is the same 4C50 as with the flash, which I think is the closing sequence of the flash communication, but now instead of being followed by a final 00 we get a C0, presumably signalling the start of GPS communication. The main content of the message being the C036FF007F in this example. A few of these messages are sent every second, with the C036 being always present and the remaining characters changing between one message and the next.

In addition there is occasionally a longer ,essage such as this one:
<000000300000000000000000000000036FF30DF800000000000018060FF8000007F80E6FFC07F80CC7F9980F9FFFFE07F800000F7-+-+4C14_C036FF006D-+>
I'm not sure how often it occurs but it seems somewhat irregular.


On another note I think I figured out why the extension cables cause problems and also why some third party flashes can be unreliable. It is just a silly 'mechanical' problem regarding the way the ground terminal connects and black paint on the camera hotshoe bracket. It seems the way grounding is achieved is not so standardised and where some accessories put the ground terminal coincides with where Pentax puts black paint and where Pentax puts the metal contact the accessoriy has plastic or anodised aluminium.
Forum: Pentax DSLR Discussion 03-30-2014, 05:30 AM  
Resurrecting Pentax firmware hacking
Posted By lister6520
Replies: 765
Views: 298,188
I've just received the new P-TTL cable and hopefully will find the time tomorrow to start working on it. I have however checked a couple of things regarding why the GPS won;t work with the cable. First thing I tried with the new cable and found that it does work - sort of. The camera recognises it and I can get the compass display but it updates very slowly and intermittently and I never get a GPS lock. So it seems some communication is getting through but it is garbled.

Out of curiosity I checked the cable capacitance and found that with the one I was using before (which doesnt work at all with the GPS I had between 300 and 500pf between any two conductors whereas with the new (and cheap) one it is more in the range of 120 to 240 pf, practically half (depending on which two conductors are measured).

If the signals are high impedance and/or open collector then even 100pf could be very significant if it is expected sharp rising/falling edges.

Resistance is less than 1 ohm in all cases. I just measured that with a multimeter, didn;t bother with a milliohmmeter as anything less than 10 ohms or so would normally be irrelevant in any case.

First thing I do will be to dismantle the cable and reassemble it with the two ends connected by very short single strand wires and see if the GPS is happy with that. If it is then I'll tap the wires with some sort of high impedance input stage.
Forum: Pentax DSLR Discussion 03-24-2014, 09:47 AM  
Resurrecting Pentax firmware hacking
Posted By lister6520
Replies: 765
Views: 298,188
I actually expended quite a lot of effort trying to solve it that way but found that while it was easy to get the display to show North when pointed to the North as soon as I turned the camera or even changed the elevation the amount of compensation changes. I tried positioning the magnets and/or steel rods fixed relative to the camera and/or fixed to the tripod, even tried an electromagnet sort of thing in the form of a large frame but nothing that I did could give me a constant and predictable correction which stayed correct as I pointed the camera away from the North star.

Anyway, I should be receiving the new (and cheap) cable sometime this week and will probably find some time in the weekend to start working on it. I am quite sure the protocol will be completely different from that of the flash - I am thinking it will be straight NMEA ASCII strings except for some initial response to the camera interrogating the hotshoe. If so it should be quite easy to devise a PIC to alter the values within the relevant strings.
Forum: Pentax DSLR Discussion 03-23-2014, 04:03 AM  
Resurrecting Pentax firmware hacking
Posted By lister6520
Replies: 765
Views: 298,188
I'd rather wait for the cheap cable to arrive and replace its cable rather than risk damaging the hotshoe or GPS. I don't have problems with the flash, it's only the GPS that doesn't work with the cable, although I do have a feeling that the flash is actually less reliable when used with the cable. I am thinking the only possibility is that the GPS has weaker outputs and/or less sensitive inputs than the flash.


That's not enough in some situations unfortunately. I had started a thread on that subject:
https://www.pentaxforums.com/forums/6-pentax-dslr-discussion/241072-astrotrac...libration.html
Forum: Pentax DSLR Discussion 03-22-2014, 03:46 AM  
Resurrecting Pentax firmware hacking
Posted By lister6520
Replies: 765
Views: 298,188
I was all set up to start figuring out the GPS protocol but I've hit a snag which is going to delay me somewhat. For the flash I have used a P-TTL extension lead which I slightly modified to tap into the connections but for some reason the GPS is not communicating at all with the camera when I connect it via the extension cable, even before I have conencted anything to the tapped connections. I've tried also with a second splitter cable and it doesn;t work either - seems it likes to be connected directly to the hot shoe.

I am thinking it is excessive capacitance. The thing is I don't to ruin the two cables I have beyond the minor intervention I made to tap into the connections. I've just ordered a cheap one from Poland on eBay which I'll then dismantle and rebuild wiring the two ends together with very short lengths of single wires. Hopefully that will work.



Is there anyone who has an O-GPS1 and a P-TTL extension cable who could try see if the GPS can actually work on an extension cable, maybe I am just unlucky and the specific cables I have are the problem?



If I do manage to figure it out my next project will be a device to allow me to dial in a compensation for the magnetic compass error. The idea would be that a PIC processor would sit in between the GPS and the camera passing on most of the data unchanged but then when it recognises a compass reading it would add an offset to it and send on the modified version instead of the original. Well that's the theory at least. Meantime I'm still hoping Pentax would include such functionality in the next firmware update and saving me a lot of effort.
Forum: Pentax DSLR Discussion 03-17-2014, 10:42 AM  
Resurrecting Pentax firmware hacking
Posted By lister6520
Replies: 765
Views: 298,188
I had posted my notes on this forum but cannot find that post so here is the info again:
P-TTL flash protocol reverse engineering.rar

Unfortunately it is all just my personal notes and somewhat muddled, not really intended for publication and might be a bit difficult to follow. However feel free to ask and I'll help you through it where it is too unclear.

The word document describes the function of the contacts and some basics of how the communication is formatted.

The excel sheets show the actual waveforms in detail, the bit by bit composition of the messages, translation of the values into real terms such as aperture, ISO, flash power and so on as well as a good number of actual sequences correlated to the actual flash settings and stuff.

This was all done with a K-r and a Metz 58-AF2. I initially used a DSO to figure out what the pins did, the various data rates and so on and once that was figured out I used a PIC microprocessor to pick up the signals from the hot shoe and convert them into ASCII strings which are then sent to the PC over a TTL to USB converter which appears to the PC as a serial port. The contents of the 'Sample sequences' sheet is that output pasted directly onto the worksheet and formatted a bit to make it tidy.

The data pin is indeed bidirectional but the data is sent/received synchronously being clocked by another of the pins. The third pin is somne sort of ready/attention indicator and I think also controls the direction of the transfer. One thing I have not yet understood is who controls the ready and clock pins. It seems that the clock is always stepped by the camera but I haven't yet confirmed that.

I am curious to find out whether the GPS uses the same principle or else a more conventional asynchronous mode with separate transmit and receive.

And here is something also about the optical signals used for remote flash:
https://www.dropbox.com/s/5u4oiqbop6vbkq0/Remote%20flash%20protocol%20reverse%20engineering.txt

---------- Post added 03-17-14 at 07:16 PM ----------

Ah just realised - so as not to create confusion please note that the first page on the excel sheet 'General info' is nothing to do with the Pentax protocol but rather some notes about the decoding program running on the PIC. The first table can however be used as the key to understanding the meaning of the sequences shown on the page 'sample sequences'. This is a sort of semi decoded formatting of the bits to make it visually easier to understand.
Forum: Pentax DSLR Discussion 03-16-2014, 03:25 PM  
Resurrecting Pentax firmware hacking
Posted By lister6520
Replies: 765
Views: 298,188
I have a DSO and an O-GPS1. I had decoded quite a lot of the P-TTL protocol a year or so ago. Never had a look at the GPS yet but maybe it's about time I do. The flash protocol isn;t too difficult to reverse engineer. My guess is that the GPS will be easier - I might give it a try the coming weekend.
Search took 0.00 seconds | Showing results 1 to 8 of 8

 
Forum Jump


All times are GMT -7. The time now is 07:14 AM. | See also: NikonForums.com, CanonForums.com part of our network of photo forums!
  • Red (Default)
  • Green
  • Gray
  • Dark
  • Dark Yellow
  • Dark Blue
  • Old Red
  • Old Green
  • Old Gray
  • Dial-Up Style
Hello! It's great to see you back on the forum! Have you considered joining the community?
register
Creating a FREE ACCOUNT takes under a minute, removes ads, and lets you post! [Dismiss]
Top