2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

added: new module 51_BBB_WATCHDOG.pm

fixed: added CUL_HM as "known type" in 98_PID.pm

git-svn-id: https://svn.fhem.de/fhem/trunk@4930 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
betateilchen 2014-02-15 03:59:16 +00:00
parent 6ff9af25d6
commit 4f4810f6eb
4 changed files with 111 additions and 3 deletions

View File

@ -1,6 +1,7 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it. # Do not insert empty lines here, update check depends on it.
- SVN - SVN
- added: new module 51_BBB_WATCHDOG.pm (betateilchen)
- bugfix: SYSMON: Fix: uninitialized variable - bugfix: SYSMON: Fix: uninitialized variable
- feature: new modul 73_MPD added (Wzut) - feature: new modul 73_MPD added (Wzut)
- bugfix: SYSMON: Fix: root fs with /dev/mapper - bugfix: SYSMON: Fix: root fs with /dev/mapper

View File

@ -0,0 +1,106 @@
# $Id:
package main;
use strict;
use warnings;
use Time::HiRes qw(gettimeofday);
sub BBB_WATCHDOG_Initialize($){
my ($hash) = @_;
require "$attr{global}{modpath}/FHEM/DevIo.pm";
$hash->{DefFn} = "BBB_WATCHDOG_Define";
$hash->{UndefFn} = "BBB_WATCHDOG_Undefine";
$hash->{ShutdownFn} = "BBB_WATCHDOG_Shutdown";
$hash->{AttrList} = $readingFnAttributes;
}
sub BBB_WATCHDOG_Define($$){
my ($hash, $def) = @_;
my $name = $hash->{NAME};
my @a = split("[ \t][ \t]*", $def);
my $dev = '/dev/watchdog@directio';
DevIo_CloseDev($hash);
$hash->{PARTIAL} = "";
$hash->{DeviceName} = $dev;
my $ret = DevIo_OpenDev($hash, 0, undef);
triggerWD($hash);
return $ret;
}
sub BBB_WATCHDOG_Undefine($$){
my($hash, $name) = @_;
DevIo_CloseDev($hash);
RemoveInternalTimer($hash);
return;
}
sub BBB_WATCHDOG_Shutdown($) {
my ($hash) = @_;
my $name = $hash->{NAME};
Log3 ($name,4,"BBB_WATCHDOG $name: shutdown requested");
DevIo_CloseDev($hash);
return undef;
}
sub triggerWD($) {
my ($hash) = @_;
Log3(undef, 4, "triggered");
DevIo_SimpleWrite($hash, "X", undef);
InternalTimer(gettimeofday()+40, "triggerWD", $hash, 0);
}
1;
=pod
not to be translated
=begin html
<a name="BBB_WATCHDOG"></a>
<h3>BBB_WATCHDOG</h3>
<ul>
<b>Prerequesits</b>
<ul><br/>
<li><b>Module was developed for use with Beaglebone Black.</b><br/><br/></li>
<li>To use this module, you have to create an udev-Rule for accessing /dev/watchdog<br/><br/>
<code>SUBSYSTEM=="misc" ACTION=="add" DRIVER=="" KERNEL=="watchdog" MODE=="666"</code></li>
</ul><br/><br/>
<a name="BBB_WATCHDOGdefine"></a>
<b>Define</b>
<ul><br/>
<code>define &lt;name&gt; BBB_WATCHDOG</code><br/><br/>
This module provides a heartbeat signal to BBB internal watchdog device<br/>
If this signal fails for more than 60 seconds, the BBB will perform a reboot.<br/>
</ul><br/><br/>
<a name="BBB_WATCHDOGset"></a>
<b>Set-Commands</b><br/><br/>
<ul>No set commands implemented.</ul><br/><br/>
<a name="BBB_WATCHDOGget"></a>
<b>Get-Commands</b><br/><br/>
<ul>No get commands implemented.</ul><br/><br/>
<a name="BBB_WATCHDOGattr"></a>
<b>Attributes</b><br/><br/>
<ul><a href="#readingFnAttributes">readingFnAttributes</a></ul><br/><br/>
<b>Author's notes</b><br/><br/>
<ul>Have fun!</ul>
</ul>
=end html
=begin html_DE
<a name="BBB_BMP180"></a>
<h3>BBB_BMP180</h3>
<ul>
Sorry, keine deutsche Dokumentation vorhanden.<br/><br/>
Die englische Doku gibt es hier: <a href='http://fhem.de/commandref.html#BBB_BMP180'>BBB_BMP180</a><br/>
</ul>
=end html_DE
=cut

View File

@ -45,7 +45,7 @@ PID_Define($$$)
$pid->{sensor} = $sensor; $pid->{sensor} = $sensor;
if(!$regexp) { if(!$regexp) {
my $t = $defs{$sensor}{TYPE}; my $t = $defs{$sensor}{TYPE};
if($t eq "HMS" || $t eq "CUL_WS") { if($t eq "HMS" || $t eq "CUL_WS" || $t eq "CUL_HM" ) {
$reading = "temperature"; $reading = "temperature";
$regexp = '([\\d\\.]*)'; $regexp = '([\\d\\.]*)';
} else { } else {

View File

@ -112,8 +112,9 @@ FHEM/46_TRX_SECURITY.pm wherzig http://forum.fhem.de RFXTRX
FHEM/46_TRX_WEATHER.pm wherzig http://forum.fhem.de RFXTRX FHEM/46_TRX_WEATHER.pm wherzig http://forum.fhem.de RFXTRX
FHEM/49_IPCAM.pm mfr69bs http://forum.fhem.de Sonstiges FHEM/49_IPCAM.pm mfr69bs http://forum.fhem.de Sonstiges
FHEM/50_WS300.pm Dirk http://forum.fhem.de SlowRF FHEM/50_WS300.pm Dirk http://forum.fhem.de SlowRF
FHEM/51_BBB_BMP180.pm betateilchen http://forum.fhem.de Raspberry Pi FHEM/51_BBB_BMP180.pm betateilchen http://forum.fhem.de Einplatinencomputer
FHEM/51_I2C_BMP180.pm Dirk http://forum.fhem.de Raspberry Pi FHEM/51_BBB_WATCHDOG.pm betateilchen http://forum.fhem.de Einplatinencomputer
FHEM/51_I2C_BMP180.pm Dirk http://forum.fhem.de Einplatinencomputer
FHEM/51_RPI_GPIO.pm klausw http://forum.fhem.de Einplatinencomputer FHEM/51_RPI_GPIO.pm klausw http://forum.fhem.de Einplatinencomputer
FHEM/55_GDS.pm betateilchen http://forum.fhem.de Unterstuetzende Dienste FHEM/55_GDS.pm betateilchen http://forum.fhem.de Unterstuetzende Dienste
FHEM/55_PIFACE.pm klaus.schauer http://forum.fhem.de Einplatinencomputer FHEM/55_PIFACE.pm klaus.schauer http://forum.fhem.de Einplatinencomputer