UR Dashboard Server, Connection refused

I would like to use the dashboard server through python, however it says “connection refused”. Does anyone know a way to find the problem?

The code that I execute with python is the following and I have an Ethernet cable connected directly in the control box for which in my laptop I have made a wired-connection settings with manual IPv4 given the same ip address as below and submask of

import socket
import time

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("", 29999))

cmd = """popup("hello w")""" + "\n"

which results in this error:

    s.connect(("", 29999))
ConnectionRefusedError: [Errno 111] Connection refused

Have you tried pinging the robot IP address to check the connection?