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

Question about adding Eyefi-config code to CHDK build.

  • 84 Replies
  • 20866 Views
Question about adding Eyefi-config code to CHDK build.
« on: 15 / August / 2011, 17:34:00 »
Advertisements
Hi CHDK folks!

I'm still pretty new to CHDK, but I find myself in the position where I think I need to do a custom build - or get one of the amazing developers on here interested in supporting my cause...

I found some code by Dave Hansen, who wrote eyefi-config, to be able to both configure and query the log from an Eye-Fi card on *nix systems, including CHDK (http://git.sr71.net/cgi-bin/gitweb.cgi?p=eyefi-config.git;a=summary).

He even did a CHDK port - sort of http://dave-hansen.blogspot.com/2008/07/eye-fi-config-release-004.html but it doesn't really sound finished. He says
Quote
You need to move files between my project and CHDK and splice them in and recompile.
But there isn't clear information on how to expose his code in CHDK, and I'm really rusty, having only amateurly programmed (mostly scripted) since some pascal and basic years ago. I don't really understand how I could splice this code into CHDK and expose it to scripting.

Would I need to add Lua support for the functions in Dave's code if I want to use it in Lua scripts? And if I want an "Eye-Fi menu" in CHDK, I imagine I would need to edit the CHDK main menu to add an Eye-Fi menu (probably first run his function to test if there's an eye-fi card) then make an Eye-Fi submenu that links to his functions to configure and display card settings

It seems like Dave's code is the place to start to add full-fledged Eye-Fi support to CHDK. The part that I really want is to be able to query the upload status of files, so that once they're uploaded, I can delete them within a CHDK script. If I can get the Eyefi-config functionality into Lua, I can parse the logs to get that info, but, more importantly, one of the Eye-Fi founders said that
Quote
If you can get this to work inside CHDK, then I'd be willing to share with you a few things ... to "ask" the Eye-Fi Card what the upload status of an individual file is, instead of going to hackish method of interpreting log messages (which, ironically, recently changed).
My initial thought was that I need to bite the bullet, install the Windows GUI for trunk building by whim, figure out how to splice in the Eyefi-config code, then figure out how to expose it in CHDK - probably adding both a menu interface for the functions and scripting functionality.

My second thought was, "Wow. That's a lot"

And my third thought was to ask for help/advice. Like "Where do I even start?" And that's why I posted this. Also because deep down I hope somebody way better at this than me will look at the code and go, "cool! that's gonna be easy!"  :D

Thank you all you developers for doing amazing work on CHDK. Especially helpful for me have been reyalp and philmoz, and now I think whim. Oh and PhyrePhoX and waterwingz .. yeah. there are lots of great folks here. Thanks again.

A720 1.00c | D10 1.00b |SX220 1.01a | SX230 ? | SX30 1.00p CHDK ver. 1.1.0-r1727

*

Online philmoz

  • *****
  • 3332
    • Photos
Re: Question about adding Eyefi-config code to CHDK build.
« Reply #1 on: 15 / August / 2011, 18:39:15 »
Don't the Eye-Fi cards already have an option to automatically delete old files after they've been uploaded?

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: Question about adding Eyefi-config code to CHDK build.
« Reply #2 on: 15 / August / 2011, 20:15:58 »
Quote
Don't the Eye-Fi cards already have an option to automatically delete old files after they've been uploaded?
The EyeFi cards kind of have that option (Endless Memory), but (1) it ONLY works if the card is formatted in FAT32, and (2) it deletes the file over a series of several power cycles. Also (3) I don't think the Eye-Fi card can see other partitions. When you install CHDK on a small FAT16 partition and swap to a larger FAT32 partition on boot, the Eye-Fi card can't find any files to upload.

I think Berend said on the Eye-Fi forums that the files aren't fully deleted for around 4-5 power cycles. And it doesn't work so well if it has more than a few (~50?) files to delete because it has to do it in the short window where it does stuff before the camera accesses the filesystem. And from the sounds of it,  "it will never will work on FAT16 filesystems". So that would be pretty cool if CHDK could overcome that limitation on older cameras by acting as the intermediary between Eye-Fi and the camera's OS.

Anyway, I thought that enabling "native" Endless Memory was impossible until I read your post about getting CHDK to boot on FAT32 on the IXUS 310 and funnel's post confirming it on the SX220 (http://chdk.setepontos.com/index.php?topic=6645.0). I read that thread and got so excited I opened a new tab and bought an SX230 HS (crosses fingers) and another Eye-Fi card right there. (guess maybe I'll be the tester for the SX230).  With that solution, I should be able to get a camera up and running that does an endless timelapse without EyeFi-Config built into CHDK.  I guess I'm still out of luck for the SX30 and A720 though - Until CHDK and Eye-Fi can talk to each other.

