Skip to content

External Python client cannot complete the NetworkTables handshake on SystemCore #171

@kalsing

Description

@kalsing

We are trying to use a Python script that worked in 2025 to send keyboard inputs through NetworkTables. With SystemCore we are not sure how external clients should connect, or if this is a limitation of SystemCore or our setup.

Current behavior: the client starts but does not complete the NT handshake and no entries appear on the robot side. Ping to the SystemCore IP succeeds.

The python script we are running is the following:

import networktables as networkTablesCore
import keyboard
import time
from threading import Timer

def main():
    def release_key(key_name: str) -> None:
        print(f"Sending: {key_name} -> {False}")
        table.putBoolean(key_name, False)

    def timed_keypress(key_name: str, press_time: float) -> None:
        print(f"Sending: {key_name} -> {True}")
        table.putBoolean(key_name, True)
        timer = Timer(press_time, release_key, [key_name])
        timer.start()

    def on_action(event: keyboard.KeyboardEvent):
        if (event.name == "/"):
            return
        value = event.event_type == keyboard.KEY_DOWN
        if value:
            key_name = "numpad" + event.name if event.is_keypad else event.name.lower()
            timed_keypress(key_name, 0.100)

    networkTables = networkTablesCore.NetworkTablesInstance.getDefault()

    print("Setting up NetworkTables client")
    networkTables.startClient("KeyboardToNT")
    networkTables.setServer("10.11.56.2")
    networkTables.startDSClient()

    print("Waiting for connection to NetworkTables server...")
    while not networkTables.isConnected():
        time.sleep(0.1)

    print("Connected!")
    table = networkTables.getTable("OperatorController")

    keyboard.hook(lambda e: on_action(e))
    keyboard.wait()

if __name__ == '__main__':
    main()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions