Question about adding Eyefi-config code to CHDK build. - page 6 - General Discussion and Assistance - CHDK Forum supplierdeeply

Question about adding Eyefi-config code to CHDK build.

  • 84 Replies
  • 24232 Views
Re: Question about adding Eyefi-config code to CHDK build.
« Reply #50 on: 23 / September / 2013, 16:56:02 »
Advertisements
Here is the eye-fi compatibility page.  http://support.eye.fi/cameras/#canon
The issue exists for the G12, G1X, SX150, Elph300, SX30, SX40, but not the G15 or SX50.  I think it exists for older Powershots that recognize the card, but not the newest ones.  Much older ones that do not recognize the card work fine.
For many Powershots Canon turns off wifi when taking a photo.
I think it would help (those who plan to look into the code) if you could name exact camera models with (and without) this issue.
« Last Edit: 23 / September / 2013, 17:00:37 by hiker_jon »

*

Offline lapser

  • *****
  • 1093
Re: Question about adding Eyefi-config code to CHDK build.
« Reply #51 on: 24 / September / 2013, 00:59:56 »
For many Powershots Canon turns off wifi when taking a photo.
It sounds like Canon is deliberately turning off the wifi power to the EyeFi card when it takes a picture. It's possible that there's not enough power available to power both at the same time. But I guess you never know until you try it, if it's possible.
EOS-M3_120f / SX50_100b / SX260_101a / G1X_100g / D20_100b
https://www.youtube.com/user/DrLapser/videos

Re: Question about adding Eyefi-config code to CHDK build.
« Reply #52 on: 24 / September / 2013, 09:39:48 »
Quote
For many Powershots Canon turns off wifi when taking a photo.

Did you check the Eyefi's log files to see if it reboots (power off than on) or receives "weird" commands from the camera?

Re: Question about adding Eyefi-config code to CHDK build.
« Reply #53 on: 24 / September / 2013, 10:25:23 »
Did you check the Eyefi's log files to see if it reboots (power off than on) or receives "weird" commands from the camera?

How do I do that?

Quote
It sounds like Canon is deliberately turning off the wifi power to the EyeFi card when it takes a picture. It's possible that there's not enough power available to power both at the same time. But I guess you never know until you try it, if it's possible.
I agree that it is deliberate, but it is unnecessary as can be seen by the fact that older and newer cameras work fine without turning it off.  I think it was due to an overabundance of caution on Canon's part plus they didn't realize the problems it would cause.


Re: Question about adding Eyefi-config code to CHDK build.
« Reply #54 on: 24 / September / 2013, 10:31:12 »
The Eyefi helper application sitting in the tray bar has a context menu that allows you to save the card's log; obviously enabled only if the card is inserted in the PC's SD slot (or USB reader)

Re: Question about adding Eyefi-config code to CHDK build.
« Reply #55 on: 24 / September / 2013, 12:59:39 »
I did a comparison between my old A720 and my SX150.  The eye-fi worked far better in the A720.  It started wifi almost immediately after I took my first picture.  Kept it on as I continued to take pictures, and transferred the images quickly.
In the SX150 it was a huge pain.  Slow to start the wifi after I took my first picture and then it disconnected after I took each subsequent picture.  Sometimes it simply refused to turn back on the wifi.  The log is confusing because so much is going on, but this appeared in the SX150 and not in the A720:
[02:24] AP Active - stopping AP
[02:24] AP Idle
[02:24] AP stopped
[02:24] Disconnected from WLAN (reason = 3).
[02:24] WLAN disabled by camera
[02:24] Connection dropped (previous state is 5)
[02:30] Starting scan of media directories...
[02:30] Done scanning for new media (detected 97 MB in all media). Uploads pending.
[02:30] Done scanning for all photos. Uploads pending.
[03:00] WLAN enabled by camera

I think Eye-fi and Canon totally screwed this up.  Perhaps bad communication between the two engineering teams.  I know how this can happen.  Possibly Canon realized that they had wifi cameras in the works and had really no incentive to do a good job with a different company.

At any rate I would love to get the A720 behavior with my G1X.
Jon


*

Offline reyalp

  • ******
  • 13792
Re: Question about adding Eyefi-config code to CHDK build.
« Reply #56 on: 24 / September / 2013, 15:59:18 »
For the problem on cameras that "support" eye-fi in the canon firmware, I suspect adding eye-fi control code to CHDK isn't going to help. You would have CHDK and the canon firmware issuing different commands, which isn't likely to end well.
(edit: this is also general concern with adding eye-fi control code to cameras that have canon firmware support)

A more workable approach is likely to hook the canon code. It looks like there is a task dedicated to eyefi control, can be found by "EyeFiComControl.c" and a call to createtask (looking at sx160 dump). This code eventually access the eye-fi control files.

