From owner-freebsd-usb@FreeBSD.ORG Mon Dec 28 18:26:23 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85C261065692 for ; Mon, 28 Dec 2009 18:26:23 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe12.tele2.se [212.247.155.97]) by mx1.freebsd.org (Postfix) with ESMTP id DCEFB8FC1C for ; Mon, 28 Dec 2009 18:26:22 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=YgHpy36AcwMA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:17 a=8kQB0OdkAAAA:8 a=VIg4IsYjAAAA:8 a=w6RbqzLyAAAA:20 a=xfDWc_zsz8en8I3Ffj4A:9 a=ZVpAf9J51g2gPZwZUl8A:7 a=O4iS4xraafPUFW4nuKfK3xyEvvsA:4 a=9aOQ2cSd83gA:10 Received: from [188.126.201.140] (account mc467741@c2i.net HELO laptop.adsl.tele2.no) by mailfe12.swip.net (CommuniGate Pro SMTP 5.2.16) with ESMTPA id 1157412084; Mon, 28 Dec 2009 19:26:20 +0100 From: Hans Petter Selasky To: freebsd-usb@freebsd.org Date: Mon, 28 Dec 2009 19:28:28 +0100 User-Agent: KMail/1.11.4 (FreeBSD/9.0-CURRENT; KDE/4.2.4; i386; ; ) References: <20090414235727.38d16ee1.torfinn.ingolfsen@broadpark.no> <200911032256.58552.hselasky@c2i.net> <20091228020056.9d2df2d3.torfinn.ingolfsen@broadpark.no> In-Reply-To: <20091228020056.9d2df2d3.torfinn.ingolfsen@broadpark.no> X-Face: (%:6u[ldzJ`0qjD7sCkfdMmD*RxpOwEEQ+KWt[{J#x6ow~JO:,zwp.(t; @Aq :4:&nFCgDb8[3oIeTb^'",;u{5{}C9>"PuY\)!=#\u9SSM-nz8+SR~B\!qBv MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200912281928.29262.hselasky@c2i.net> Cc: Subject: Re: usb thermometer - TEMPer - FreeBSD X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Dec 2009 18:26:23 -0000 On Monday 28 December 2009 02:00:56 Torfinn Ingolfsen wrote: > On Tue, 03 Nov 2009 22:56:57 +0100 > > Hans Petter Selasky wrote: > > On Tuesday 03 November 2009 22:27:03 Torfinn Ingolfsen wrote: > > > But where is ucom0? > > > root@kg-t2# ls -l /dev/uc* > > > ls: /dev/uc*: No such file or directory > > > root@kg-t2# ls -l /dev/ucom0 > > > ls: /dev/ucom0: No such file or directory > > > root@kg-t2# ls -l /dev/ucom0 > > > > /dev/cuaU0 > > Ok, I have done some more testing with the TEMPer. I have kldloaded uchcom. > root@testhost-1# uname -a > FreeBSD testhost-1.kg4.no 8.0-STABLE FreeBSD 8.0-STABLE #0: Sat Dec 12 > 23:49:41 CET 2009 root@testhost-1.kg4.no:/usr/obj/usr/src/sys/GENERIC > amd64 In /var/log/messages: > Dec 27 23:07:43 testhost-1 kernel: ugen1.2: at usbus1 > Dec 27 23:07:43 testhost-1 kernel: ucom0: 1.10/2.50, addr 2> on usbus1 Dec 27 23:07:43 testhost-1 kernel: ucom0: > CH340 detected > I took TEMPer.c[1] from Tollef Fog Heen's site, changed the device from > /dev/ttyUSB0 to /dev/ttyU0 and compiled with > > gcc -lm -o TEMPer2 TEMPer2.c > > and tested it: > root@testhost-1# ./TEMPer2 > Init starting > Init done > ^Croot@testhost-1# > It hangs after "Init done" until I break out of it with Ctrl-C. This is > strange, the same code works fine un Linux: tingo@kg-home:~$ uname -a > Linux kg-home 2.6.31-16-generic #53-Ubuntu SMP Tue Dec 8 04:01:29 UTC 2009 > i686 GNU/Linux tingo@kg-home:~$ ~/work/temper/TEMPer > Init starting > Init done > Getting temperature done 0001100010000000. 24.500000 > Getting temperature done 0001100010000000. 24.500000 > Getting temperature done 0001100010000000. 24.500000 > Getting temperature done 0001100100000000. 25.000000 > Getting temperature done 0001100010000000. 24.500000 > Getting temperature done 0001100000000000. 24.000000 > Getting temperature done 0001100000000000. 24.000000 > Getting temperature done 0001100010000000. 24.500000 > Getting temperature done 0001100010000000. 24.500000 > Getting temperature done 0001100100000000. 25.000000 > ^C > > I wonder if it is the driver in FreeBSD or something different in the tty > initialization? Anyway, I have made a FreeBSD[2] and a Linux[3] page with > all the details. > > References: > 1) http://err.no/src/TEMPer.c > 2) http://sites.google.com/site/tingox/temper_freebsd > 3) http://sites.google.com/site/tingox/temper_xubuntu Hi, I think you need to turn off line buffering on stdin/stdout. There should be an ioctl somewhere. --HPS