I'm not clear what approach you're pursing at this point, but I again, I highly recommend not connecting USB (or making the camera think it's connected with force_usb_active) when the camera is in rec.
It's also likely you need some delay between force_usb_present and switch_mode_usb. On elph130, 100ms seems to be plenty going from play mode, while no delay failed to switch.
If you are allowing the camera to auto-switch to play due to sensing USB, that would need additional time.
i'm now trying to figure out what code i should add to my script, so i can connect the usb (maybe leave it connected) and keep it connected while the cam goes back and/or stays in record mode and resumes shooting.if it stays connected i need some flag after each shot, so the pc can detect when it's safe to start downloading.
QuoteIf you are allowing the camera to auto-switch to play due to sensing USB, that would need additional time.if at all possible, i'd like to prevent it switching to play as much as possible. that is the code i am looking for.
I see this as a fair chance the cam will fail quickly if it switches to play a 100 times a day.
my first thought is that i should create a window of a few hours a day in the cam script that will enable connection and download. outside those hours this connection can be blocked. possibly making (re)connection of usb safe outside the download hours.
I not clear how you intend to combine blocking USB and using force_usb_active. I see these as mutually exclusive approaches:1) The camera script blocks USB until it's ready to accept downloads, then switches to play, unblocks USB, waits for download to complete. The PC detects this because it sees the camera device show up.2) The script makes the camera think USB is always present, allowing it to stay in rec mode when USB shows up for real.
as for mutually exclusive, timesharing does mean you do not use it at the same moment with what you wrote, something in this line might do it i think:1)The camera script blocks USB and moves or stays in record until set time2)At set time, the camera goes to play, unblocks, sets usb always present, moves back to record when pc is connected or when wait time is exceeded (no pc active)
i am afraid that a disconnection of the 5v when in #2 would be a risk....
since you stated i should not plug in the usb when in record mode.
FWIW, I used the attached script for some quick testing on elph130. Using it to call usb_force_active and switch to rec without a USB cable, then plugging in the cable and connecting with chdkptp seems to work fine.
-tested the script and it works as long as the cam is in play without the lens extended.-if the cam is in record, moves to play (at that point the lens is still extended) and then start the script, the cam stays in play and finishes the script.
i did not find set_lens_retract(0) or something to add when the lens is extended like activate_sensor(). is there a way to do either?
because this might pose a small problem, since i start the cam in record to position it before i start the shoot.
new usbtest works, but doesn't in SUIx...first sleep there has to be ~70 seconds
Started by jjudd General Help and Assistance on using CHDK stable releases
Started by flarg General Discussion and Assistance
Started by CanonBlue General Help and Assistance on using CHDK stable releases
Started by d10 General Discussion and Assistance
Started by danx88 Script Writing