No data from data field inside of Websocket Client module

 

Hello,

We're having some difficulties with the data field inside of the Websocket Client module. We are able to connect to the camera Websocket outside of Aximmetry, in Postman using

{"type": "request", data: {"action": "subscribe","properties": ["/lens/zoom"]}}

however when applying this logic inside of the Websocket Client module we still fail to receive any data. Even with the recommended ["eventname", mydata] format. The log underneath shows that the connection was successful, we just can't get any data.

Kind Regards,

Uwe


No data from data field inside of Websocket Client module

   uwewiegmann

 
Profile Image
Eifert@Aximmetry
  -  

Hi,

You should connect the Websocket Client module to an output to make it always active.
Without such a connection, the module will be active only when you click Send and will turn inactive after that, hence it won't be able to receive the response. For example, consider using a Text Peeker module to create an output on a Preview panel and forcing the module to be active all the time:
No data from data field inside of Websocket Client module

For more information about when a module is active, visit: https://aximmetry.com/learn/virtual-production-workflow/scripting-in-aximmetry/flow-editor/module/#module-execution

Additionally, you can find more details about the Websocket Client module here: https://aximmetry.com/learn/virtual-production-workflow/setting-up-inputs-outputs-for-virtual-production/external-controllers/using-websocket-and-http-in-aximmetry/#websocket-client

Warmest regards,

 
Profile Image
uwewiegmann
  -  

Hello,

Thanks for getting back to me, unfortunately still experiencing issues here. I believe it could be to do with what we need to enter into the Data field, could that be the case? Please see below. As mentioned last time, I can connect to the websocket using Postman without any issues. The URL and Command is laid out in a comment. What does Aximmetry need for this to work?

No data from data field inside of Websocket Client module


 
Profile Image
Eifert@Aximmetry
  -  

Hi,

I haven't checked the data of the message properly before my previous post. After reviewing the data, I see you're attempting to use Blackmagic's Camera Control API.

The ["eventname", mydata] format is specific to the Socket.IO library, which operates on an event-based structure. The Blackmagic Camera Control API does not use Socket.IO, so you can not use this format.

Compared to the Postman implementation, I think you'll need to omit the type declaration and data tag.
Instead of using this format:
{"type": "request", "data": {"action": "subscribe", "properties": ["/lens/zoom"]}}
You should use this format for the Data pin of the Websocket Client module:
{"action": "subscribe", "properties": ["/lens/zoom"]}


Also, the API allows you to use HTTP Request, so you could do the following:

However, the image above was made for requesting focus, so you will need to rename things from focus to zoom.
The URL address with your camera pointing to the zoom will be likely this: https://Studio-Camera-4K-Pro.local/control/api/v1/lens/zoom

Warmest regards,

 
Profile Image
uwewiegmann
  -  

Hello,

Thanks for you response, firstly HTTP request is not suitable for our needs as the update interval is too slow for what we require. I would really like to find a way to make the Websocket work through Aximmetry. We've tested over multiple devices, and problem still exists.

{"action": "subscribe", "properties": ["/lens/zoom"]}

According to Blackmagic Event Control API the above line should work, and does infact work through Postman. When converted to:

{

"type": "request",

"data": {

"action": "subscribe",

"properties": [

"/lens/zoom"

]

}

}

 

HTTP Request does work, just not suitable for our project. What is it about Aximmetry's Websocket module that's different here, can you provide me with more information please?

 
Profile Image
Eifert@Aximmetry
  -  

Hi,

I am not sure what is going on. I guess {"type": "request", "data": {"action": "subscribe", "properties": ["/lens/zoom"]}} should work as Data.
However, here you had the data in that text without the "" quotation marks, which probably was causing the problem:

Additionally, I assume you can get the list of WebSocket options by sending an HTTP request with GET /event/list to the camera. Could you  paste the response you received from that request here? It might provide some useful clues.
You can easily copy and paste the response by capturing it with the Text Block module and opening it with the Edit Text button:

Warmest regards,

 
Profile Image
uwewiegmann
  -  

Hello,

Thanks I've tried countless variations of {"type": "request", "data": {"action": "subscribe", "properties": ["/lens/zoom"]}} with and without quotes, brackets, etc. No luck. The event list from the Http Request was as follows: 


[

    "/audio/channel/0/available",

    "/audio/channel/0/input",

    "/audio/channel/0/level",

    "/audio/channel/0/lowCutFilter",

    "/audio/channel/0/padding",

    "/audio/channel/0/phantomPower",

    "/audio/channel/0/supportedInputs",

    "/audio/channel/1/available",

    "/audio/channel/1/input",

    "/audio/channel/1/level",

    "/audio/channel/1/lowCutFilter",

    "/audio/channel/1/padding",

    "/audio/channel/1/phantomPower",

    "/audio/channel/1/supportedInputs",

    "/camera/id",

    "/clips/list",

    "/colorCorrection/color",

    "/colorCorrection/contrast",

    "/colorCorrection/gain",

    "/colorCorrection/gamma",

    "/colorCorrection/lift",

    "/colorCorrection/lumaContribution",

    "/colorCorrection/offset",

    "/lens/focus",

    "/lens/iris",

    "/lens/zoom",

    "/media/active",

    "/media/workingset",

    "/presets",

    "/presets/active",

    "/system",

    "/system/format",

    "/timelines/0",

    "/transports/0",

    "/transports/0/play",

    "/transports/0/playback",

    "/transports/0/record",

    "/transports/0/stop",

    "/transports/0/timecode",

    "/transports/0/timecode/source",

    "/video/autoExposure",

    "/video/gain",

    "/video/iso",

    "/video/shutter",

    "/video/whiteBalance",

    "/video/whiteBalanceTint"

]

One other thing I'd like point out in case it's worth mentioning. Postman applies Headers automatically to the request - does Aximmetry also do this? Could you elaborate specifically how this Websocket module works? Screen shot of Postman below. Thanks

No data from data field inside of Websocket Client module

 
Profile Image
Eifert@Aximmetry
  -  

Hi,

Sadly, that event list doesn't give me any clue on what is needed.

You're probably right that Postman is automatically applying a header that is necessary. To identify which one, you could try disabling the headers one by one to see which is required.
Alternatively, you can use a tool like Wireshark to capture and compare the raw data that both Postman and Aximmetry are sending. This might shed some light on the differences.

Warmest regards,

;