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!

   Join Now
  • 0
shifter

LightwaveRF script help

Question

Hi, I'm just starting out with cinemavsion and I'm trying to get it to control my lighting, i need to send the command: echo -ne "001,!R1D1FdP1" | nc -u -w1 192.168.0.14 9760

can any tell me how to setup an action file to do this please, I've tried the command:// option and calling it as a bash script but neither seem to work ?

Thanks

Share this post


Link to post
Share on other sites

16 answers to this question

Recommended Posts

  • 0
On 3/12/2016 at 5:01 AM, shifter said:

Hi, I'm just starting out with cinemavsion and I'm trying to get it to control my lighting, i need to send the command: echo -ne "001,!R1D1FdP1" | nc -u -w1 192.168.0.14 9760

can any tell me how to setup an action file to do this please, I've tried the command:// option and calling it as a bash script but neither seem to work ?

Thanks

I just requested the API documentation from JSJS Designs. Since I'm not real familiar with how their API works, I'm not sure how much help I can be. As soon as they send over the documentation I'll take a look at it and see what I can whip up.

Share this post


Link to post
Share on other sites
  • 0

Wow, thanks for the effort, wasn't expecting that ! I have some of the information already. The wifi link that controls the devices expects UDP packets to be sent as per my first post, i can use netcat to send what i need i just need cinema vision to allow me to send via the command line, which i thought it already could ?

Thanks for your time.

Share this post


Link to post
Share on other sites
  • 0
On 3/17/2016 at 3:30 AM, shifter said:

Wow, thanks for the effort, wasn't expecting that ! I have some of the information already. The wifi link that controls the devices expects UDP packets to be sent as per my first post, i can use netcat to send what i need i just need cinema vision to allow me to send via the command line, which i thought it already could ?

Thanks for your time.

No problem at all! We want everything to be super simple and clear cut, and the best way to do that is work with you all to figure out how all these solutions work and put up the files you'll need. I still haven't heard back from them, unfortunately. CinemaVision can absolutely send commands via command line. I didn't realize that was what you were looking for. :D

I spoke to our developer and what you'll need to do in this case, since you're piping to another command, is create a shell script and then call that shell script via a CinemaVision Action File. You'll want to create your shell script, then be sure to make it executable by running this command from the prompt:

chmod -x <script_name>.sh

Here's what we think you'll need in your shell script and Action File:

Shell Script

#!/bin/sh
echo -ne "001,!R1D1FdP1" | nc -u -w1 192.168.0.14 9760

Action File

# This example will run a shell script in Linux
command://<script_name>.sh

You can put the shell script anywhere, but I think if you put it in the same directory as the Action File you don't need to give it a path to the script. Hopefully, that gets you going. Let me know how it goes!

Share this post


Link to post
Share on other sites
  • 0

I have tried your above suggestions but I think there maybe a problem with openelec, im running the dev builds and for some reason if i try and run a script i get this error

OpenELEC:~ # ./pause.sh
-sh: ./pause.sh: not found

its in the same folder and has 777 permissions so im kinda stumped ? Im a linux noob which isn't helping ;)

pause.sh contains:

#!/bin/sh
echo -ne "001,!R1D1FdP1" | nc -u -w1 192.168.0.14 9760

 

Share this post


Link to post
Share on other sites
  • 0

Is this OpenElec on a Pi or something else?  I don't know if this is going to matter but I'm curious.  Also the only thing I can think of is you have ./pause.sh is it not ~/pause.sh ?  

Share this post


Link to post
Share on other sites
  • 0

Ok, after some more testing i have resolved my script issue, blame bloody windows file formatting !  It is all working as expected now so thanks for your help :)

  • Upvote 2

Share this post


Link to post
Share on other sites
  • 0
On April 6, 2016 at 0:34 PM, shifter said:

Ok, after some more testing i have resolved my script issue, blame bloody windows file formatting !  It is all working as expected now so thanks for your help :)

Excellent! Would you mind sharing the process, scripts and Action Files that worked for you?

  • Upvote 1

Share this post


Link to post
Share on other sites
  • 0

Just in case anyone else needs the info here it is.

first off you need to register your kodi box with the wifi receiver

echo -ne "666,\!F*p" | nc -u -w1 your_ip_here 9760

I have included  the files i use on my Openelec Pi system, they may need modifying for other systems and the UDP commands so you can customize what the scripts do.

Hopefully a coder might create an addon or something ;)

cinemavision.rar

UDPCommands.xlsx

  • Upvote 2

Share this post


Link to post
Share on other sites
  • 0
On 14 April 2016 at 8:53 PM, shifter said:

Just in case anyone else needs the info here it is.

first off you need to register your kodi box with the wifi receiver


echo -ne "666,\!F*p" | nc -u -w1 your_ip_here 9760

I have included  the files i use on my Openelec Pi system, they may need modifying for other systems and the UDP commands so you can customize what the scripts do.

Hopefully a coder might create an addon or something ;)

cinemavision.rar

UDPCommands.xlsx

Thank you so much for all the info it helped immensely. I have a few questions if I may that you might be able to assist me with. Here we go and thanks for any assistance at all;

