kopia lustrzana https://github.com/projecthorus/wenet
Robustness improvements to ssdv_upload.py
rodzic
b7492da6ca
commit
69976b48d8
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
#
|
||||
|
||||
import base64, requests, datetime, os, glob, time
|
||||
import base64, requests, datetime, os, glob, time, traceback
|
||||
|
||||
ssdv_url = "http://ssdv.habhub.org/api/v0/packets"
|
||||
|
||||
|
@ -84,6 +84,7 @@ def ssdv_dir_watcher(glob_string="./rx_images/*.bin", check_time = 0.5, callsign
|
|||
print("Starting directory watch...")
|
||||
|
||||
while True:
|
||||
try:
|
||||
time.sleep(check_time)
|
||||
|
||||
# Check directory again.
|
||||
|
@ -101,6 +102,12 @@ def ssdv_dir_watcher(glob_string="./rx_images/*.bin", check_time = 0.5, callsign
|
|||
ssdv_upload_file(filename,callsign=callsign,blocksize=256)
|
||||
|
||||
rx_images = rx_images_temp
|
||||
except KeyboardInterrupt:
|
||||
sys.exit(0)
|
||||
except:
|
||||
traceback.print_exc()
|
||||
continue
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -116,4 +123,5 @@ if __name__ == '__main__':
|
|||
|
||||
print("Using callsign: %s" % callsign)
|
||||
|
||||
|
||||
ssdv_dir_watcher(callsign=callsign)
|
Ładowanie…
Reference in New Issue