Skip to content

Instantly share code, notes, and snippets.

@vo
Created August 17, 2018 15:31
Show Gist options
  • Save vo/15af10ca61479a8949b0ae0588f28b85 to your computer and use it in GitHub Desktop.
Save vo/15af10ca61479a8949b0ae0588f28b85 to your computer and use it in GitHub Desktop.
basic replacement for telem_ctrl
#!/usr/bin/python
import socket
import sys
TELEM_DEST_HOST = '0.0.0.0'
TELEM_DEST_PORT = 14550
STM32_HOST = '127.0.0.1'
STM32_PORT = 5015
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind((TELEM_DEST_HOST, TELEM_DEST_PORT))
while True:
num_bytes = sock.recv_into(buf)
if num_bytes > 0:
sock.sendto(data, (STM32_HOST, STM32_PORT))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment