teleplot icon indicating copy to clipboard operation
teleplot copied to clipboard

UDP not giving data in Teleplot

Open AmberElferink opened this issue 1 year ago • 1 comments

I cannot seem UDP plotting to work on teleplot, even running the basic python example. image

  • I'm using the default python example, literal copy paste:
  • Run it
  • Expectation: see sine/cosine plotted in teleplot
  • Behaviour: Nothing shows up in the teleplot screen, even if adding the local address + port manually.
  • Is there something else I have to enable to get it working?

default code I'm running

import socket
import math
import time

teleplotAddr = ("127.0.0.1",47269)
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

def sendTelemetry(name, value):
    now = time.time() * 1000
    msg = name+":"+str(now)+":"+str(value)+"|g"
    sock.sendto(msg.encode(), teleplotAddr)

i=0
while i < 1000:
    
    sendTelemetry("sin", math.sin(i))
    sendTelemetry("cos", math.cos(i))

    i+=0.1
    time.sleep(0.01)

AmberElferink avatar Nov 22 '24 14:11 AmberElferink