From owner-freebsd-usb@freebsd.org Tue Aug 9 20:41:45 2016 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F1E1BB448E for ; Tue, 9 Aug 2016 20:41:45 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E33D16F3; Tue, 9 Aug 2016 20:41:45 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.15.2/8.15.2) with ESMTPS id u79Kffre068059 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 9 Aug 2016 14:41:41 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.15.2/8.15.2/Submit) with ESMTP id u79Kffq8068056; Tue, 9 Aug 2016 14:41:41 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Tue, 9 Aug 2016 14:41:41 -0600 (MDT) From: Warren Block To: Warner Losh cc: Gary Palmer , "freebsd-usb@FreeBSD.org" Subject: Re: Digi Watchport/T temperature sensor as /dev/ttyU In-Reply-To: Message-ID: References: <1469306951.84197.31.camel@freebsd.org> <20160724080330.3a27e875.ohartman@zedat.fu-berlin.de> <20160724083859.4c0dd392@ernst.home> <20160724105134.184f0b7f.ohartman@zedat.fu-berlin.de> <1469379334.84197.40.camel@freebsd.org> <1469387555.84197.48.camel@freebsd.org> <20160809083654.25d2ac67@freyja.zeit4.iv.bundesimmobilien.de> <57A9DA8F.5000603@denninger.net> <20160809141054.GA47566@in-addr.com> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (wonkity.com [127.0.0.1]); Tue, 09 Aug 2016 14:41:41 -0600 (MDT) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2016 20:41:45 -0000 On Tue, 9 Aug 2016, Warner Losh wrote: > 18B20 doesn't support humidity. The kernel also supports reading > it periodically and reporting the results via a sysctl now that we have > onewire support in the kernel. This has worked better for me than > reading them from Python... > >> If you want humidity also then there is the DHT22 or DHT11, both >> of which can be tied to the PI but need a GPIO pin per sensor. I >> haven't tried either of them personally. > > Those work, but same here. I've not tried them personally. I have half a dozen of the DHT21 here, connected to ES8266 boards, reporting temperature and humidity wirelessly, standard 802.11g. http://www.electrodragon.com/product/nodemcu-lua-amica-r2-esp8266-wifi-board/ http://www.electrodragon.com/product/am2301-dht21-digital-temperature-humidity-sensor/ My software has them wake up, take measurements, and report to an MQTT broker about once a minute. The rest of the time they are in low-power sleep. The ESP8266 boards are just NodeMCU boards, an ESP8266 with a micro USB port and a 3.3V regulator on a board with headers. These are about $5 US. The DHT21 is about that price or a little less. (Why the DHT21? Because the spec sheet for it claims 3.3V compatibility, while the others are usually 3.5V, which would probably work, but still.) These are all running Arduino, both because of the availability of software modules for things like MQTT and such, and also because the built-in Lua in the NodeMCU was capable of going into low-power sleep, but not waking up. These modules will talk to FreeBSD with any of the standard USB to serial adapters, including CP2102, CH340, and PL2303. I avoid and recommend avoiding FTDI, but they work also. Unfortunately, the later versions of the Arduino software and the ESP8266 compilers have not been ported, so doing the development on FreeBSD is not currently possible. Of course this involves assembling the hardware, putting it in some kind of case, rewriting the firmware from NodeMCU to Arduino, then adding your own application software. It's not terribly involved, but it's not off the shelf.