I see on the "CLI Quickstart" page that there is a command for downloading and downloading multiple files, but how exactly do I execute a command that takes everything on my camera and downloads it to a specified directory?
To download everything on the to /test, you could usemdl A/ /testNote the trailing / on the A/ is because the root directory in the canon OS is actually name "A/". For other directories, you would not use the trailing /, e.g. mdl CHDK/SCRIPTS my-script-backupWith either command, you can use -pretend to see what it would do.
or write output that is piped into chdkptp, so for example you start your program likeremote_program | chdkptp.shand then when your program sees the zoom button, it outputs something like=click('zoom_in')
#!/usr/bin/env python#it said /usr/bin/ env pythonimport sysfrom evdev import InputDevice, categorize, ecodes, KeyEventremote = InputDevice('/dev/input/event0')for event in remote.read_loop(): if event.type == ecodes.EV_KEY: keyevent = categorize(event) if keyevent.keystate == KeyEvent.key_down: if keyevent.keycode == 'KEY_B': #print "Zoom Out" sys.stdout.write('c') elif keyevent.keycode == 'KEY_F': print "Zoom In" elif keyevent.keycode == 'KEY_PLAYPAUSE': print "Start" elif keyevent.keycode == 'KEY_STOPCD': print "Stop"
What I don't understand is how to set up the pipe. Do I do this from the command line? I have tried this and get an error that says the command is not found (the picture I attached). I have Googled this issue and can't find anything. I feel like this is a very simple thing to set up, but can't. Again, I know this particular question is programming related, and not chdk related, but reyalp, you have been quick with your responses.
Try putting ./ in front of both file names in your command string. That tells Linux to look in the current directory for the files.
But now if I use the remote to press a button, nothing happens. And if I type something as if I were using the chdkptp.sh, nothing happens there either. Do I need to have the python program running separately?.. Apologies for stupidity.
#!/bin/bashecho verread fooecho help $foosleep 2echo quit
What you have set up seems like it should work, so there is probably some detail missing. You need to send a newline with each chdkptp command, e.g. sys.stdout.write('c\n')If not that, maybe python does some output buffering?
I thought maybe it could have to do with the fact that Python sends both a standard output and a standard error, and voila... the prompt actually gets a character
This is a mistake. If things are working correctly, you will not see the input sent by your python script. You see it because standard error is *not* being piped.Googling "python output buffering" suggests this may be your issue. For example, see https://unix.stackexchange.com/questions/182537/write-python-stdout-to-file-immediatelyhttp://stackoverflow.com/questions/107705/disable-output-bufferingThere's a lot of different answers there, but I'd try just calling sys.stdout.flush() after each write.
cd chdkptp-r735 && ./remote_function.py|./chdkptp.sh
Started by Barnacules
Started by Peterschnecke
Started by ernway
Completed and Working Scripts
Started by mrboop2
Started by phantom2041
General Discussion and Assistance