Write straight to android phone over USB? - General Help and Assistance on using CHDK stable releases - CHDK Forum

Write straight to android phone over USB?

  • 4 Replies
  • 1990 Views
Write straight to android phone over USB?
« on: 06 / April / 2022, 14:07:00 »
Advertisements
Hi,

I've looked about but not found a clear answer/thought it would be easier to make a thread about it.

I want to use my IXUS 1000 like this-



(cable drawn on) attached in tandem.

I would use the camera's controls normally, not remote control, the only difference being it writes to the phone's storage over USB.

Would it be possible to do this instantaneously after taking a photo, or would I need a seperate script to kick in at all? I remember having to switch SD card partitions in order to access photos on a computer, maybe a script would have to run to do that.

The phone is a Huawei P9 plus, it has all the usual modes of MTP / PTP, is also OTG compatible.

Many thanks for all your help.
« Last Edit: 06 / April / 2022, 14:08:57 by Eggplant »

*

Offline Caefix

  • *****
  • 945
  • Sorry, busy deleting test shots...
Re: Write straight to android phone over USB?
« Reply #1 on: 06 / April / 2022, 15:45:49 »
 ;) ... Even the cable would be a quite fragile connection. I doubt the fun-factor  ... :(
All lifetime is a loan from eternity.

*

Offline reyalp

  • ******
  • 14080
Re: Write straight to android phone over USB?
« Reply #2 on: 06 / April / 2022, 19:51:21 »
I would use the camera's controls normally, not remote control, the only difference being it writes to the phone's storage over USB.
Short answer: You can't, at least not without writing custom software that runs on the phone. The only way for these cameras to save directly over USB without touching the internal SD card is using the CHDK PTP extension, which requires a custom client. One could theoretically write a client for Android, but AFAIK no one has, and depending how Android manages access to PTP devices, it might require root.

Quote
Would it be possible to do this instantaneously after taking a photo, or would I need a seperate script to kick in at all? I remember having to switch SD card partitions in order to access photos on a computer, maybe a script would have to run to do that.
Partition swapping won't be an issue if your are using PTP to access the camera, the files seen over PTP would be the same as what the Canon firmware sees, which would be the large partition in a correctly configured mult-partition card.

As described above, you can't have shots saved *directly* to the phone at all.

You could theoretically write a script that allowed you to shoot while the cable was connected, and then subsequently make the camera visible to the phone to transfer photos using whatever method it normally does with PTP. This could be done by masking the USB bit using the USB remote setting, or possibly switching to rec with switch_mode_usb. This would essentially just save you connecting/disconnecting the cable, which probably isn't what you want, but I can provide more details if it is.
Don't forget what the H stands for.

Re: Write straight to android phone over USB?
« Reply #3 on: 05 / November / 2023, 07:15:47 »

Quote
Would it be possible to do this instantaneously after taking a photo, or would I need a seperate script to kick in at all? I remember having to switch SD card partitions in order to access photos on a computer, maybe a script would have to run to do that.
Partition swapping won't be an issue if your are using PTP to access the camera, the files seen over PTP would be the same as what the Canon firmware sees, which would be the large partition in a correctly configured mult-partition card.

As described above, you can't have shots saved *directly* to the phone at all.

You could theoretically write a script that allowed you to shoot while the cable was connected, and then subsequently make the camera visible to the phone to transfer photos using whatever method it normally does with PTP. This could be done by masking the USB bit using the USB remote setting, or possibly switching to rec with switch_mode_usb. This would essentially just save you connecting/disconnecting the cable, which probably isn't what you want, but I can provide more details if it is.

Very sorry for this very late response - I thought my message had posted many months ago..

I am interested in what you suggest, and would like to see the project through. I don't think anything will have changed in a year, but I will do a quick look anyway.
« Last Edit: 05 / November / 2023, 07:17:25 by Eggplant »


*

Offline reyalp

  • ******
  • 14080
Re: Write straight to android phone over USB?
« Reply #4 on: 05 / November / 2023, 17:07:45 »
I am interested in what you suggest, and would like to see the project through. I don't think anything will have changed in a year, but I will do a quick look anyway.
Yes, nothing has changed from the CHDK side, so you're options are still either write an Android CHDK PTP client (if android even lets 3rd party applications talk to PTP devices), or a script that just saves you from connecting/disconnecting the cable.

How do the camera and phone behave when you plug in the camera now? Does the camera screen go dark and the phone give you some notification or app to transfer images?
« Last Edit: 22 / November / 2023, 19:05:27 by reyalp »
Don't forget what the H stands for.

 

Related Topics