Update transmit.py repeater mode shared_mic dsnoop

fc-mic
Alan Johnston 7 months ago committed by GitHub
parent b064d0bcad
commit 33e1a3fdc9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -825,10 +825,6 @@ if __name__ == "__main__":
while True: while True:
if (GPIO.input(squelch) == False) and (command_tx == True): if (GPIO.input(squelch) == False) and (command_tx == True):
print("Carrier detected, starting repeater") print("Carrier detected, starting repeater")
if (no_command == False):
sleep(3) # wait 3 seconds before repeater mode in case it is C2C command
print("stopping C2C")
system("sudo systemctl stop command")
GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4 GPIO.setmode(GPIO.BCM) # added to make Tx LED work on Pi Zero 2 and Pi 4
GPIO.setup(txLed, GPIO.OUT) GPIO.setup(txLed, GPIO.OUT)
output(txLed, txLedOn) output(txLed, txLedOn)
@ -837,7 +833,7 @@ if __name__ == "__main__":
system("sudo nc -l 8011 | csdr convert_i16_f | csdr gain_ff 16000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f " + tx + "e3 > /dev/null 2>&1 &") system("sudo nc -l 8011 | csdr convert_i16_f | csdr gain_ff 16000 | csdr convert_f_samplerf 20833 | sudo rpitx -i- -m RF -f " + tx + "e3 > /dev/null 2>&1 &")
sleep(0.5) sleep(0.5)
# system("sudo arecord -D plughw:1 -r48000 -fS16_LE -c1 | nc localhost 8011 &") # system("sudo arecord -D plughw:1 -r48000 -fS16_LE -c1 | nc localhost 8011 &")
system("sudo arecord -D plughw:CARD=Device,DEV=0 -r48000 -fS16_LE -c1 | nc localhost 8011 &") system("sudo arecord -D shared_mic -r48000 -fS16_LE -c1 | nc localhost 8011 &")
# GPIO.output(powerPin, 1) # GPIO.output(powerPin, 1)
# sleep(0.5) # sleep(0.5)
# GPIO.output(powerPin, 0) # GPIO.output(powerPin, 0)
@ -852,12 +848,7 @@ if __name__ == "__main__":
system("sudo /etc/init.d/alsa-utils stop") system("sudo /etc/init.d/alsa-utils stop")
system("sudo /etc/init.d/alsa-utils start") system("sudo /etc/init.d/alsa-utils start")
print("Finished resetting audio") print("Finished resetting audio")
if (no_command == False): print("Ready to detect carrier")
system("sudo systemctl restart command")
print("restarting C2C")
# print("Waiting for C2C")
# sleep(4) # wait 4 seconds for a C2C command
print("Ready to detect carrier")
else: else:
print("FSK") print("FSK")

Loading…
Cancel
Save

Powered by TurnKey Linux.