diff options
-rw-r--r-- | load_firmware.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/load_firmware.py b/load_firmware.py index 171e613..1e3015f 100644 --- a/load_firmware.py +++ b/load_firmware.py @@ -1,6 +1,7 @@ import sys import os import subprocess +import time def get_path(dev_id): if len(dev_id) != 9: @@ -29,11 +30,13 @@ camera_path = get_path("1618:c367") if camera_path == None: print("couldn't find the camera, firmware may have been loaded already?") - sys.exit(0) + sys.exit(1) fix_perms(camera_path) -fw_cmd = "./fxload -t fx3 -I firmware/qhy/{} -D {}".format( +fxload_binary = "./sdks/LINUX_X64_qhyccd_V20190628_0/sbin/fxload" +fw_cmd = "{} -t fx3 -I firmware/qhy/{} -D {}".format( + fxload_binary, "QHY367.img", camera_path ) @@ -41,12 +44,16 @@ fw_cmd = "./fxload -t fx3 -I firmware/qhy/{} -D {}".format( print(fw_cmd) fw_load = subprocess.check_output([ - "./fxload", '-t', 'fx3', '-I', 'firmware/qhy/{}'.format("QHY367.img"), '-D', camera_path]) + fxload_binary, '-t', 'fx3', '-I', 'firmware/qhy/{}'.format("QHY367.img"), '-D', camera_path]) print(fw_load) time.sleep(1) -path = get_path("1618:c367") +path = get_path("1618:c368") + +if path == None: + print("couldn't find camera id after loading firmware. did the camera die?") + sys.exit(1) fix_perms(path) |