Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UDP not giving data in Teleplot #39

Open
AmberElferink opened this issue Nov 22, 2024 · 1 comment
Open

UDP not giving data in Teleplot #39

AmberElferink opened this issue Nov 22, 2024 · 1 comment

Comments

@AmberElferink
Copy link

AmberElferink commented Nov 22, 2024

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
Copy link
Author

AmberElferink commented Nov 23, 2024

I think this is because I was using Serial communication before. After restarting my computer it did work. So removing the serial port from the Teleplot menu is not enough.
If you just start Teleplot without at any point having connected to Serial, it shows the play button top right. Clicking that gives the data as expected while running the python script.

And that only seems to work within the same window the python script is running. A second VSCode running with Teleplot will not show the play button.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant