Page 6 of 6

Re: Mount external dvd/bd-rom

Posted: Thu Jan 21, 2016 11:01 pm
by sectroyer
Ehh first write TUTORIAL for others :) That will also help us understand what EXACTLY did you do :)

Re: Mount external dvd/bd-rom

Posted: Fri Feb 05, 2016 10:03 pm
by matrixabc
This is tutorial How Compilation of modules for F-Series and how mounting cd/dvd/bd.
To the compilation I used the CentOs 5.0 system

Re: Mount external dvd/bd-rom

Posted: Sat Feb 06, 2016 4:51 pm
by matrixabc
Now i write simple widget in one button and when i click on i want to execute skript.sh but a don't know how to do. I write function in Main.js (clickbutton) but i dont know how i can run skript in function(clickbutton)?

Re: Mount external dvd/bd-rom

Posted: Sat Feb 06, 2016 7:09 pm
by wluczykijwf
matrixabc wrote:Now i write simple widget in one button and when i click on i want to execute skript.sh but a don't know how to do. I write function in Main.js (clickbutton) but i dont know how i can run skript in function(clickbutton)?
A script sh on widget mode run via local php server.
I think a simpler solution (without to write a widget) will run your script via the RCremap with CMD support.
However, if you continue to insist on the widget then I suggest you see my solution OnlineTV and listCH.
There, run scripts sh.

Re: Mount external dvd/bd-rom

Posted: Tue Feb 09, 2016 8:23 am
by wluczykijwf
A description: How run sh script via php in widget.
The description on request @matrixabc
Procedure on TV
  • 1. Create php script yourScript1.php

    Code: Select all

    <?php
    exec('nohup ./yourScript1.sh >> /dev/null 2>&1 echo $!');
    ?>
    2. Create php script yourScript2.php

    Code: Select all

    <?php
    exec('nohup ./yourScript2.sh >> /dev/null 2>&1 echo $!');
    ?>
    Of course it can be done in a single script with the flow parameters, but it is easier to describe :D
    3. Create directory on TV (root for E/F series): /mnt/phpsysinfo/yourScripts
    4. The files copy to the directory:
    • yourScript1.php
    • yourScript2.php
    • yourScript1.sh
    • yourScript2.sh
    5. Via telnet set permissions for two scripts:
    • Code: Select all

      chmod +x /mnt/phpsysinfo/yourScripts/yourScript1.sh

      Code: Select all

      chmod +x /mnt/phpsysinfo/yourScripts/yourScript2.sh
6. Restart TV.
Procedure on widget (Main.js)
  • 1. Create function
    • Code: Select all

      Main.runPHPScript = function(phpURL) 
      {
      	var req = new XMLHttpRequest();
      	req.open("GET", phpURL, true);
      	req.onreadystatechange = function (aEvt) {
      	  if (req.readyState == 4) {
      	     if(req.status == 200){
      	    	 	return(req.responseText);
      	    	 }
      	  }
      	};
      	req.send(null);
      };
    2.Create funtion
    • Code: Select all

      Main.runScriptSHviaPHP = function(name)
      {
          if (name != null && name != "") {
              var ip = '192.168.0.2';// IP TV, it set manualy or it can get via function GetIP() in Network plugin
              var phpURL = 'http://' + ip + ':1080/phpsysinfo/yourScripts/' + name + '.php';
              Main.runPHPScript(phpURL);
          }
      };
    3. Use function Main.runScriptSHviaPHP in your code e.q.:
    • Code: Select all

      Main.runScriptSHviaPHP("yourScript1");