Using ptp and remote operations for full body scanner - General Help and Assistance on using CHDK stable releases - CHDK Forum

Using ptp and remote operations for full body scanner

  • 23 Replies
  • 10178 Views
Using ptp and remote operations for full body scanner
« on: 15 / September / 2017, 13:13:54 »
Advertisements
Hello everyone,

I've been working on building a fairly large (60 a3400 is's) array and I was told that this community was super friendly and helpful so I was hoping to get some help and/or advice.

For several months now I've been working on building an array for full body scans from the remains of an old system. What I've been doing is using an old script from the original version which tells the camera to fire by giving it a 5 volt jump, then using a script I made to extract the pictures.

The only problem is that in doing so I interrupt the usb connection and all 60 cameras have to remount, which can be pretty finicky when all 60 cameras are trying to mount at once. My current thinking is that if I could somehow trigger the shot using my extraction software then the cameras wouldn't have to remount and (a lot of the time) crash my mounter.

I need to get this machine running reliably and quickly before the end of next week and though I've been doing tons of research I'm still new to CHDK and I'm worried that I won't have it working in time.

I'll attach the ptp script I'm using on the cameras

I'd really appreciate any help you're willing to lend. I'm sorry if this has been asked before or the answer is really obvious, I've only just started researching software triggers but I wanted to post this sooner rather than later because I'm really tight for time and I don't want to do tons of research only to find that the answer was so simple that no one even bothered to ask.

-John

Re: Using ptp and remote operations for full body scanner
« Reply #1 on: 15 / September / 2017, 15:50:53 »
So after reading through pretty much the entirety of multiple forum threads I'm still stumped. One thread talked about tricking the ptp remote to think it still has power but then it went on to say you had to add a line of code to the kbd.c file and I can't for the life of me find the file they talked about. The post was also from 2013 so I'm not sure how much of that still applies. :(

*

Offline reyalp

  • ******
  • 14079
Re: Using ptp and remote operations for full body scanner
« Reply #2 on: 15 / September / 2017, 16:23:11 »
So after reading through pretty much the entirety of multiple forum threads I'm still stumped. One thread talked about tricking the ptp remote to think it still has power but then it went on to say you had to add a line of code to the kbd.c file and I can't for the life of me find the file they talked about. The post was also from 2013 so I'm not sure how much of that still applies. :(
You're in luck, it doesn't. usb_force_active is now a standard feature: http://chdk.wikia.com/wiki/Lua/PTP_Scripting#usb_force_active

If you can link me to the post where you found that, I can add a note.
Don't forget what the H stands for.

Re: Using ptp and remote operations for full body scanner
« Reply #3 on: 15 / September / 2017, 18:01:34 »
Oh my god you're a life saver!

Here's the post I mentioned : https://chdk.setepontos.com/index.php?topic=8769.40

You wouldn't happen to have a script lying around that uses a 5v jump to shoot but hides it from ptp would you? Or is there a script that uses the 5v already that I can add that line to?


Re: Using ptp and remote operations for full body scanner
« Reply #4 on: 15 / September / 2017, 21:03:00 »
.. What I've been doing is using an old script from the original version which tells the camera to fire by giving it a 5 volt jump, then using a script I made to extract the pictures....

...The only problem is that in doing so I interrupt the usb connection and all 60 cameras have to remount, which can be pretty finicky when all 60 cameras are trying to mount at once....

....I'd really appreciate any help you're willing to lend...
...I've only just started researching software triggers but .....
If you believe that that there is some type of USB (windows) hardware issue, you can try using:-
UsbDeviceView, UsbLogView, by NirSoft and UsbTreeView by Uwe Siber to monitor the Usb, Hubs, and Cameras.
If you are using a "5 volt jump" to "Sync" all the cameras in your array ( ??? ), it would be helpful to provide more
detail about the "5 volt jump".
Also be aware if you are attempting to send the "5 volt jump" through the USB-Hub's, possibly via a "Powered"
USB-Hub switch, there are several major problems to consider:-
a/ The USB-Hub's internal +5 volt "Poly-Fuse" or a "Current-Limiting Resistor".
b/ The USB-Hub's internal +5 volt "Filter-Capacitors" on the +5 volt USB-Output's.
c/ See Edit #1 below
So in-order to simply by-pass the above stuff the "5 volt jump" need's to independently supplied to each camera in
your array either by:-
1/ A +5 volt photo-switch or similar device.
2/ A common but  independent +5 Volt switch wire for each camera in your multi-camera array.
3/ Some camera's will draw a current in the order of about 1 milli-amp per camera.
4/ The "5 volt jump" then need's to be able to switch a minimum of 100 times the current in #3.
5/ An optional, single, termination resistor of about 1K Ohms to common camera ground will also help,
    as the camera's in your multi-camera array have a non-linear current curve.

The above only applies when attempting to sync the cameras by switching the +5 volt method.

Another thing to note is the above stuff is "Un-Balanced" but the USB cables are "Balanced".
i.e. USB uses, balanced, twisted pairs to improve the noise performance.
Also windows will only connect to one camera at a time when downloading the files.
So additional, software, multi-camera switching is then done via PtP, if everything is working
correctly in the PtP software, the next camera in the multi-camera array will then "Auto-Connect".
and the reaming cameras will be just ignored by windows.

Edit #1 If you are using "Cheap & Powered" USB-Hubs there are some additional things:-
Aa/ The USB-Hubs powered via a "Cheap" and un-regulated +5 volt "Wall-Wart" can back-feed
       more than +5 volts into your computer as they don't fully comply with the USB standards.
