I have just succeeded in running the gphoto application on my Android
Freerunner. Gphoto
(http://gphoto.sourceforge.net/)<http://gphoto.sourceforge.net/> talks
to my Nikon DSLR via USB (Android in hostmode), triggers  the release
shutter and downloads the photo to the phone.

In addition to the instructions given by Andy in this thread there were a
number of other commands required to successfully put Android in USB host
mode:

The first were to make the two files required for host mode to be made
writeable. At the moment I issue the following commands:

   - adb shell mount -o rw,remount rootfs /
   - adb shell chmod 666
   /sys/class/i2c-adapter/i2c-0/0-0073/neo1973-pm-host.0/hostmode
   - adb shell chmod 666 /sys/devices/platform/s3c2410-ohci/usb_mode

This should of course go into init.rc for production systems.

The second is to mount the usb file system with:

   - adb shell mount -t usbfs none /proc/bus/usb

At the moment I am at the state where I have a gphoto2 executable that I can
start from the Terminal Emulator, so this is not yet run from within an
Android app. Apart from not yet having written a JNI wrapper, I have the
issue that reading from the usb file system requires the application to be
root. I have hacked this at the moment by making my gphoto2 executable suid
root. Is there a way to make this readable/writable by others (the problem
is that while tethered to the computer the file system is empty and once
connected to the camera I do not have a root shell any more)?

There were a number of things that I had to do to make this work that I
would like to share, like compiling a number of external libraries:

   - libusb as a shared library
   - compiling ltdl into a shared library for portable shared library
   loading
   - libiconv
   - regex as a shared library
   - plus of course gphoto2 as well.

The majority of this work was to write the Android.mk files and to have
suitable config.h files. What is the best way of sharing this?

Ludwig


>
>
> | I would like to port the ghoto2 application, which talks to all sorts of
> | digital cameras over USB, to Android. It is a C library, for which a JNI
> | interface would have to be written so that it could be called from an
> | Android application. Someone else has done this (unfortunately without
> | releasing the code) for another distribution on the
> | freerunner: http://0x2a-blog.org/?p=49. <http://0x2a-blog.org/?p=49>
> |
> | The first hurdle is of course that this needs to put the freerunner into
> | USB host mode. The wiki says this is TBD.
> |
> | I do not really know much about this. What is the state of this and what
> | would need to be done on it? Is this for any reason a non-starter?
> | All pointers welcome.
>
> No it's pretty easy, you just need to cat to a couple of /sys nodes
>
> echo 1 > /sys/class/i2c-adapter/i2c-0/0-0073/neo1973-pm-host.0/hostmode
> echo host > /sys/devices/platform/s3c2410-ohci/usb_mode
>
> put 0 and "device" there instead to switch it back.
>
> - -Andy
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
>
> iEYEARECAAYFAkmUJrsACgkQOjLpvpq7dMotwgCdF0khFVk5E5gKTz1F4eG/em8t
> tPQAnRAMC8RDTBr8a1oIY9RAL+KgGSBg
> =HLkF
> -----END PGP SIGNATURE-----
> _______________________________________________
> android-freerunner mailing list
> android-freerunner@android.koolu.org
> http://android.koolu.org/listinfo.cgi/android-freerunner-koolu.org
>
_______________________________________________
android-freerunner mailing list
android-freerunner@android.koolu.org
http://android.koolu.org/listinfo.cgi/android-freerunner-koolu.org

Reply via email to