コード例 #1
0
ファイル: networkconfig.php プロジェクト: randyr505/fpp
function PopulateInterfaces()
{
    $first = 1;
    $interfaces = explode("\n", trim(shell_exec("/sbin/ifconfig -a | cut -f1 -d' ' | grep -v ^\$ | grep -v lo | grep -v eth0:0 | grep -v usb0")));
    $ifaceE131 = ReadSettingFromFile("E131interface");
    foreach ($interfaces as $iface) {
        $iface = preg_replace("/:\$/", "", $iface);
        $ifaceChecked = $first ? " selected" : "";
        echo "<option value='" . $iface . "'" . $ifaceChecked . ">" . $iface . "</option>";
        $first = 0;
    }
}
コード例 #2
0
ファイル: fppjson.php プロジェクト: rudybrian/fpp
function GetPluginSetting()
{
    global $args;
    $setting = $args['key'];
    $plugin = $args['plugin'];
    check($setting, "setting", __FUNCTION__);
    check($plugin, "plugin", __FUNCTION__);
    $value = ReadSettingFromFile($setting, $plugin);
    $result = array();
    $result[$setting] = $value;
    returnJSON($result);
}
コード例 #3
0
include_once 'commonFunctions.inc.php';
$pluginName = "MailControl";
$PLAYLIST_NAME = "";
$MAJOR = "98";
$MINOR = "01";
$eventExtension = ".fevt";
//arg0 is  the program
//arg1 is the first argument in the registration this will be --list
//$DEBUG=true;
$SMSEventFile = $eventDirectory . "/" . $MAJOR . "_" . $MINOR . $eventExtension;
$SMSGETScriptFilename = $scriptDirectory . "/" . $pluginName . "_GET.sh";
$messageQueue_Plugin = "MessageQueue";
$MESSAGE_QUEUE_PLUGIN_ENABLED = false;
$logFile = $settings['logDirectory'] . "/" . $pluginName . ".log";
$messageQueuePluginPath = $settings['pluginDirectory'] . "/" . $messageQueue_Plugin . "/";
$messageQueueFile = urldecode(ReadSettingFromFile("MESSAGE_FILE", $messageQueue_Plugin));
if (file_exists($messageQueuePluginPath . "functions.inc.php")) {
    include $messageQueuePluginPath . "functions.inc.php";
    $MESSAGE_QUEUE_PLUGIN_ENABLED = true;
} else {
    logEntry("Message Queue Plugin not installed, some features will be disabled");
}
$gitURL = "https://github.com/LightsOnHudson/FPP-Plugin-Mail.git";
$pluginUpdateFile = $settings['pluginDirectory'] . "/" . $pluginName . "/" . "pluginUpdate.inc";
createSMSSequenceFiles();
logEntry("plugin update file: " . $pluginUpdateFile);
if (isset($_POST['updatePlugin'])) {
    $updateResult = updatePluginFromGitHub($gitURL, $branch = "master", $pluginName);
    echo $updateResult . "<br/> \n";
}
if (isset($_POST['submit'])) {
コード例 #4
0
#!/usr/bin/php
<?php 
$myPid = getmypid();
include_once "/opt/fpp/www/common.php";
include_once "functions.inc.php";
$pluginName = "MatrixMessage";
$fpp_matrixtools_Plugin = "fpp-matrixtools";
$fpp_matrixtools_Plugin_Script = "scripts/matrixtools";
$FPP_MATRIX_PLUGIN_ENABLED = false;
$logFile = $settings['logDirectory'] . "/" . $pluginName . ".log";
$P10Matrix = urldecode(ReadSettingFromFile("P10Matrix", $pluginName));
echo "outputing video!!! \n";
$VIDEO_PATH = "/home/pi/media/effects/";
$IMAGE_BASE = "image-";
$IMAGE_EXT = ".jpg";
$FPPMM = "/opt/fpp/bin/fppmm";
$NUM_OF_FRAMES = 1200;
$CONVERT_BINARY = "/usr/bin/convert";
$frame = 0;
for ($frame = 0; $frame <= $NUM_OF_FRAMES; $frame++) {
    $cmd = $CONVERT_BINARY . " -scale '32x16!' -depth 8 " . $VIDEO_PATH . $IMAGE_BASE . $frame . $IMAGE_EXT . " rgb:" . $VIDEO_PATH . "RGB" . $IMAGE_BASE . $frame . $IMAGE_EXT;
    //convert the image and then output it to the fppmm
    //$cmd = "cat ".$VIDEO_PATH.$IMAGE_BASE.$frame.$IMAGE_EXT. " > /home/pi/matrix";
    //exec($cmd);
    echo "CMD: " . $cmd . "\n";
}
$frame = 0;
for ($frame = 0; $frame <= $NUM_OF_FRAMES; $frame++) {
    $cmd = $FPPMM . " -m " . $P10Matrix . " -f " . $VIDEO_PATH . $IMAGE_BASE . $frame . $IMAGE_EXT;
    //convert the image and then output it to the fppmm
    //$cmd = "cat ".$VIDEO_PATH.$IMAGE_BASE.$frame.$IMAGE_EXT. " > /home/pi/matrix";
コード例 #5
0
ファイル: timeconfig.php プロジェクト: rudybrian/fpp
echo print_if_match("N", ReadSettingFromFile("piRTC"), "selected");
?>
 >None</option>
  <option value = "2" <?php 
echo print_if_match("2", ReadSettingFromFile("piRTC"), "selected");
?>
 >DS1305/DS1307</option>
<?php 
if ($settings['Platform'] != "BeagleBone Black") {
    ?>
  <option value = "1" <?php 
    echo print_if_match("1", ReadSettingFromFile("piRTC"), "selected");
    ?>
 >RasClock</option>
  <option value = "3" <?php 
    echo print_if_match("3", ReadSettingFromFile("piRTC"), "selected");
    ?>
 >PiFace</option>
<?php 
}
?>
</select> <b>NOTE:</b> You must reboot to activate the RTC, then return to this page to set the time on the RTC.


<h4>NTP</h4>

<!--

TODO: Make this a tool-tip:

<p>NTP stands for Network Time Protocol, and it is an Internet protocol used to synchronize the clocks of computers to some time reference. NTP is an Internet standard protocol originally developed by Professor David L. Mills at the University of Delaware.</p>
コード例 #6
0
$DEBUG = $pluginSettings['DEBUG'];
$READ_MESSAGE_MARK = $pluginSettings['READ_MESSAGE_MARK'];
$PROFANITY_ENGINE = urldecode($pluginSettings['PROFANITY_ENGINE']);
$LOG_LEVEL = getFPPLogLevel();
logEntry("Log level in translated from fpp settings file: " . $LOG_LEVEL);
if (urldecode($pluginSettings['DEBUG'] != "" || urldecode($pluginSettings['DEBUG'] != 0))) {
    $DEBUG = urldecode($pluginSettings['DEBUG']);
}
$COMMAND_ARRAY = explode(",", trim(strtoupper($VALID_COMMANDS)));
$CONTROL_NUMBER_ARRAY = explode(",", $CONTROL_NUMBERS);
$WHITELIST_NUMBER_ARRAY = explode(",", $WHITELIST_NUMBERS);
$logFile = $settings['logDirectory'] . "/" . $pluginName . ".log";
//give google voice time to sleep
$GVSleepTime = 5;
$ENABLED = "";
$ENABLED = trim(urldecode(ReadSettingFromFile("ENABLED", $pluginName)));
if (($pid = lockHelper::lock()) === FALSE) {
    exit(0);
}
if ($ENABLED != "on" && $ENABLED != "1") {
    logEntry("Plugin Status: DISABLED Please enable in Plugin Setup to use & Restart FPPD Daemon");
    lockHelper::unlock();
    exit(0);
}
if ($DEBUG) {
    logEntry("________________________");
    logEntry("Plugin Settings");
    logEntry("________________________");
    while (list($key, $val) = each($pluginSettings)) {
        logEntry("{$key} => {$val}");
    }
コード例 #7
0
ファイル: fppxml.php プロジェクト: randyr505/fpp
function GetVolume()
{
    $volume = ReadSettingFromFile("volume");
    if ($volume == "") {
        $volume = 75;
    }
    $doc = new DomDocument('1.0');
    $root = $doc->createElement('Volume');
    $root = $doc->appendChild($root);
    $value = $doc->createTextNode($volume);
    $value = $root->appendChild($value);
    echo $doc->saveHTML();
}
コード例 #8
0
ファイル: callbacks.php プロジェクト: jaredb7/FPP-Plugin-SMS
//arg1 is the first argument in the registration this will be --list
//$DEBUG=true;
$logFile = $settings['logDirectory'] . "/" . $pluginName . ".log";
$ENABLED = "";
$ENABLED = trim(urldecode(ReadSettingFromFile("ENABLED", $pluginName)));
if ($ENABLED != "on" && $ENABLED != "1") {
    logEntry("Plugin Status: DISABLED Please enable in Plugin Setup to use & Restart FPPD Daemon");
    exit(0);
}
$EMAIL = urldecode(ReadSettingFromFile("EMAIL", $pluginName));
$PASSWORD = urldecode(ReadSettingFromFile("PASSWORD", $pluginName));
$PLAYLIST_NAME = urldecode(ReadSettingFromFile("PLAYLIST_NAME", $pluginName));
$WHITELIST_NUMBERS = urldecode(ReadSettingFromFile("WHITELIST_NUMBERS", $pluginName));
$CONTROL_NUMBERS = urldecode(ReadSettingFromFile("CONTROL_NUMBERS", $pluginName));
$REPLY_TEXT = urldecode(ReadSettingFromFile("REPLY_TEXT", $pluginName));
$VALID_COMMANDS = urldecode(ReadSettingFromFile("VALID_COMMANDS", $pluginName));
$COMMAND_ARRAY = explode(",", trim(strtoupper($VALID_COMMANDS)));
$CONTROL_NUMBER_ARRAY = explode(",", $CONTROL_NUMBERS);
$PLAYLIST_NAME = getRunningPlaylist();
//none at this time
$callbackRegisters = "media";
//$callbackRegisters = "playlist,media";
//var_dump($argv);
$FPPD_COMMAND = $argv[1];
//echo "FPPD Command: ".$FPPD_COMMAND."<br/> \n";
if ($FPPD_COMMAND == "--list") {
    echo $callbackRegisters;
    logEntry("FPPD List Registration request: responded:" . $callbackRegisters);
    exit(0);
}
if ($FPPD_COMMAND == "--type") {