aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2014-01-05 03:21:35 -0800
committerErmal Luçi <eri@pfsense.org>2014-01-05 03:21:35 -0800
commitb1962cf93379b0f9f3dfbfa69cd67f19af7c1539 (patch)
treea2fb505c7c0d5d914084c66cd4792d6e6021b1b5
parenta2073ee9c35e1a82412852ff78d0b3a37eea2d5c (diff)
parent736c7763fbdab29c8727003704dfbd0c51aa0a99 (diff)
downloadpfsense-packages-b1962cf93379b0f9f3dfbfa69cd67f19af7c1539.tar.gz
pfsense-packages-b1962cf93379b0f9f3dfbfa69cd67f19af7c1539.tar.bz2
pfsense-packages-b1962cf93379b0f9f3dfbfa69cd67f19af7c1539.zip
Merge pull request #532 from topper727/patch-1
CrystalFontz packet driver 4 status LED fix
-rw-r--r--README.md20
-rw-r--r--config/lcdproc-dev/lcdproc_client.php24
2 files changed, 35 insertions, 9 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 00000000..1a682095
--- /dev/null
+++ b/README.md
@@ -0,0 +1,20 @@
+pfsense-packages
+================
+lcdproc-0.5.6 pkg v. 0.9.7
+
+Patch to fix the 4 status LEDs
+
+This is in the pages for this Package
+Enable Output LEDs
+Enable the Output LEDs present on some LCD panels. This feature is currently supported by the CFontz633 driver only.
+Each LED can be off or show two colors: RED (alarm) or GREEN (everything ok) and shows:
+LED1: NICs status (green: ok, red: at least one nic down);
+LED2: CARP status (green: master, red: backup, off: CARP not implemented);
+LED3: CPU status (green < 50, red > 50%);
+LED4: Gateway status (green: ok, red: at least one gateway not responding, off: no gateway configured).
+
+This does not work on CFonts Displays properly. I have fixed it to make this work. There is one thing that I don't
+know if I got going and that is LED1.
+
+
+pfSense packages repository
diff --git a/config/lcdproc-dev/lcdproc_client.php b/config/lcdproc-dev/lcdproc_client.php
index 22713b98..3337052c 100644
--- a/config/lcdproc-dev/lcdproc_client.php
+++ b/config/lcdproc-dev/lcdproc_client.php
@@ -468,6 +468,8 @@
{
if ($value && $lcdproc_config['driver'] == "CFontz633")
{return true;}
+ else if ($value && $lcdproc_config['driver'] == "CFontzPacket")
+ {return true;}
else
{return false;}
}
@@ -773,31 +775,35 @@
$led_output_value = 0;
/* LED 1: Interface status */
if (substr_count(get_interfaces_stats(), "Down") > 0 )
- {$led_output_value = $led_output_value + pow(2, 0);}
- else
{$led_output_value = $led_output_value + pow(2, 4);}
+ else
+ {$led_output_value = $led_output_value + pow(2, 0);}
/* LED 2: CARP status */
switch (outputled_carp())
{
case -1:/* CARP disabled */
+ break;
case 0: /* CARP on Backup */
- {$led_output_value = $led_output_value + pow(2, 1);}
+ $led_output_value = $led_output_value + pow(2, 1);
+ break;
case 1: /* CARP on Master */
- {$led_output_value = $led_output_value + pow(2, 5);}
+ $led_output_value = $led_output_value + pow(2, 5);
}
/* LED 3: CPU Usage */
if (cpu_usage() > 50)
- {$led_output_value = $led_output_value + pow(2, 2);}
- else
{$led_output_value = $led_output_value + pow(2, 6);}
+ else
+ {$led_output_value = $led_output_value + pow(2, 2);}
/* LED 4: Gateway status */
switch (outputled_gateway())
{
case -1:/* Gateways not configured */
+ break;
case 0: /* Gateway down or with issues */
- {$led_output_value = $led_output_value + 2 ^ 3;}
+ $led_output_value = $led_output_value + pow(2, 7);
+ break;
case 1: /* All Gateways up */
- {$led_output_value = $led_output_value + 2 ^ 7;}
+ $led_output_value = $led_output_value + pow(2, 3);
}
/* Sends the command to the panel */
$lcd_cmds[] = "output {$led_output_value}";
@@ -922,4 +928,4 @@
{
lcdproc_warn("Too many errors, the client ends.");
}
-?> \ No newline at end of file
+?>