Bb/ The same "Cheap-Generic" USB-Hubs, in order to reduce production costs, don't fully populate
       the internal PCB with all the components as specified in the original design.

Edit #2 "Auto-Connect" is equivalent to Multiple USB Hot-Plugs.

Example:- I use a "Cheap" long and thin 10 port USB-2  Hub's the original production batches have
all components fitted but the later  production batches have missing components and some
components are of lower values just to save production costs.

Ref:- WARNING: DO not buy these hubs, they are dangerous
here https://www.reddit.com/r/hardware/comments/1ory4z/warning_do_not_buy_these_hubs_they_are_dangerous/?st=j7morsw9&sh=3f9b8346

This only applies when powered via the supplied "Wall-Wart".

H-H
« Last Edit: 17 / September / 2017, 20:43:51 by Hardware_Hacker »

Re: Using ptp and remote operations for full body scanner
« Reply #5 on: 15 / September / 2017, 22:22:17 »
What I've been doing is using an old script from the original version which tells the camera to fire by giving it a 5 volt jump, then using a script I made to extract the pictures.
When you say "5 volt jump" you mean that you are toggling +5V to the power pin of the USB connector with the CHDK USB Remote functionality enabled?

Quote
I'll attach the ptp script I'm using on the cameras
The script you attached uses the CHDK USB scripting functions.  It does not communicate with the camera(s) via ptp. Did you attach the right one?

You're in luck, it doesn't. usb_force_active is now a standard feature: http://chdk.wikia.com/wiki/Lua/PTP_Scripting#usb_force_active
AFAIK, I don't think usb_force_active() is quite what the OP is looking for if he is trying to use a standard USB remote.   The usb_force_active() function was implemented to allow chdk_ptp to shoot and wait at the USB remote sync point for the USB line to go to 0v.  At least I think that was the thought process at the time.

For reference, I've attached a modified version of his script that trys to use usb_force_active(). It will indeed shoot via USB remote function ( +5v toggles) and communicate via PTP without disconnecting / connecting.  However, when using it that way there is not much you can do (at least with chdk_ptp) as there is already a script running when you try to use chdk_ptp functions.

I think that the solution here is to use chdk_ptp to control shooting and use the "USB 5V jump" to achieve sync.
link > Multiple Cameras using CHDK
link > chdkptp

If you believe that that there is some type of USB (windows) hardware issue, you can try using:-
What the OP describes has nothing to do with Windows USB hardware issues.
« Last Edit: 15 / September / 2017, 22:25:00 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 14079
Re: Using ptp and remote operations for full body scanner
« Reply #6 on: 15 / September / 2017, 22:53:43 »
AFAIK, I don't think usb_force_active() is quite what the OP is looking for if he is trying to use a standard USB remote.
I pointed it out because it was implemented the keyboard mod referenced.

Quote
It will indeed shoot via USB remote function ( +5v toggles) and communicate via PTP without disconnecting / connecting.
Yeah, this is what I would expect, since most (if not all) ports query the usb status directly for USB remote functionality rather than the spoofed physw_status.

Quote
However, when using it that way there is not much you can do (at least with chdk_ptp) as there is already a script running when you try to use chdk_ptp functions.
You could kill it (with chdkptp killscript function) to run downloads, which I think is what the OP wanted. Or add a ptp message check to exit, and restart it from chdkptp when done.

I should really integrate the force active option into multicam.
Don't forget what the H stands for.

Re: Using ptp and remote operations for full body scanner
« Reply #7 on: 15 / September / 2017, 23:52:32 »
Quote
If you are using a "5 volt jump" to "Sync" all the cameras in your array ( ??? ), it would be helpful to provide more
detail about the "5 volt jump".
Sorry I worded that pretty poorly, when I said jump I did indeed mean switching. I have a usb trigger that appears to be an and gate (I'm not the one who made it) to allow usb power if a button is pressed (the data line is always on). I have 3 (previously 4 but one died :() 24 port manhatten hubs plugged into a powered usb hub. Then the powered hub is connected to a switch which is connected to a computer

Quote
Also windows will only connect to one camera at a time when downloading the files.
Yeah this was a big problem at first, I had to connect 21 at a time through ptpdrive (which automatically mounts them to drive letters), but eventually I decided to just switch over to ubuntu which mounts the cameras very nicely into one folder.

Thanks so much for all your help so far, now I'm just sitting here playing around with the chdk scripting (the play_sound(7) command was very nice). I'll keep mucking around with it until I find one solution or another (or just die of sleep deprivation).


Re: Using ptp and remote operations for full body scanner
« Reply #8 on: 16 / September / 2017, 00:03:33 »
Oh yeah also how do you use usb_sync_wait? It doesn't give any examples on its wiki page.

Re: Using ptp and remote operations for full body scanner
« Reply #9 on: 16 / September / 2017, 00:08:58 »
Oh yeah also how do you use usb_sync_wait? It doesn't give any examples on its wiki page.
Just call the function once each time before you shoot with any of the various scripting methods of shooting.  It basically sets a flag telling CHDK to halt the Canon shooting process immediately before the shutter actually opens while the USB +5V power pin is at 5V.

edit :  there is a 10 second time out for the halt - if the 5V line stays high for more than 10 seconds,  the shot proceeds regardless of the state of the 5V line.
« Last Edit: 16 / September / 2017, 00:14:41 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics