From c96c11d2b799801541741bf78c831aeead8a2773 Mon Sep 17 00:00:00 2001 From: iximeow Date: Fri, 14 Aug 2020 20:20:44 -0700 Subject: update qhy367c firmware loader --- load_firmware.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'load_firmware.py') 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) -- cgit v1.1