From 1672f9ace99e4466df8e8183182206c76aae0194 Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Jun 10 2007 09:17:36 +0000 Subject: Initial checkin --- diff --git a/.cvsignore b/.cvsignore index e69de29..3744196 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +digitemp-3.5.0.tar.gz diff --git a/DS9097_Schematic.gif b/DS9097_Schematic.gif new file mode 100644 index 0000000..6bdad2a Binary files /dev/null and b/DS9097_Schematic.gif differ diff --git a/digitemp-3.5.0-cflags.patch b/digitemp-3.5.0-cflags.patch new file mode 100644 index 0000000..924fb27 --- /dev/null +++ b/digitemp-3.5.0-cflags.patch @@ -0,0 +1,14 @@ +Patch by Robert Scheck for digitemp >= 3.5.0, +which forces the use of $RPM_OPT_FLAGS to have a usable -debuginfo package. + +--- digitemp-3.5.0/Makefile 2007-01-01 19:47:02.000000000 +0100 ++++ digitemp-3.5.0/Makefile.cflags 2007-01-07 03:43:45.000000000 +0100 +@@ -13,7 +13,7 @@ + + + CC = gcc +-CFLAGS = -I./src -I./userial -O2 # -g -Wall ++CFLAGS = -I./src -I./userial $(RPM_OPT_FLAGS) + LIBS = -lm + + OBJS = src/digitemp.o src/device_name.o diff --git a/digitemp.spec b/digitemp.spec new file mode 100644 index 0000000..fe31b09 --- /dev/null +++ b/digitemp.spec @@ -0,0 +1,64 @@ +%define with_libusb 1 + +Summary: Dallas Semiconductor 1-wire device reading console application +Name: digitemp +Version: 3.5.0 +Release: 1%{?dist} +License: GPL +Group: Applications/System +URL: http://www.digitemp.com/ +Source0: http://www.digitemp.com/software/linux/%{name}-%{version}.tar.gz +Source1: dthowto.txt +Source2: DS9097_Schematic.gif +Patch0: digitemp-3.5.0-cflags.patch +%if %{with_libusb} +BuildRequires: libusb-devel +%endif +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +%description +DigiTemp is a simple to use console application for reading values from +Dallas Semiconductor 1-wire devices. Its main use is for reading temperature +sensors, but it also reads counters and understands the 1-wire hubs with +devices on different branches of the network. DigiTemp now supports the +following 1-wire temperature sensors: DS18S20 (and DS1820), DS18B20, DS1822, +the DS2438 Smart Battery Monitor, DS2422 and DS2423 Counters, DS2409 +MicroLAN Coupler (used in 1-wire hubs) and the AAG TAI-8540 humidity sensor. + +%prep +%setup -q +%patch0 -p1 -b .cflags +cp -f %{SOURCE1} %{SOURCE2} . + +%build +make ds9097 %{?_smp_mflags} +make ds9097u %{?_smp_mflags} +%if %{with_libusb} +make ds2490 %{?_smp_mflags} +%endif + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1} +install -m 755 digitemp_DS9097 digitemp_DS9097U $RPM_BUILD_ROOT%{_bindir} +%if %{with_libusb} +install -m 755 digitemp_DS2490 $RPM_BUILD_ROOT%{_bindir} +%endif + +iconv -f iso-8859-1 -t utf-8 -o digitemp.1.utf8 digitemp.1 +install -m 644 digitemp.1.utf8 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1 + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +%doc ChangeLog COPYING COPYRIGHT CREDITS FAQ README TODO +%doc dthowto.txt DS9097_Schematic.gif +%{_bindir}/%{name}* +%{_mandir}/man1/%{name}.* + +%changelog +* Sun Jan 07 2007 Robert Scheck 3.5.0-1 +- Upgrade to 3.5.0 +- Initial spec file for Fedora and Red Hat Enterprise Linux diff --git a/dthowto.txt b/dthowto.txt new file mode 100644 index 0000000..cba64c8 --- /dev/null +++ b/dthowto.txt @@ -0,0 +1,111 @@ + + Howto build a Serial Adapter for Dallas DS1820 temperature sensors + + Copyright (c) 2001 by Brian C. Lane + All Rights Reserved + + + + The DigiTemp program for Linux, DOS and Windows 95 uses a simple serial +port adapter to communicate with the Dallas DS1820 digital temperature +sensors. These sensors use a protocol called One-Wire or Micro LAN +(depending on which Dallas documentation you are reading). This protocol +requires only a ground and a data wire to the device. All power is derived +from the data line while it is idle. + + The protocol is NOT RS232! The adapter converts the RS232 voltages into +the +5v needed to communicate with the DS1820. Each byte sent to the serial +port represents one data bit to the DS1820. See Dallas Semiconductor App +Note #74 for more information, or the sourcecode for DigiTemp. + + How To build an adapter + ----------------------- + + If you want a schematic diagram you need to look at page 20 of App. + Note #74 from Dallas Semiconductor ( ) + + + Parts List + ---------- + + 1 DB-25 connector or DB-9 connector + 1 1.5k ohm resistor + 2 1N5818 Schottky Diode + 1 1N5228 3.9v Zener Diode + 1 1N5234 6.2v Zener Diode + 1 2 position terminal block (for connecting the sensors to adapter) + + Wire cutters and a soldering iron. + + In this document I will refer to the pin functions. The pin numbers for + DB-25 and DB-9 are as follows: + + Name DB-25 DB-9 + ---- ----- ---- + DTR 20 4 + RXD 3 2 + TXD 2 3 + GND 1,7 5 + + NOTE: I have not built a DB-9 version myself. Please let me know if you + successfully build one or have problems with it. + + On the DB-25 pins 1 and 7 must BOTH be connected together. + + + Step Description + ------------------------------------------------------------------------ + 1. Solder the 1N5228 3.9v Zener between GND and DTR with the + Cathode(the stripe) towards DTR. + + 2. Solder the 1.5k ohm resistor between RXD and TXD. + + 3. Solder one of the 1N5818 diodes between RXD and TXD with the + Cathode(the stripe) towards RXD. + + 4. Solder the other 1N5818 diode between RXD and DTR with the + Cathode(the stripe) towsrds DTR. + + 5. Solder the 1N5234 6.2v Zener between RXD and DTR with the + Cathode(the stripe) towards DTR. + + 6. Solder RXD to one pin of the terminal block and paint it + black. This is the GND connection for the sensors. + + 7. Solder DTR to the other pin of the terminal block and paint + it red. This is the DATA connection for the sensors. + + + There! Now you have an adapter. + + Connecting the sensors + ---------------------- + + You need to connect to wires to the sensor to attach to the terminal +block. If you look at the sensor so that the label is towards you, with the +pins facing down the pins are from left to right: + + 1. GND + 2. DATA + 3. +5v + + Solder your wires to GND and DATA and connect them to the terminal block +and you're done! Be careful not to overheat the sensor while soldering to +it. My method is to tin the legs quickly and let them cool off (while +tinning the others) and then to tin the wires, then attach them quickly with +a minimum of heat applied. + + One additional note: Because of the voltage(and current) drop across the +resistor this adapter isn't capable of providing enough current to read +temperatures above about +70C. This is a limitation of the design, not an +error with the DS1820 or the software. + + If you have any questions or comments, email me at bcl@brianlane.com or +subscribe to the digitemp mailing list by sending a blank email to +digitemp-subscribe@brianlane.com + + Brian Lane + bcl@brianlane.com + http://www.brianlane.com + + March 13, 2001 diff --git a/sources b/sources index e69de29..6ac32b9 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +72bda9c8a66b017aa969c19dedb3225b digitemp-3.5.0.tar.gz