Greetings,
For some time I've been searching for CHDK remote control method to satisfy my astrophotography interest, without having to stand outside in the cold and babysit the camera, yet have the ability to change camera settings. I have an Adruino controlled barn door tracker (a simple equatorial mount) that provides about 2-hours of pretty close tracking when properly aligned, but it's the numb fingers (cold outside) and constant bumping of the camera that's been bothering me. Using an Eye-Fi card helped a little, but I could only view the images and not be able to change the camera settings, since the cards will only transmit images, not receive any files. This changed recently, when I stumbled across a
discussion in which a bot was controlled using a Toshiba FlashAir SD card. To make a long story short, I have purchased one and used it successfully to remotely control my Canon S95 running CHDK. For those of you who are interested in this approach, you'll need a Toshiba FlashAir wireless SD card, I am using the 8GB class 6 model #
PFW008U-1ABW, along with the following scripts (as examples):
The following primary Lua script (called FLASHAIR.LUA) to be placed in A/CHDK/SCRIPTS:
--[[
@title FlashAir Remote
]]
repeat
f=loadfile('A/CHDK/SCRIPTS/SLAVE.LUA')
if not f then
print("loadfile failed.")
else
f()
end
sleep(1000)
until(false)
And secondary Lua script (called SLAVE.LUA) to be also placed in A/CHDK/SCRIPTS:
--[[
@title Remote Commands
]]
shoot()
-----------------------------------------------------------
NOTES: Below are couple issues I've ran into.
- For whatever reason, I have not had any luck loading the secondary (slave.lua) script, if the filename was alphabetically above the primary script.
- If additional commands will be added anywhere above the last comment line, the slave.lua script must have plenty of comment padding at the end, otherwise it will not be reloaded properly.
Once the camera is powered up, and network connection with the FlashAir card established, you can upload changes to slave.lua either via the web interface or shell (command line in Windows) using curl or wget (not tested), even if flashair.lua is already running. I have used the following Bash script (OS X 10.6.8 ) to upload slave.lua changes:
#!/bin/bash
#
# FlashAir upload script
#
if [ "$1" == "" ] || [ "$2" == "" ] || [ "$3" == "" ]; then
echo -e "\flashair-s95 - Upload files to FlashAir card\n\n Usage: flashair <FAIP> <UPDIR> <FILE>\n\n"
exit
fi
if [ ! -f $3 ]; then
echo "Unable to locate $PWD/$3. Aborting!!!"
exit
fi
echo "Changing upload path to $2"
curl http://$1/upload.cgi?UPDIR=$2
sleep 1
echo -e "\nUploading file $PWD/$3 to $1 ($2)..."
#curl -F file=@$3 -F submit=submit http://$1/upload.cgi
curl -F file=@$3 http://$1/upload.cgi
echo -e "\nDone."
Using the following syntax:
./flashair-s95 <FlashAirIP> /CHDK/SCRIPTS slave.lua
NOTES: Things to consider with FlashAir upload process.
Below are links to resources which may come in handy:
FlashAir Developers API Guidehttp://www.extrud3d.com/flashairEnjoy!