Advice requested: Advice: Best way to integrate PTZ ONVIF camera into Ignition 8.3 (Vision)

Hi everyone

I’m integrating PTZ cameras into an Ignition 8.3 (Vision) system and I need advice which development approach to choose.

  • PTZ control (move, goto preset)

  • snapshot capture (later stored in MongoDB)

  • scheduled timelapse (camera moves to preset → capture → back)

I tried calling the camera’s ONVIF endpoints directly from Ignition using system.net.httpGet / httpPost, but I always get 401 Unauthorized. ONVIF requires WS-Security (UsernameToken, PasswordDigest), which is hard to implement in Ignition’s Jython scripting.

So I see two possible approaches:

Option A — Direct in Ignition (Jython/SOAP):

  • Build WS-Security SOAP requests in scripts, post them to the camera.

  • Pros: single environment, simpler deployment.

  • Cons: implementing WS-Security and parsing SOAP in Jython is difficult, harder to maintain.
    :backhand_index_pointing_right: If you recommend this, could you share a tested Jython example for PTZ (e.g., GotoPreset with UsernameToken)?

Option B — External Python middleware (Flask + ONVIF library):

  • Middleware handles ONVIF via a proper library, exposes simple REST endpoints for Ignition.

  • Pros: easier to develop & maintain, good for future MongoDB/timelapse features.

  • Cons: adds another service to deploy.
    :backhand_index_pointing_right: If you recommend this, any example Flask + ONVIF snippets or best practices for connecting Ignition to it?

Question: For a project that will later need MongoDB snapshot/timelapse storage, which approach do you recommend for long-term development?

Thanks in advance for any advice or code samples!

You're getting very close to the line where it would be better to build a PTZ/ONVIF driver module in Java that exposes all the functions as Ignition Scripting Functions that you then use as you need inside Ignition.

I'm not really sure why/if you meant to put this in the Module Development subcategory - it doesn't sound like that's the way you're leaning.

Never use system.net.httpGet/httpPost, always use system.net.httpClient.
There are some examples floating around this forum of doing digest auth via scripting, e.g:

Tangential, but MongoDB seems a very strange choice for binary file storage. NoSQL gives you no benefits if you're storing well formatted binary image snapshots.

3 Likes