diff options
author | iximeow <me@iximeow.net> | 2020-08-14 20:20:44 -0700 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2020-08-14 20:20:44 -0700 |
commit | c96c11d2b799801541741bf78c831aeead8a2773 (patch) | |
tree | a71e5b1ec51940c79f665092acb15baf11513541 /load_firmware.py | |
parent | 889d89bc652682763a4b6021d988195a1d8acb84 (diff) |
update qhy367c firmware loader
Diffstat (limited to 'load_firmware.py')
-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) |