Skip to content

fix(ptz): support VISCA over UDP - #156

Open
iibaranov-IG wants to merge 1 commit into
AutoPTZ:mainfrom
iibaranov-IG:fix/155-visca-udp
Open

iibaranov-IG wants to merge 1 commit into
AutoPTZ:mainfrom
iibaranov-IG:fix/155-visca-udp

Conversation

@iibaranov-IG

Copy link
Copy Markdown

What & why

VISCA-IP currently opens only a TCP connection, so cameras such as the Vaddio RoboSHOT 20 UHD in #155 cannot receive PTZ commands on their UDP control port. This adds an explicit TCP/UDP selector to the camera's Advanced PTZ settings while keeping TCP as the default for existing configurations.

Closes #155.

How

  • persist ptz.visca_transport as tcp or udp
  • create a connected datagram socket for UDP so commands and replies stay scoped to one camera
  • preserve complete Sony-framed UDP datagrams when parsing inquiry replies
  • rebuild the live PTZ backend when the transport changes
  • keep the existing TCP connection and reconnect behavior unchanged

The issue reporter can validate this on the Vaddio by selecting visca_ip, entering the camera address and port, and choosing udp under Advanced PTZ settings.

Checklist

  • focused Ruff lint and formatting checks pass
  • strict mypy check for autoptz/config/ passes
  • 170 targeted PTZ, config, reconnect, stop-on-loss, and UI persistence tests pass
  • full repository test suite and self-test (left to CI; the local environment does not include the full ML dependency set)
  • README updated for TCP/UDP support

Testing

Verified on Python 3.12 with fake TCP and UDP sockets. Tests assert UDP socket creation, peer selection, command bytes, whole-datagram Sony reply parsing, TCP default compatibility, factory propagation, UI persistence, reconnect behavior, stop-on-loss behavior, and config validation. Hardware validation on the reporter's Vaddio remains required.

@avicambulos

Copy link
Copy Markdown

In this case, What is required to test it? I try to use just this Fix, but I couldn't manage to install it via Python on my Windows P

@iibaranov-IG

Copy link
Copy Markdown
Author

Thanks for checking it. This PR is not in a published package yet, so please run it from the PR branch rather than installing the current release from PyPI.

On Windows with Python 3.12+:

git clone --branch fix/155-visca-udp https://github.com/iibaranov-IG/autoptz.git
cd autoptz
py -3.12 -m venv .venv
.\.venv\Scripts\Activate.ps1
python tools/install.py --editable
python -m autoptz

If PowerShell blocks activation, run Set-ExecutionPolicy -Scope Process Bypass once in that terminal, then repeat the activation command.

To test the change:

  1. Open the camera Properties panel.
  2. Set the PTZ backend to visca_ip; enter the camera IP address and its VISCA UDP port from the Vaddio documentation/configuration.
  3. Under Advanced PTZ, change VISCA transport from the default tcp to udp, save, and reopen the panel once to confirm that the value persisted.
  4. Exercise pan, tilt, zoom, stop, and one inquiry/status action if available.

Please let me know the Vaddio model/firmware, UDP port (you can redact the IP address), whether each control moved the camera, and any log lines mentioning udp:// or errors. That will be enough to confirm the hardware path or identify the next adjustment.

Thanks again — your Vaddio setup is exactly the hardware case this PR is meant to cover.

@avicambulos

Copy link
Copy Markdown

Okay, I managed to Install it and Test it,

I have the following Outcome.

image

It shows that is connected but it is showing it as Raw Input, the Software connects with the camera and it sends data but the camera does not move and i think it is because of the data it is sending

This is one that works, sending manual instructions to the camera via (Through Vmix), The camara Replies back, I think this is part of the Communication.

image

And this one is from this software, The instructions sent for the same command are different.

image

The length of the data is different, possibly because is using RAW mode instead of the normal Input.

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

Successfully merging this pull request may close these issues.

VISCA Over IP Works over TCP, Excluding PTZ Cameras that work over UDP

2 participants