Initial working RTK base setup
This commit is contained in:
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env python3
|
||||
import time, serial
|
||||
|
||||
ZED_PORT = "/dev/serial/by-id/usb-u-blox_AG_-_www.u-blox.com_u-blox_GNSS_receiver-if00"
|
||||
ZED_BAUD = 115200
|
||||
|
||||
LORA_PORT = "/dev/serial/by-id/usb-1a86_USB_Serial-if00-port0"
|
||||
LORA_BAUD = 9600
|
||||
|
||||
READ_CHUNK = 4096
|
||||
|
||||
def main():
|
||||
zed = serial.Serial(ZED_PORT, ZED_BAUD, timeout=0.2)
|
||||
lora = serial.Serial(LORA_PORT, LORA_BAUD, timeout=0.2)
|
||||
try:
|
||||
last = time.time()
|
||||
n_in = 0
|
||||
while True:
|
||||
data = zed.read(READ_CHUNK)
|
||||
if data:
|
||||
lora.write(data)
|
||||
n_in += len(data)
|
||||
else:
|
||||
time.sleep(0.005)
|
||||
|
||||
# einfache Durchsatzanzeige alle 5s
|
||||
now = time.time()
|
||||
if now - last >= 5:
|
||||
print(f"rtcm forwarded: {n_in/ (now-last):.0f} B/s")
|
||||
last = now
|
||||
n_in = 0
|
||||
finally:
|
||||
try: zed.close()
|
||||
except: pass
|
||||
try: lora.close()
|
||||
except: pass
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user