Update dtmf_aprs_cc.py try around stdin read for UTF-8 issue

pacsat-v2.2-tlm3
Alan Johnston 4 weeks ago committed by GitHub
parent 11045fce4a
commit 66d2dc3471
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -18,13 +18,14 @@ if __name__ == "__main__":
if ('d' == sys.argv[1]): if ('d' == sys.argv[1]):
debug_mode = True debug_mode = True
try:
for line in sys.stdin: for line in sys.stdin:
# if (debug_mode): # if (debug_mode):
print(line, end =" ") print(line, end =" ")
logging.warning(line) logging.warning(line)
# if '^c' == line.rstrip(): # if '^c' == line.rstrip():
# break # break
if ((line.find("MODE=a")) > 0): if ((line.find("MODE=a")) > 0):
system("echo '\nAPRS Mode!!\n'") system("echo '\nAPRS Mode!!\n'")
@ -80,7 +81,7 @@ if __name__ == "__main__":
system("echo '\nTransmit Commands Mode!!\n'") system("echo '\nTransmit Commands Mode!!\n'")
mode = 'n' mode = 'n'
change_mode = True change_mode = True
# Currently, C2C does not support Repeater mode e # Currently, C2C does not support Repeater mode e
if ((line.find("MODE=o")) > 0): if ((line.find("MODE=o")) > 0):
system("echo '\nBeacon Mode toggle!!\n'") system("echo '\nBeacon Mode toggle!!\n'")
mode = 'o' mode = 'o'
@ -186,14 +187,15 @@ if __name__ == "__main__":
GPIO.output(txLed, 0) GPIO.output(txLed, 0)
GPIO.output(powerPin, 0) GPIO.output(powerPin, 0)
system("sudo systemctl stop rpitx") system("sudo systemctl stop rpitx")
# system("sudo systemctl stop cubesatsim") # system("sudo systemctl stop cubesatsim")
print("\n/home/pi/CubeSatSim/config -" + mode) print("\n/home/pi/CubeSatSim/config -" + mode)
system("/home/pi/CubeSatSim/config -" + mode) system("/home/pi/CubeSatSim/config -" + mode)
change_mode = False change_mode = False
except:
print("Error reading line (probably due to UTF-8 issue)")
print("Waiting 5 seconds to allow unplug and plug of soundcard") print("Waiting 5 seconds to allow unplug and plug of soundcard")
sleep(5) sleep(5)
print("Done") print("Done")

Loading…
Cancel
Save

Powered by TurnKey Linux.