Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Dec 2009 19:28:28 +0100
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        freebsd-usb@freebsd.org
Subject:   Re: usb thermometer - TEMPer - FreeBSD
Message-ID:  <200912281928.29262.hselasky@c2i.net>
In-Reply-To: <20091228020056.9d2df2d3.torfinn.ingolfsen@broadpark.no>
References:  <20090414235727.38d16ee1.torfinn.ingolfsen@broadpark.no> <200911032256.58552.hselasky@c2i.net> <20091228020056.9d2df2d3.torfinn.ingolfsen@broadpark.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday 28 December 2009 02:00:56 Torfinn Ingolfsen wrote:
> On Tue, 03 Nov 2009 22:56:57 +0100
>
> Hans Petter Selasky <hselasky@c2i.net> 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: <vendor 0x4348> at usbus1
> Dec 27 23:07:43 testhost-1 kernel: ucom0: <vendor 0x4348 USB-SER!, rev
> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912281928.29262.hselasky>