Equipment and setup - Openelec Official Version:6.0.3 Kodi 15.2 on a Raspberry Pi 2B+

I have ssh'd to my Openelec box and registered the box with the LWRF receiver the attached screen (21:16)shot shows the commands being sent directly from SSH and turning the lamps on and off. I can confirm they work and thought it best to test direct before getting into the CV

Screen Shot 2016-08-19 at 21.16.42.png

So I added your example Action and .sh files locally to the Openelec install for the PAUSE feature and edited the .sh with my LWRF IP and the data string I required for my device. Tested previously via SSH as working. Now when I run the test option in the CV automation section for the Pause script the following is returned:

IMG_4198.jpg

If you can point me to where this is going wrong I'd be very grateful. Ultimately I would like to :

Play trivia

Play Trailers 

Dim set of lights (with a script that works)

Play a welcome video file of my own

Turn off lights (again with script that works)

Play feature  - Use the pause and play light on lights off feature.

 

Phew Hope you can help and thanks for getting this far.  :-)

 

Share this post


Link to post
Share on other sites
  • 0
17 hours ago, wo0d1e said:

So I added your example Action and .sh files locally to the Openelec install for the PAUSE feature and edited the .sh with my LWRF IP and the data string I required for my device. Tested previously via SSH as working. Now when I run the test option in the CV automation section for the Pause script the following is returned:

IMG_4198.jpg

 

Hey there! If I'm not losing my mind, it looks like your Action Module is pointing to pause.sh instead of pause.cvaction. If I'm not mistaken, you'll want to reverse that.

You'll want  your pause.cvaction to include this command:

command:///storage/downloads/Actions/pause.sh

And your pause.sh to include the following:

#!/bin/bash
echo -ne "001,!R1D1F0\xe2\x80\x9d" | nc -u -w1 192.168.0.16 9760

Give that a shot and let me know how it goes.

  • Upvote 1

Share this post


Link to post
Share on other sites
  • 0
On ‎20‎/‎08‎/‎2016 at 3:21 PM, Ragnarok said:

Hey there! If I'm not losing my mind, it looks like your Action Module is pointing to pause.sh instead of pause.cvaction. If I'm not mistaken, you'll want to reverse that.

You'll want  your pause.cvaction to include this command:


command:///storage/downloads/Actions/pause.sh

And your pause.sh to include the following:


#!/bin/bash
echo -ne "001,!R1D1F0\xe2\x80\x9d" | nc -u -w1 192.168.0.16 9760

Give that a shot and let me know how it goes.

A huge ,huge thank you for the above assistance. That worked a treat. Part of where I fell down also was not clicking "OK" once I had changed the module to point to the pause.cvaction file before clicking test. It works, now I just have to fix the Apple Trailers Bug I am having and I am all good. I am going to create a guide of sorts for LightwaeRF via Pi (Openelec) - CV. Should I tag it to this thread or is there a review process and store for such a guide? Top work by the way really enjoying the Add-on and friends and family are amazed by it. I'm still learning but could eventually write some amazing sequences using this add-on.

  • Upvote 1

Share this post


Link to post
Share on other sites
  • 0
49 minutes ago, wo0d1e said:

A huge ,huge thank you for the above assistance. That worked a treat. Part of where I fell down also was not clicking "OK" once I had changed the module to point to the pause.cvaction file before clicking test. It works, now I just have to fix the Apple Trailers Bug I am having and I am all good. I am going to create a guide of sorts for LightwaeRF via Pi (Openelec) - CV. Should I tag it to this thread or is there a review process and store for such a guide? Top work by the way really enjoying the Add-on and friends and family are amazed by it. I'm still learning but could eventually write some amazing sequences using this add-on.

You're very welcome. :) All you should have to do to fix the iTunes bug is install this version:

As for creating a guide, we do have to approve them and we'll probably go through and change some formatting when all is said and done. Of course, you'll keep credit for the guide. :) When you're ready, you can start writing your guide here. Sequences are going to get a whole lot cooler in the next round of development, so stay tuned. ;)

Share this post


Link to post
Share on other sites
  • 0

Thank you so much for the guidance. I'll create and submit the guide once finished. Unfortunately I cannot download the link supplied. I seem to get a warning that suggests I am downloading files elsewhere. I don't believe I am :-) is there a flag you can remove from my account. I think I went a little click happy for the Dolby and DTS bumpers the other day and have a broken download.  Excuse the mobile browser I'm on the way home from the office :-(

image.png

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, wo0d1e said:

Thank you so much for the guidance. I'll create and submit the guide once finished. Unfortunately I cannot download the link supplied. I seem to get a warning that suggests I am downloading files elsewhere. I don't believe I am :-) is there a flag you can remove from my account. I think I went a little click happy for the Dolby and DTS bumpers the other day and have a broken download.  Excuse the mobile browser I'm on the way home from the office :-(

You're very welcome. So the download restrictions were in place in an effort to not overload our server. We're on much beefier hardware now, so I've removed the simultaneous download restrictions. Give it a shot now.

Share this post


Link to post
Share on other sites
  • 0

Sorry I couldn't help with this, I've been away with no internet access ! I'm glad my info has helped someone else though, if there is anything else i can do feel free to message me.

  • Upvote 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

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