Jump to content

Welcome, Guest!

Be a part of CinemaVision today! Once registered and logged in, you will have access to public chat and your own private messenger, you can view and contribute guides, collaborate on the forums, review downloads, give reputation to your fellow members, contribute content and so much more. Registering is quick and completely free, so what are you waiting for?
   Sign In    Sign Up

Become a RedCarpet Club Member Today!

Lorem ipsum dolor sit amet, sea eu causae aperiri periculis, iusto affert soleat an sea, soluta petentium inciderint nec no. Dolorum reprimique ullamcorper sed ad. Ei quo malorum singulis, tota mundi feugait ut pro. Choro utamur inimicus ex sea. Tota dicit te usu. Sea ad erant possim reformidans. An modus detraxit postulant vel. Per no habeo ludus qualisque. Vix legere singulis legendos et, an cum eius soluta accumsan. Facer discere no nec.
   Join Now

Download the Kodi Add-on Today!

Lorem ipsum dolor sit amet, sea eu causae aperiri periculis, iusto affert soleat an sea, soluta petentium inciderint nec no. Dolorum reprimique ullamcorper sed ad. Ei quo malorum singulis, tota mundi feugait ut pro. Choro utamur inimicus ex sea. Tota dicit te usu. Sea ad erant possim reformidans. An modus detraxit postulant vel. Per no habeo ludus qualisque. Vix legere singulis legendos et, an cum eius soluta accumsan. Facer discere no nec.
  • 0
muntedpissmole

Sending UDP Packets

Question

Hi guys,

Just got CinemaVision up and running in my home cinema and wow, what a product. Just a question regarding sending a UDP packet called by an action. I have a Clipsal C-Bus touchscreen that is capable of triggering lighting scenes based on the data received in a UDP packet on a user-defined port.

Using packet sender I can successfully send the appropriate ascii command and the relevant lighting scene will activate. So what I am hoping you guys can tell me is how to setup sending ascii text to a port at an IP address as a script, that way I can call it using an action in my sequence. For example I want to trigger a "trailer lights" scene when the trailers start to roll and then an "all off" scene when the feature begins.

Cheers guys!

  • Upvote 1

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 1
On 9/17/2016 at 5:34 PM, muntedpissmole said:

Hi guys,

Just got CinemaVision up and running in my home cinema and wow, what a product. Just a question regarding sending a UDP packet called by an action. I have a Clipsal C-Bus touchscreen that is capable of triggering lighting scenes based on the data received in a UDP packet on a user-defined port.

Using packet sender I can successfully send the appropriate ascii command and the relevant lighting scene will activate. So what I am hoping you guys can tell me is how to setup sending ascii text to a port at an IP address as a script, that way I can call it using an action in my sequence. For example I want to trigger a "trailer lights" scene when the trailers start to roll and then an "all off" scene when the feature begins.

Cheers guys!

Hey, thanks! What you'll have to do is create a python script and then call that with an Action. I found this on the internet that hopefully points you in the right direction:

Quote

With Python, you need to convert your string to raw bytes. You would have to encode the string as bytes. Over the network you need to send bytes and not characters. 

Try creating a Python script, and putting this in it, where the IP, port and message are what you want to send:

print("UDP target IP:", UDP_IP)
print("UDP target port:", UDP_PORT)
print("message:", MESSAGE)

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # UDP
sock.sendto(bytes(MESSAGE, "utf-8"), (UDP_IP, UDP_PORT))

Then create an action file that looks like this:

python://<Path_to_script>\<Script_name>.py

You can also pass arguments from Actions to the Python script if you want to do that instead. You'll have to set the Python script up to accept those arguments. Here's an example of what that Action looks like:

python://<Path_to_script>\<Script_name>.py
argument1
argument2
argument3

In theory, you could use that to create one Python script that you call and pass the IP, port, and message to, which then sends it to the appropriate device.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

About Us

CinemaVision began in 2014 as a collaboration to create content for use with your home theater, offering movie trivia slides and video bumpers. It has since grown to be THE PREMIER WAY to create and customize your preshow experience. Download the CinemaVision add-on for Kodi today from the official Kodi repository, and easily create a sequence of trivia, videos, trailers, home automation triggers and more that will bring the experience of a movie theater straight to your screen!

×

Important Information

By using this site, you agree to our Guidelines and Terms of Use.