(http://inet-deal.mpa.ru/forum/file.php?a=photo&ph=71&key=ebfeb1fa) | Не всегда нумерация пинов на материнской плате соответствует нумерации пинов разъема DB9 компорта, в таком случае использовать "стандартную" колодку, где пины разведены один к одному, нельзя! Описание стандарта rs232: http://www.gaw.ru/html.cgi/txt/interface/rs232/start.htm (http://www.gaw.ru/html.cgi/txt/interface/rs232/start.htm) |
Digitemp on small TP-Link WR703N wireless router
Measuring ambient temperature with cheap Dallas sensor DS18B20 (~ 1$) over USB 2.0 to UART TTL 6PIN Module Serial Converter CP2102 (~1,50 $) and showing temperature on simple static html web page hosted on wireless router TP-Link WR703N (~ 25$), acting as cheap wireless “meteo” station.
We need wireless router TP-Link WR703N with OpenWrt image on it. If you don’t know how to flash with OpenWrt, take a look on great OpenWrt Wiki page.
Simple electronic circuit
You can order USB 2.0 to UART TTL 6PIN Module Serial Converter CP2102 from e-bay and Dallas sensor DS18B20 from Maxim-IC (or you can acquire one free sample
– connect GND and +5V to DS18B20
– connect RX and TX together and to thedata line of 1-wire sensor DS18B20
– that’s all
(http://inet-deal.mpa.ru/forum/file.php?a=photo&ph=108&key=11ed4833) sch.PNG | (http://inet-deal.mpa.ru/forum/file.php?a=photo&ph=109&key=da85a122) conv.JPG |
(http://inet-deal.mpa.ru/forum/file.php?a=photo&ph=100&key=26884148) | (http://inet-deal.mpa.ru/forum/file.php?a=photo&ph=98&key=05206621) |
#!/bin/sh
# -*- sh -*-
: << =cut
=head1 NAME
digitemp_ - Plugin to monitor Dallas 1-wire temperature sensors using
digitemp
=head1 CONFIGURATION
The following enviroment variables are used by this plugin:
digitemprc - config file to use. (Default /etc/digitemp.conf)
This must be generated with digitemp_<model> -i
=head1 USAGE
Symlink as the name of the digitemp program to use, i.e. digitemp_DS2490
=head1 AUTHOR
Copyright © 2006 Dagfinn Ilmari Mannsaaker <ilmari@ilmari.org>
=head1 LICENSE
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 dated June, 1991.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
=head1 MAGIC MARKERS
#%# family=manual
=cut
digitemp="/usr/local/bin/digitemp_DS9097"
#${0##*/}
model=${digitemp##*_}
digitemprc=${digitemprc:-/etc/digitemp.conf}
if ! [ -x "`which $digitemp`" ]; then
echo "$digitemp not found" >&2
exit 1
fi
if [ "$1" = "config" ]; then
echo "graph_title DigiTemp $model temperatures"
echo 'graph_vlabel degrees C'
echo 'graph_category sensors'
echo "graph_info This graph shows the temperature read from $model 1-wire sensors"
$digitemp -c "$digitemprc" -q -a -o '%s %R' | grep -v ^Found | while read sensor serial; do
echo "sensor$serial.label sensor #$sensor"
echo "sensor$serial.type GAUGE"
echo "sensor$serial.info Temperature from sensor #$sensor"
echo "sensor$serial.critical 35"
echo "sensor$serial.warning 30"
done
exit 0
fi
$digitemp -c "$digitemprc" -q -a -o 'sensor%R.value %C'|\
awk '/sensor/ {
if ($2 == 85) $2 = 12;
if ($2 <= 13)
system("echo \"Temperature too low= \"" $2 "|\
mail -s \"Warning from host!!!\" root"); printf "%s %0.2f \r\n", $1, $2 }'
Этот форум работает на скрипте Intellect Board
© 2004-2007, 4X_Pro, Объединенный Открытый Проект, Разнообразная информация
2004, Все права на содержимое сайта принадлежат его владельцу и охраняются законодательством