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
Jens

Open a Batch file or sending an hex command ?

Question

Is it possible to open a batch file with an .cvaction or sending a hex command and if yes how? I connected my projector with  Lan to rs232. I can  Control my projector over the virtual com1.

I can controll all the commands (On/off / Color / HDMI1,2 etc.) with batch files or with sending an hex command to com1. Have you a example?

Share this post


Link to post
Share on other sites

16 answers to this question

Recommended Posts

  • 0

Batch files are DOS/Windows files.  You need to create your script in bash maybe?  I'm not a Linux guru and just started using LibreElec myself.  A quick web search will probably yield some results.

  • Upvote 1

Share this post


Link to post
Share on other sites
  • 0

Okay I found "Understanding CinemaVision Actions" and know it works, but I don´t know if it works on my configuration. I run Kodi and CV on an Odroid C2 with Libreelec. In the same network is a laptop who is connected to my projector over rs232. When I run the  .cvaction file to open a batch file on the Laptop in my Network I get the following error: OSError: [Errno 2] No such file or directory.

Share this post


Link to post
Share on other sites
  • 0
On 9/9/2017 at 0:25 PM, Jens said:

Okay I found "Understanding CinemaVision Actions" and know it works, but I don´t know if it works on my configuration. I run Kodi and CV on an Odroid C2 with Libreelec. In the same network is a laptop who is connected to my projector over rs232. When I run the  .cvaction file to open a batch file on the Laptop in my Network I get the following error: OSError: [Errno 2] No such file or directory.

See below!

On 9/9/2017 at 9:12 PM, OTA said:

Batch files are DOS/Windows files.  You need to create your script in bash maybe?  I'm not a Linux guru and just started using LibreElec myself.  A quick web search will probably yield some results.

@OTA is right, you'll need to create a Bash or Shell script for Linux to be able to communicate directly to your projector. A quick Google should point you in the right direction. Once you have a working script, you can execute that script using your Action.

Share this post


Link to post
Share on other sites
  • 0

Now I have a bash script and when I run the script in the Linux Terminal it works.

This is the script:

#!/bin/bash
echo -ne '\x02PON\x03' | tee | nc 192.168.188.52 1002

 

I run the script in the Terminal with this Command:

bash -x skript.sh

 

My  .cvaction  is:

command:///storage/downloads/skript.sh

 But this doesn´t work. Hope you can help me.

IMG_1606.JPG.8e306492fc7b66ceed9580825cb4875e.JPG

 

 

 

Edited by Jens

Share this post


Link to post
Share on other sites
  • 0

I don't know enough about Linux to be much assistance.  Maybe double check your paths or create the paths from the root directory so the script will run from anywhere it's located?  Is there supposed to be a period in front of Kodi in your path?

 

You said that the script works when you manually run it, but doesn't from a cvaction file.  Is the script and cvaction file located in the same directory?

  • Upvote 1

Share this post


Link to post
Share on other sites
  • 0

Thank you  OTA. Sorry but I don´t know how to copy my file in the root path! I must have a look how I can copy it and if it works.

Is there another option to send the command to open the file using Cinemavision, because command:"///storage/downloads/beameron.sh" doesn´t work?

What I Know:

1) The file "beameron.sh" is in the path storage/downloads

2) The file "beameron.sh" works when I write: "bash -x beameron.sh"  in the Terminal

3) Everything must be wrong with this: "command:"///storage/downloads/beameron.sh"

 I need a command or a path that I can run in Cinemavision. 

First I´ll try to copy the file in the storage an look how it works...

  • Upvote 1

Share this post


Link to post
Share on other sites
  • 0

I did some digging since I need to know this stuff myself.  To find your paths in Linux to a specific file or directory, use the below command.

find / -name "filename"

So if you plug in your beameron.sh it should report /storage/downloads/beameron.sh.  If it's anything different, use the path that's reported in your action file.  Also, remember that Linux is case sensitive.  You indicate that you have "beameron.sh" but your screenshot has "beamer_ON.sh".

I don't have a keyboard and mouse with my HTPC, so I use PuTTY to remotely access it.  I can't stress how much this helps if you're in the same boat.

So if you just run beameron.sh from CLI without using bash do you get the same error?

Edited by OTA

Share this post


Link to post
Share on other sites
  • 0

Thank you OTA for your support. I think I´m going crazy with this problemO.o

When I write this: find / -name "filename" in Putty Terminal I see /storage/downloads/beameron.sh

When I write only: "/storage/downloads/beameron.sh"   I get a "not found"

When I write:  bash -x ///storage/downloads/beameron.sh It works fine.

When I write only: "beameron.sh" in the downloads path with Putty I get:"not found"

(This is the new name: beameron.sh the old is beamer_On.sh.)

FullSizeRender.thumb.jpg.f7a792e8a35ca17589ab7f7976cd5799.jpg

Edited by Jens
update jpeg

Share this post


Link to post
Share on other sites
  • 0

Okay, so I think we found out the problem.  Somehow bash needs to be called in order to run the script.  I'm not sure how to do that in a cvaction file, but I found some documentation about running a bash script from a python subprocess here.  I don't know how the back end process of the command protocol in the cvaction files work.  I'm only using them for JSON commands.

Try modifying your cvaction file to run bash with arguments like below:

command:///usr/bin/bash -x
///storage/downloads/beameron.sh

Not sure if this will work, but I think it will have to be a similar format and maybe a good starting point.  If not, I've exhausted all the ideas I can think of and we'll have to wait for @Ragnarok or one of the other developers to chime in.  I'm looking forward to the resolution as this will be helpful for many other things.

Share this post


Link to post
Share on other sites
  • 0

I´m happy I can fix the problem with the help from libreELEC Forum. It was  DOS line endings created by Windows editor. .

After writing:" dos2unix /storage/downloads/beameron.sh " in the Putty Terminal it is working with: "

command:///storage/downloads/beameron.sh

Thank you OTA for your time and help.

  • Upvote 1

Share this post


Link to post
Share on other sites
  • 0

I found your topic over a the LibreELEC support forum here.  What text editor did you use to create it?  I use notepad++ and want to make sure I don't run into the same thing in the future.  I'm glad it got sorted.

  • Upvote 1

Share this post


Link to post
Share on other sites
  • 0

I have the Same Editor.

Notepad++.

Im so happy but I spend a lot of Time with this Problem.  Looks like that it is a rare Problem. 

  • Upvote 1

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.