so I can't tell if when it returns nil for status, does that mean the script failed to run on the camera or the script did run and returned an error code? What I would do next depends on the answer to that question.
I think preshooting error comes from the code starting at line 46
status, bv, try_focus, i = con:execwait_pcall[[
All the _pcall functions just wrap the named function in a
pcall, so the exceptions are caught and returned as status.
So execwait_pcall returns false if the underlying execwait threw an error. This could happen due to a connection error, or lua errors in the camera side code (compile, runtime, or explicit calls to error)
pcall returns any error message in the second return value on failure, so in the above code, you could see the specific error by changing the print to
print('*** *** *** Pre-shooting error: '..tostring(bv))
Regarding temperature:
@manoweb found the cameras got very hot because in the default settings, the sensor + live view are on all the time.
To avoid this, you can use the cameras auto screen off functionality.
In the canon menu, under power saving set
Auto power down OFF
Display off <10 sec>
Then in CHDK settings, you need to make sure "disable display off" is not enabled.
If the camera is not physically accessible, you can navigate the Canon menu using lvdumpimg and key presses (or live view GUI if you have a fast connection), and set the CHDK setting with set_config_value. I can provide more specific instructions if you have to do this.
If you do this, the camera will turn off the display (and sensor) after 10 seconds, and wake it up the next time the script issues a key press. set_lcd_display only turns of the display not the sensor, so it has little effect on temperature, but is still desirable to avoid internal reflections.
Very high temperatures could cause the camera to shut down or become unreliable, so this may be relevant to the other errors.