2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

Small fixes, preparing for the 5.1 release

git-svn-id: https://svn.fhem.de/fhem/trunk@930 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2011-07-07 07:02:50 +00:00
parent 2b28d07ad0
commit 77db35d3d5
11 changed files with 230 additions and 46 deletions

View File

@ -33,8 +33,8 @@ CommandUpdatefhem($$)
my ($cl, $param) = @_;
my $lt = "";
my $ret = "";
#my $moddir = "$attr{global}{modpath}/FHEM";
my $moddir = "XXX";
my $moddir = "$attr{global}{modpath}/FHEM";
#my $moddir = "XXX";
# Read in the OLD filetimes.txt
my %oldtime;
@ -111,8 +111,8 @@ sub
CommandCULflash($$)
{
my ($cl, $param) = @_;
#my $moddir = "$attr{global}{modpath}/FHEM";
my $moddir = "XXX";
my $moddir = "$attr{global}{modpath}/FHEM";
#my $moddir = "XXX";
my %ctypes = (
CUL_V2 => "at90usb162",

View File

@ -13,8 +13,8 @@ RDOCDIR=$(ROOT)$(DOCDIR)
RMANDIR=$(ROOT)$(MANDIR)
RETCDIR=$(ROOT)$(ETCDIR)
VERS=5.0
DATE=2010-08-15
VERS=5.1
DATE=2011-07-09
DESTDIR=fhem-$(VERS)
all:
@ -86,3 +86,6 @@ deb:
mv .f $(DESTDIR)
dpkg-deb --build $(DESTDIR)
rm -rf $(DESTDIR)
fb7390:
cd contrib/FB7390 && ./makeimage $(DESTDIR)

View File

@ -14,3 +14,8 @@ Webpgm2
- integrate weblink details in the SVG
- autocreate: multiple plots
- fancy webkit tranformations
=============
5.1
- .deb
- examples

View File

@ -0,0 +1,14 @@
#!/bin/sh
## FritzBox 7390
## Beispiel fuer das Senden von FHEM Kommandos ueber den Telefoncode
## #95*x* wobei x hier 1 bzw 2 entspricht.
case $1 in
1) echo "set Steckdose on" | /sbin/socat - TCP:127.0.0.1:7072
;;
2) echo "set Steckdose off" | /sbin/socat - TCP:127.0.0.1:7072
;;
esac

65
fhem/contrib/FB7390/install Executable file
View File