BUT

IF we can get that EyeFi-config code incorporated into CHDK, then we should be able to query the card to find out whether an image has been uploaded, and delete it via script, making endless memory another added CHDK function for those older cameras.

AND - an Eye-Fi menu would make it so you could do so many things right from the camera:
-turn on ad-hoc mode to connect to an iphone or android phone
-turn off antenna to save battery
-fetch/set endless storage setting
-connect to a new secure or public network without taking your card out of the camera
-and more!
A720 1.00c | D10 1.00b |SX220 1.01a | SX230 ? | SX30 1.00p CHDK ver. 1.1.0-r1727

*

Online philmoz

  • *****
  • 3332
    • Photos
Re: Question about adding Eyefi-config code to CHDK build.
« Reply #3 on: 15 / August / 2011, 21:14:20 »
I took a quick look at the code you linked to - it appears that you communicate with the eye-fi by reading and writing specific files on the card. Implementing this in CHDK should not be too hard; but would require a card for testing (for some reason they aren't readily available where I live).

Since most recent cameras also have some eye-fi support in the firmware, there may be firmware functions you could use to do some of the work required. It's possible that Canon has included a code library supplied by eye-fi into the camera firmware, so if you can find the right functions it might make it easier (and would mean less code added into CHDK).

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)


Re: Question about adding Eyefi-config code to CHDK build.
« Reply #4 on: 15 / August / 2011, 22:14:48 »
Since most recent cameras also have some eye-fi support in the firmware, there may be firmware functions you could use to do some of the work required. It's possible that Canon has included a code library supplied by eye-fi into the camera firmware, so if you can find the right functions it might make it easier (and would mean less code added into CHDK).
It would be easier but would also leave most of the installed base of Canon camera's ported to CHDK behind.  Still, take what  you can get I guess.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Online philmoz

  • *****
  • 3332
    • Photos
Re: Question about adding Eyefi-config code to CHDK build.
« Reply #5 on: 15 / August / 2011, 22:26:39 »
It would be easier but would also leave most of the installed base of Canon camera's ported to CHDK behind.  Still, take what  you can get I guess.

Do the eye-fi cards work on old cameras with no built-in support in the firmware?

If there are usable firmware functions in newer cameras the code can always be pulled out and copied into CHDK for older cameras. All speculation of course until someone with an eye-fi card does some experimenting :)

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: Question about adding Eyefi-config code to CHDK build.
« Reply #6 on: 15 / August / 2011, 22:41:12 »
All speculation of course until someone with an eye-fi card does some experimenting :)
Yup.  And given that I'm still trying to find time to experiment with a simple switch and battery to figure out the USB remote code,  it won't be me putting up my hand to volunteer to take this on.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Online philmoz

  • *****
  • 3332
    • Photos
Re: Question about adding Eyefi-config code to CHDK build.
« Reply #7 on: 15 / August / 2011, 22:44:30 »
Yup.  And given that I'm still trying to find time to experiment with a simple switch and battery to figure out the USB remote code,  it won't be me putting up my hand to volunteer to take this on.

Personally, I think this would be easier than deciphering the USB remote code in CHDK :D
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)


Re: Question about adding Eyefi-config code to CHDK build.
« Reply #8 on: 16 / August / 2011, 00:43:15 »
Quote
Do the eye-fi cards work on old cameras with no built-in support in the firmware?
the eye-do cards work in any camera but they won't do endless memory on FAT16 cards.

But part of the beauty of the eye-fi cards is that their operation is invisible to cameras that aren't eye-fi aware.

Adding support to chdk for those cards would add functionality that I haven't seen in any camera.and it looked like the code to do it it's pretty small?
A720 1.00c | D10 1.00b |SX220 1.01a | SX230 ? | SX30 1.00p CHDK ver. 1.1.0-r1727

Re: Question about adding Eyefi-config code to CHDK build.
« Reply #9 on: 16 / August / 2011, 02:12:13 »
Dave posted this address for his chdk stuff..sounds like he hadn't revisited it for a while. The dates are around the same time as the github code.

http://sr71.net/~dave/projects/eyefi/chdk/
A720 1.00c | D10 1.00b |SX220 1.01a | SX230 ? | SX30 1.00p CHDK ver. 1.1.0-r1727

 

Related Topics