Possibly this could be hooked to ignore certain messages, or perhaps the messages are sent by a task we already hook like captseq.

A possible reason Canon might do this is concern about RFI issues. Or perhaps performance impacts if both the camera and eyefi are talking to storage?
« Last Edit: 24 / September / 2013, 16:13:49 by reyalp »
Don't forget what the H stands for.

*

Offline srsa_4c

  • ******
  • 4450
Re: Question about adding Eyefi-config code to CHDK build.
« Reply #57 on: 24 / September / 2013, 18:26:02 »
I found a function that checks for an uppercase "EYEFI" string.

sx150 100a:

Code: [Select]
sub_ffa70630:
ffa70630:       e92d4010        push    {r4, lr}
ffa70634:       e3a02005        mov     r2, #5
ffa70638:       e28f1fe6        add     r1, pc, #920    ; ffa709d8: (46455945)  *"EYEFI"
ffa7063c:       ebf68e8f        bl      strncmp
ffa70640:       e2700001        rsbs    r0, r0, #1
ffa70644:       33a00000        movcc   r0, #0
ffa70648:       e8bd8010        pop     {r4, pc}

sub_ff9170c8: ; 8 refs
ff9170c8:       e92d401c        push    {r2, r3, r4, lr}
ff9170cc:       e59f0480        ldr     r0, =0xa5940
ff9170d0:       e5d01006        ldrb    r1, [r0, #6]
ff9170d4:       e3510000        cmp     r1, #0
ff9170d8:       15d00001        ldrbne  r0, [r0, #1]
ff9170dc:       1a00000d        bne     loc_ff917118
ff9170e0:       e1a0000d        mov     r0, sp
ff9170e4:       eb0152f9        bl      sub_ff96bcd0 ; retrieve some card(?) related data
ff9170e8:       e3500000        cmp     r0, #0
ff9170ec:       1a000008        bne     loc_ff917114
ff9170f0:       e1a0000d        mov     r0, sp
ff9170f4:       eb05654d        bl      sub_ffa70630 ; check for EYEFI in the previously retrieved data
ff9170f8:       e3500000        cmp     r0, #0
ff9170fc:       0a000004        beq     loc_ff917114
ff917100:       e59f0450        ldr     r0, =0x10c2
ff917104:       ebfe11c2        bl      IsControlEventActive_FW
ff917108:       e3500000        cmp     r0, #0
ff91710c:       13a00001        movne   r0, #1
ff917110:       1a000000        bne     loc_ff917118
loc_ff917114: ; 2 refs
ff917114:       e3a00000        mov     r0, #0
loc_ff917118: ; 2 refs
ff917118:       e8bd801c        pop     {r2, r3, r4, pc}
sub_ff9170c8 is the only function that calls the string checker routine, it could be the card type detector. One could peek (and poke if brave enough) around 0xa5940, maybe the detection can be sabotaged...
By poking I mean specifically the bytes at 0xa5941 and 0xa5946, as the above routine expects.

This will obviously only work if the data around 0xa5940 is not refreshed continuously. Even if it "works", the result may not be useful at all, since the firmware may have already detected the card in the boot process.


Re: Question about adding Eyefi-config code to CHDK build.
« Reply #58 on: 24 / September / 2013, 19:03:02 »
Quote
this is also general concern with adding eye-fi control code to cameras that have canon firmware support

I think you're right, although in practice I did not experience any conflict while playing with my eye-fi chdk code.

I thought of a possible solution which could really help with the SX150 woes.

I guess that the standard SX150 menus let you disable the WLAN in the EyeFi. After that the camera would not probably care about turning it off and on again when you take a picture. If we just added a command to force it on again in the CHDK menus, we could trick Canon's firmware to stop bothering the card.
The only problem is I don't actually know how to turn on/off the WLAN in the Eyefi. But it shouldn't be that hard to reverse engineer it. Let me know what you think of my reasoning.

EDIT - Dave Hansen's code includes turning on/off the WLAN, so this is not a problem; if you want I can add this possibility to my code
« Last Edit: 24 / September / 2013, 19:04:54 by buttim »

Re: Question about adding Eyefi-config code to CHDK build.
« Reply #59 on: 25 / September / 2013, 11:23:31 »
I agree that your solution might work.  Please do put it into your Eyefi code.
Jon

I guess that the standard SX150 menus let you disable the WLAN in the EyeFi. After that the camera would not probably care about turning it off and on again when you take a picture. If we just added a command to force it on again in the CHDK menus, we could trick Canon's firmware to stop bothering the card.
The only problem is I don't actually know how to turn on/off the WLAN in the Eyefi. But it shouldn't be that hard to reverse engineer it. Let me know what you think of my reasoning.

EDIT - Dave Hansen's code includes turning on/off the WLAN, so this is not a problem; if you want I can add this possibility to my code

 

Related Topics