@ -0,0 +1,65 @@
#! /bin/sh
root=/var/InternerSpeicher
home=$root/fhem
echo "########################### FHEM INSTALL BEGIN #######################"
killall perl > /dev/null 2>&1
sleep 1
echo "########################### Extracting fhem.tar.gz ###################"
cd $root
if test -d fhem; then
mv fhem fhem.OLD
fi
gzip -cd /var/fhem.tar.gz | tar xf -
cd $root
# Save files from the AVM Style installation
if test -f fhem.OLD/opt/etc/fhem.cfg; then
echo "########################### Converting chroot style config ###########"
export LD_LIBRARY_PATH=$home/lib
export PERL5LIB=$home/lib/perl5/site_perl/5.12.2/mips-linux:$home/lib/perl5/site_perl/5.12.2:$home/lib/perl5/5.12.2/mips-linux:$home/lib/perl5/5.12.2
cp fhem.OLD/opt/etc/fhem.cfg fhem
fhem/perl -pi -e 's,/opt,$root,g;
s,fhem/share,fhem,;
s,^#define autocreate,define autocreate,;
s,^#attr autocreate,attr autocreate,;
s,ttyACM(.)(@\d+)?,ttyACM$1\@38400,;' fhem/fhem.cfg
mv fhem.OLD/opt/fhem/log/* fhem/log
fi
# Save files from our old version
if test -f fhem.OLD/fhem.cfg; then
echo "########################### Copying non-chroot style config ##########"
mv fhem.OLD/FHEM/*.sh fhem/FHEM
mv fhem.OLD/FHEM/99.*Util.pm fhem/FHEM
mv fhem.OLD/FHEM/*.sh fhem/FHEM
mv fhem.OLD/log/* fhem/log
mv fhem.OLD/fhem.cfg fhem
fi
chown -R boxusr80:root $home
if test -d fhem.OLD; then
echo "########################### Deleting the old directory ###############"
rm -rf fhem.OLD
fi
cat /var/flash/debug.cfg > /var/nvi.tmp
grep -q fhem /var/nvi.tmp
r=$?
if test $r != 0; then
echo "########################### Modifying the startup script #############"
echo $home/startfhem >> /var/nvi.tmp
cat /var/nvi.tmp > /var/flash/debug.cfg
fi
rm -f /var/nvi.tmp
echo "########################### Starting fhem ############################"
sync
$home/startfhem
echo "########################### FHEM INSTALL END #########################"
exit 1 # INSTALL_SUCCESS_REBOOT

55
fhem/contrib/FB7390/makeimage Executable file
View File

@ -0,0 +1,55 @@
#!/bin/sh
fw=$1
if test ! -f ../../$fw.tar.gz; then
echo "usage: makeimage <fhem-VERSION.tar.gz>"
echo "../../<fhem-VERSION>.tar.gz mus exist"
exit 1
fi
rm -rf var
echo Extracting the fritzbox template
tar xf ../../priv/fritzbox7390_template.tar
cd var
tar zxf fhem.tar.gz
rm -rf fhem/FHEM
mkdir fhem/FHEM
cd ..
cp install var
cp startfhem var/fhem
cp fhemcmd.sh var/fhem/FHEM
echo Extracting $fw
rm -rf $fw
tar zxf ../../$fw.tar.gz
cd $fw
cp fhem.pl\
FHEM/*\
webfrontend/pgm2/*\
docs/*.html\
docs/fhem.png\
docs/*.jpg\
../var/fhem/FHEM
cd examples
for i in *; do
cp -r $i ../../var/fhem/FHEM/example.$i
done
cd ../..
rm -rf $fw
echo Packing again
cd var/fhem
cp FHEM/example.sample_pgm2 fhem.cfg
perl -pi -e 's,/tmp,./log,g' fhem.cfg
cd ..
tar zcf fhem.tar.gz fhem
rm -rf fhem
cd ..
tar cf $fw-fb7390.image var
rm -rf var

19
fhem/contrib/FB7390/startfhem Executable file
View File

@ -0,0 +1,19 @@
#!/bin/sh
home=/var/InternerSpeicher/fhem
cd $home
trap "" SIGHUP
modprobe cdc_acm
sleep 2
ln -sf $home/FHEM/fhemcmd.sh /var/fhemcmd
PATH=$home:$PATH
export PATH
export LD_LIBRARY_PATH=$home/lib
export PERL5LIB=$home/lib/perl5/site_perl/5.12.2/mips-linux:$home/lib/perl5/site_perl/5.12.2:$home/lib/perl5/5.12.2/mips-linux:$home/lib/perl5/5.12.2
perl fhem.pl fhem.cfg

View File

@ -45,13 +45,19 @@
<a name="starting"></a>
<h3>Starting fhem</h3>
<ul>
Skip this section if you installed fhem via the Debian package.<br><br>
Skip this section if you installed fhem via the Debian
<a href="http://fhem.de/fhem-=VERS=.deb">package</a> or via the Fritzbox7390
<a href="http://fhem.de/fhem-=VERS=-fb7390.image">image</a><br><br>
First install the Device::SerialPort (or Win32::SerialPort) perl module
with the command <code>"sudo cpan Device::SerialPort"</code><br>
with the command <code>"sudo cpan Device::SerialPort"</code>. There are
also precompiled debian packages (libdevice-serialport-perl), and this
module is already installed on OSX. You will need it to access the USB
devices<br><br>
The default configuration will install fhem into /usr/bin,
/usr/share/fhem and /var/log/fhem and /etc/fhem.cfg. Edit the Makefile to
change this.
/usr/share/fhem and /var/log/fhem and /etc/fhem.cfg, according to the
debian/ubuntu requirments. Edit the Makefile to change this.
To install & start fhem type:<pre>
make install-pgm2
@ -60,6 +66,7 @@
After starting, the logfile should look like:<pre>
2008.06.15 16:17:03 2: FHEMWEB port 8083 opened
2008.06.15 16:17:03 2: FHEMWEB port 8084 opened
2008.06.15 16:17:03 2: FHEMWEB port 8085 opened
2008.06.15 16:17:03 0: Server started (version ...)</pre>
</ul>
@ -67,10 +74,12 @@
<h3>Attaching the USB device for the PC (CUL / FHZ1x00PC / EM1010PC)</h3>
<ul>
Connect to fhem with an internet browser:
<a href="http://localhost:8083/fhem">http://localhost:8083/fhem</a>
or
<a href="http://localhost:8084/fhem">http://localhost:8084/fhem</a> if
you are using a a smartphone.<br><br>
<a href="http://localhost:8083/fhem">http://fhem-host:8083/fhem</a>
if you are using a normal desktop,
<a href="http://localhost:8084/fhem">http://fhem-host:8084/fhem</a> if
you are using a smartphone, or
<a href="http://localhost:8084/fhem">http://fhem-host:8085/fhem</a> if
you are using a tablet like the iPad.<br><br>
Attach the USB device (CUL, FHZ1000PC/FHZ1300, EM1010PC) to your
computer, and look for the corresponding device in the /dev
@ -79,7 +88,7 @@
Linux and /dev/cu.usbmodem* under OS X. Note the exact name of the device.
Define it for fhem (by typing it in the "Fhem cmd" input field in the
browser):<pre>
define CUL1 CUL /dev/ttyACM0 1234</pre>
define CUL1 CUL /dev/ttyACM0@9600 1234</pre>
You can find details about CUL define parameters <a
href="commandref.html#CUL">here</a>.<br><br>
@ -93,9 +102,16 @@
/dev/cu.usbserial-xxxxxxxx.
<br><br>
<b>Note:</b> Don't forget to type "save" in the "Fhem cmd" input field of
the browser after defining a device or setting its attribute. Otherwise
the changes will disappear after the next start.</ul>
<b>Notes:</b>
<ul>
<li>Don't forget to type "save" in the "Fhem cmd" input field of the
browser after defining a device or setting its attribute. Otherwise
the changes will disappear after the next start.
<li>The CUL is arriving without a firmware. You can flash it via the
<a href="commandref.html#CULflash">CULflash</a> command, if the
dfu-programmer is installed. dfu-programmer is part of the FB390 image.
</ul>
</ul>
<a name="autocreate"></a>
<h3>Configuring transmitter devices</h3>
@ -117,7 +133,7 @@
If you want to do the same manually:<br>
Wait a while, until the transmitter sent some data. In the logfile
(Browser window: "All together" -> Logs:Logfile:text) a line
(Browser window: "Unsorted -> Logs / Fhemlog / text) a line
will appear:<pre>
FS20 Unknown device &lt;HOUSECODE&gt;, Button &lt;BTN&gt; Code &lt;CDE&gt;, please define it</pre>
@ -131,12 +147,12 @@
<a href="commandref.html#model">Here</a> is a complete list of FS20
models.<br> For other device types similar messages should appear.<br><br>
<b>Note:</b> Creating a fhem FHT device automatically or manually does
not imply that the CUL or the FHZ is paired with it. For this purpose you
have to set the FHT to accept new devices (Prog:Cent:N/A), and send a command to
it (e.g. set fht.kitchen desired-temp 20).
If there is no signal for a while, then check <a href="faq.html#faq6">
this</a> FAQ entry.
<b>Note:</b> Creating a fhem FHT or HomeMatic device automatically or
manually does not imply that the CUL or the FHZ is paired with it. For
this purpose you have to set the FHT to accept new devices
(Prog:Cent:N/A), and send a command to it (e.g. set fht.kitchen
desired-temp 20). If there is no signal for a while, then check <a
href="faq.html#faq6"> this</a> FAQ entry.
</ul>
<a name="FS20rx"></a>
@ -162,7 +178,7 @@
<h3>Timed commands / Notification</h3>
<ul>
To execute commands at a given time / periodically, you have to define
devices of the type at. See the definition <a href="commandref.html#at">
devices of the type <b>at</b>. See the definition <a href="commandref.html#at">
here</a> and the examples <a href="example.06_at">here</a>. The last link
only works if you are reading this HOWTO from your fhem Web.<br><br>
@ -258,26 +274,26 @@
The logs can be converted to a plot either with gnuplot (which must be
installed and in your PATH), or via the builtin SVG module, in this case
your browser must support SVG. Firefox, Opera, Chrome, Safari
(on the iPhone/iPad too) support SVG out of the box, Internet Explorer does
it via the Adobe "SVG viewer" plugin, Android does not support it (as of
2011/02).
(both on OSX and iOS) support SVG out of the box, Internet Explorer
from version 9. IE prior to version 9 does it via the Adobe "SVG viewer"
plugin, and some Android versions prior to 3.0 do not support it.
SVG mode is the default, to change it set the <a
href="commandref.html#plotmode">plotmode</a> attribute to gnuplot or
gnuplot-scroll.<br><br>
In order to look at historic data, you can either convert at the
archive entries to weblink in "plotmode=gnuplot" mode, or use the
"plotmode=gnuplot-scroll" or "plotmode=SVG" modes. fnuplot-scroll and SVG
In order to look at historic data, you can either convert the
archive entries to a weblink in "plotmode=gnuplot" mode, or use the
"plotmode=gnuplot-scroll" or "plotmode=SVG" modes. gnuplot-scroll and SVG
offer the possibility to zoom or scroll in the plot, see the arrow and
magnifier icons at the top of the page.<br><br>
Note: the gnuplot files must have #FileLog entries in order to be
useable with scrolling, as the filtering happens with the FileLog get
function, see the supplied gnuplot files for an example or the
column_spec paragraph <a href="commandref.html#FileLogget">here</a> for
the syntax.<br><br>
Note: the gnuplot files must have #FileLog entries in order to be useable
with gnuplot-scroll or SVG, as the filtering happens with the FileLog get
function, see the supplied gnuplot files or the column_spec paragraph <a
href="commandref.html#FileLogget">here</a> for the syntax.<br><br>
The order of the #FileLog lines must match the corresponding 'awk'
The order of the #FileLog lines must match the corresponding 'awk'
entries.<br><br>
It make sense to build large logfiles for scrolling in them (year

View File

@ -561,7 +561,7 @@ A line ending with \ will be concatenated with the next one, so long lines
CULflash command.<br>
Example:
<ul>
<code>fhem> CULflash CUL CUL_V3</code>
<code>CULflash CUL CUL_V3</code>
</ul>
</ul>

View File

@ -8,12 +8,15 @@ attr global statefile /tmp/fhem.save # where to save the state of the devices
attr global verbose 3 # "normal" verbosity (min 1, max 5)
#define CUL CUL /dev/ttyACM0 1234
#define FHEM FHEM /dev/USB0
#define FHZ FHZ /dev/USB0
define WEB FHEMWEB 8083 global
define WEBS FHEMWEB 8084 global
attr WEBS smallscreen
define WEBphone FHEMWEB 8084 global
attr WEBphone smallscreen
define WEBtablet FHEMWEB 8085 global
attr WEBtablet touchpad
# Fake logfile, to access the global log
define Logfile FileLog /tmp/fhem-%Y-%m.log fakelog

View File

@ -310,13 +310,16 @@ FW_AnswerCall($)
$FW_tp = AttrVal($FW_wname, "touchpad", $FW_ss);
# Lets go:
if($arg =~ m,^${FW_ME}/(.*html)$, || $arg =~ m,^${FW_ME}/(example.*)$,) {
Log 1, "ARG: $arg";
if($arg =~ m,^${FW_ME}/(example.*|.*html)$,) {
my $f = $1;
Log 1, "GOT: $f";
$f =~ s,/,,g; # little bit of security
open(FH, "$FW_dir/$f") || return;
pO join("", <FH>);
close(FH);
$FW_RETTYPE = "text/plain; charset=ISO-8859-1" if($f !~ m/\.*html$/);
Log 1, "RT: $FW_RETTYPE";
return 1;
} elsif($arg =~ m,^$FW_ME/(.*).css,) {
@ -434,7 +437,7 @@ FW_AnswerCall($)
FW_roomOverview($cmd);
FW_style($cmd,undef) if($cmd =~ m/^style /);
FW_doDetail($FW_detail) if($FW_detail);
FW_doDetail($FW_detail) if($FW_detail);
FW_showRoom() if($FW_room && !$FW_detail);
FW_logWrapper($cmd) if($cmd =~ /^logwrapper/);
FW_showArchive($cmd) if($cmd =~ m/^showarchive/);
@ -1442,8 +1445,9 @@ FW_style($$)
my @fl;
push(@fl, "fhem.cfg");
push(@fl, "");
push(@fl, FW_fileList("$FW_dir/.*.sh"));
push(@fl, FW_fileList("$FW_dir/.*Util.*"));
push(@fl, FW_fileList("$FW_dir/.*.css"));
push(@fl, "");
push(@fl, FW_fileList("$FW_dir/.*.js"));
push(@fl, "");
push(@fl, FW_fileList("$FW_dir/.*.gplot"));
@ -1479,7 +1483,7 @@ FW_style($$)
my $row = 0;
foreach my $file (@fl) {
pO "<tr class=\"" . ($row?"odd":"even") . "\">";
pH $file, $file, 1;
pO "<td><a href=\"$FW_ME/$file\">$file</a></td>";
pO "</tr>";
$row = ($row+1)%2;
}