LoRa_APRS_Tracker/test/send_nmea.py
Peter Buchegger c63180d26c add test data
2021-03-07 23:09:00 +01:00

21 lines
No EOL
345 B
Python
Executable file

#!/bin/python
import time
import sys
import serial
f = open(sys.argv[1], "r")
ser = serial.Serial(sys.argv[2], 115200, timeout=0)
sleep_count = 0
for x in f:
s = ser.read(100)
if s:
print(s.decode(), end='')
sleep_count = sleep_count + 1
ser.write(x.encode())
if sleep_count > 2:
time.sleep(1)
sleep_count = 0
ser.close()
f.close()