added baudrate setting
This commit is contained in:
parent
a72aa16333
commit
6b8187c2a4
6
main.py
6
main.py
|
@ -14,13 +14,13 @@ rfm = adafruit_rfm9x.RFM9x(spi, CS, RESET, 868.0, baudrate=20000000)
|
|||
|
||||
addr = '/tmp/rfmtty'
|
||||
addr_client = '/tmp/rfmtty_client'
|
||||
baudrate = 115200
|
||||
|
||||
cmd=['/usr/bin/socat','-d','-d','PTY,link=%s,raw,echo=0' %
|
||||
addr, 'PTY,link=%s,raw,echo=0' % addr_client]
|
||||
cmd=['/usr/bin/socat','-d','-d','PTY,link=%s,rawer,baud=%d' %(addr, baudrate), 'PTY,link=%s,rawer,baud=%d' %(addr_client, baudrate)]
|
||||
socat_proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
time.sleep(1)
|
||||
|
||||
ser = serial.serial_for_url(addr)
|
||||
ser = serial.Serial(addr, baudrate=baudrate)
|
||||
|
||||
packet_len = 120
|
||||
while True:
|
||||
|
|
Loading…
Reference in New Issue