usb thermometer - TEMPer - FreeBSD

View: New views
7 Messages — Rating Filter:   Alert me  

usb thermometer - TEMPer - FreeBSD

by Torfinn Ingolfsen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I got a new usb gadget, a TEMPer[1]. According to info on the net, this
thermometer is a I2C device hooked up to a usb serial chip[2, 3]. The
usb-to-serial chip is a WinChipHead 340 / 341, so that should work with
the uchcom[4] driver. There was discussion about MFC'in this driver to
RELENG_7 in february last year[5], but it doesn't seem to have happened.

I tried garbbing the uchcom driver files from cvsweb and compiling the
driver on my RELENG_7, but that didn't work. RELENG_7 as in
root@kg-work2# uname -a
FreeBSD kg-work2.kg4.no 7.1-STABLE FreeBSD 7.1-STABLE #4: Sun Feb  8
20:56:08 CET 2009     root@...:/usr/obj/usr/src/sys/SX270
i386


Any hints on how I can get this gadget working on FreeBSD?

References:
1) http://www.dealextreme.com/details.dx/sku.7003
2) http://err.no/personal/blog/tech/2008-07-22-10-17_kernel_patches_TEMPer_thermometer.html
3) http://tech.arantius.com/working-external-linux-thermometer
4) http://www.freebsd.org/cgi/man.cgi?query=uchcom&apropos=0&sektion=0&manpath=FreeBSD+8-current&format=html
5) http://markmail.org/message/4w324qx4usmnd4ic#query:uchcom+page:1+mid:ecwpudhls4jqpr5s+state:results
--
Regards,
Torfinn Ingolfsen

_______________________________________________
freebsd-usb@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscribe@..."

Re: usb thermometer - TEMPer - FreeBSD

by Gavin Atkinson-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 14 Apr 2009, Torfinn Ingolfsen wrote:

> I got a new usb gadget, a TEMPer[1]. According to info on the net, this
> thermometer is a I2C device hooked up to a usb serial chip[2, 3]. The
> usb-to-serial chip is a WinChipHead 340 / 341, so that should work with
> the uchcom[4] driver. There was discussion about MFC'in this driver to
> RELENG_7 in february last year[5], but it doesn't seem to have happened.
>
> I tried garbbing the uchcom driver files from cvsweb and compiling the
> driver on my RELENG_7, but that didn't work. RELENG_7 as in
> root@kg-work2# uname -a
> FreeBSD kg-work2.kg4.no 7.1-STABLE FreeBSD 7.1-STABLE #4: Sun Feb  8
> 20:56:08 CET 2009     root@...:/usr/obj/usr/src/sys/SX270
> i386

You don't say from what point in time you grabbed the driver from HEAD,
but two major changes have happened in HEAD over the last few months that
may well hinder your progress somewhat: The USB stack and drivers have
been entirely replaced with a new USB stack, and the TTY subsystem has
been heavily changed so that it no longer uses the Giant lock.

Looking at the driver, I'm not sure if the latter will actually cause any
problems for you, but the former will, so I'd recommend that you start
with the uchcom source from before the new USB stack import:
http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/src/sys/dev/usb/Attic/uchcom.c?rev=1.1;content-type=text%2Fplain

I wouldn't be too surprised if you find that compiles and works as-is.

Gavin
_______________________________________________
freebsd-usb@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscribe@..."

Re: usb thermometer - TEMPer - FreeBSD

by Torfinn Ingolfsen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 14 Apr 2009 23:57:27 +0200
Torfinn Ingolfsen <torfinn.ingolfsen@...> wrote:

> I got a new usb gadget, a TEMPer[1]. According to info on the net,

A small update. I tried this gadget with FreeBSD 8.0-rc2.
Without uchcom loaded it prints this in /var/log/messages:
Nov  1 21:25:33 kg-t2 root: Unknown USB device: vendor 0x4348 product 0x5523 bus uhub0
Nov  1 21:25:33 kg-t2 kernel: ugen0.2: <vendor 0x4348> at usbus0

If I insert the gadget after loading the uchcom driver, the machine panics. The same happens if I load the driver with the gadget inserted. No core dump.

I've trie this on two different machines, one running the i386 and the other the amd64 version of FreeBSD 8.0-RC2.
Both panics with the uchcom driver and this gadget.

References:
1) http://www.dealextreme.com/details.dx/sku.7003
--
Regards,
Torfinn Ingolfsen

_______________________________________________
freebsd-usb@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscribe@..."

Re: usb thermometer - TEMPer - FreeBSD

by Hans Petter Selasky :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sunday 01 November 2009 21:31:54 Torfinn Ingolfsen wrote:

> On Tue, 14 Apr 2009 23:57:27 +0200
>
> Torfinn Ingolfsen <torfinn.ingolfsen@...> wrote:
> > I got a new usb gadget, a TEMPer[1]. According to info on the net,
>
> A small update. I tried this gadget with FreeBSD 8.0-rc2.
> Without uchcom loaded it prints this in /var/log/messages:
> Nov  1 21:25:33 kg-t2 root: Unknown USB device: vendor 0x4348 product
> 0x5523 bus uhub0 Nov  1 21:25:33 kg-t2 kernel: ugen0.2: <vendor 0x4348> at
> usbus0
>
> If I insert the gadget after loading the uchcom driver, the machine panics.
> The same happens if I load the driver with the gadget inserted. No core
> dump.
>
> I've trie this on two different machines, one running the i386 and the
> other the amd64 version of FreeBSD 8.0-RC2. Both panics with the uchcom
> driver and this gadget.
>
> References:
> 1) http://www.dealextreme.com/details.dx/sku.7003

Hi,

Try to fetch:

/sys/dev/usb/serial/uchcom.c

From FreeBSD 9-current and rebuild the uchcom module or kernel.

Known issue I think.

--HPS

_______________________________________________
freebsd-usb@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscribe@..."

Re: usb thermometer - TEMPer - FreeBSD

by Torfinn Ingolfsen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, 01 Nov 2009 22:09:34 +0100
Hans Petter Selasky <hselasky@...> wrote:

> Try to fetch:
>
> /sys/dev/usb/serial/uchcom.c
>
> From FreeBSD 9-current and rebuild the uchcom module or kernel.

I noticed that the latest uchcom.c had been MFC'ed to RELENG_8, so I
fetched and built that instead.
root@kg-t2# uname -a
FreeBSD kg-t2.kg4.no 8.0-RC2 FreeBSD 8.0-RC2 #0: Tue Nov  3 20:13:10 CET 2009     root@...:/usr/obj/usr/src/sys/GENERIC  i386

And in /var/log/messages I see:
Nov  3 22:17:43 kg-t2 kernel: ugen0.2: <vendor 0x4348> at usbus0
Nov  3 22:17:43 kg-t2 kernel: ucom0: <vendor 0x4348 USB-SER!, rev 1.10/2.50, addr 2> on usbus0
Nov  3 22:17:43 kg-t2 kernel: ucom0: CH340 detected
and usbconfig shows:
root@kg-t2# usbconfig list
ugen0.1: <UHCI root HUB Intel> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
ugen0.2: <USB-SER! vendor 0x4348> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON

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

--
Regards,
Torfinn Ingolfsen

_______________________________________________
freebsd-usb@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscribe@..."

Re: usb thermometer - TEMPer - FreeBSD

by Hans Petter Selasky :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tuesday 03 November 2009 22:27:03 Torfinn Ingolfsen wrote:

> On Sun, 01 Nov 2009 22:09:34 +0100
>
> Hans Petter Selasky <hselasky@...> wrote:
> > Try to fetch:
> >
> > /sys/dev/usb/serial/uchcom.c
> >
> > From FreeBSD 9-current and rebuild the uchcom module or kernel.
>
> I noticed that the latest uchcom.c had been MFC'ed to RELENG_8, so I
> fetched and built that instead.
> root@kg-t2# uname -a
> FreeBSD kg-t2.kg4.no 8.0-RC2 FreeBSD 8.0-RC2 #0: Tue Nov  3 20:13:10 CET
> 2009     root@...:/usr/obj/usr/src/sys/GENERIC  i386
>
> And in /var/log/messages I see:
> Nov  3 22:17:43 kg-t2 kernel: ugen0.2: <vendor 0x4348> at usbus0
> Nov  3 22:17:43 kg-t2 kernel: ucom0: <vendor 0x4348 USB-SER!, rev
> 1.10/2.50, addr 2> on usbus0 Nov  3 22:17:43 kg-t2 kernel: ucom0: CH340
> detected
> and usbconfig shows:
> root@kg-t2# usbconfig list
> ugen0.1: <UHCI root HUB Intel> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps)
> pwr=ON ugen0.2: <USB-SER! vendor 0x4348> at usbus0, cfg=0 md=HOST spd=FULL
> (12Mbps) pwr=ON
>
> 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

--HPS

_______________________________________________
freebsd-usb@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscribe@..."

Re: usb thermometer - TEMPer - FreeBSD

by Torfinn Ingolfsen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, 03 Nov 2009 22:56:57 +0100
Hans Petter Selasky <hselasky@...> 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

Ah! I did know that, but had forgotten and that "ucom0:" in the output
confused me. Thanks!

Here is an idea: could we have the class of devices (usb devices that
create / use ttys) report which tty they are using when they attach?
Ie, instead of
ucom0: CH340 detected

We could have:
ucom0: CH340  detected, using /dev/cuaU0
or something like that?
I don't care if it is the driver, ther kenel or another part of FreeBSd
that outpus this information, I just want it t be presented to the user.

Just my 0.02 eurocents.
--
Regards,
Torfinn Ingolfsen

_______________________________________________
freebsd-usb@... mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscribe@..."