bentraje
March 19, 2024 02:46:55
Hi,
I'm trying to connect real time data in Houdini through websockets.
There's no websocket node in Houdini unlike in Touch Designer.
The closest I can get is the mocapstream node.
I'm able to connect through it but it errors out because I don't know what data format it accepts.
By any chance, does anyone have a sample data of it or at least what it looks like?
A json format with the respective values and keys?
edward
March 19, 2024 12:24:17
What data are you sending it? If it's some custom thing, then "Raw UDP Data" is the only option here:
(
https://www.sidefx.com/docs/houdini/nodes/sop/kinefx--mocapstream.html [
www.sidefx.com] )
Raw UDP Data
This can be useful for prototyping streaming from new devices. All it does is start a UDP server on the given port, and output the most recently received packet’s contents in the data detail attribute. This is a common protocol for mocap data, you could wire this into a python SOP to parse the data and output a skeleton.
Note that the node will likely recook slower than you are receiving the packets so this approach doesn’t work if you need to read every packet, or if there’s state to keep track of across multiple packets. To accomplish this, you can create a C++ plugin.
bentraje
March 20, 2024 12:02:22
edward
What data are you sending it? If it's some custom thing, then "Raw UDP Data" is the only option here:
(https://www.sidefx.com/docs/houdini/nodes/sop/kinefx--mocapstream.html [www.sidefx.com] )
Raw UDP Data
Thanks for the response.
My bad on not specifying it. The above screenshot already uses RAW UDP Data but it still gives an "Error Receiving Data". Presumably because the data format is not as expected.
How do I go about it?
edward
March 20, 2024 12:05:07
Are you sending back data? The port that you're connecting to needs to be on UDP. There's no "protocol" here other than UDP transport.
bentraje
March 20, 2024 12:44:00
No, I'm not sending data back.
Just receiving data from the websockets.
RE: RAW UDP DATA.
Okay. I messed this one up too. Sorry about that.
I'm using the RAW TCP Data. I thought they were the same as they were next to each other.
Just to confirm it's not possible to connect to TCP Data? Only in UDP Data.
I'm new to this so I'm not sure how to set-up a UDP Data.
All websockets tutorial seems to point out to TCP Data (i.e. requires a local host and a port).
With the UDP data, it only requires port. and when I tried to input the port on my server, it doesn't connect (i.e. waiting for connection)
edward
March 20, 2024 13:37:54
Sorry, the Mocap Stream also has the Raw TCP option. Websockets is this whole thing on top of TCP that requires handshaking, which the Raw TCP option doesn't support (it can only receive from the device, not send to it).
I think that if you need Websockets, then it's either your own Python SOP (with Maintain State enabled) using some python websocket client to parse it. Or for speed, a C++ Mocap Stream plugin.
bentraje
March 20, 2024 15:53:42
Hi Edward.
Gotcha. Thanks for the confirmation and clarification. At least I know I am at a dead end.
I'll just go ahead and try it with a Python SOP (maintain state).
Thanks again. Have a great day ahead!