moved variables for baudrate and packet_len

This commit is contained in:
Paul 2024-01-09 10:21:51 +01:00
parent 82836a4ea3
commit e99a7e2012
1 changed files with 3 additions and 3 deletions

View File

@ -15,6 +15,9 @@ rfm = adafruit_rfm9x.RFM9x(spi, CS, RESET, 868.0, baudrate=20000000)
addr = '/tmp/rfmtty'
addr_client = '/tmp/rfmtty_client'
baudrate = 115200
packet_len = 251
cmd=['/usr/bin/socat','-d','-d','PTY,link=%s,raw,echo=0' %
addr, 'PTY,link=%s,raw,echo=0' % addr_client]
socat_proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@ -46,9 +49,6 @@ def serial_port_writer(ser, rfm):
ser.write(packet)
baudrate = 115200
packet_len = 251
reader_thread = threading.Thread(target=serial_port_reader, args=(ser,rfm), daemon=True)
reader_thread.start()
writer_thread = threading.Thread(target=serial_port_writer, args=(ser,rfm), daemon=True)