Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Aug 2016 14:41:41 -0600 (MDT)
From:      Warren Block <wblock@wonkity.com>
To:        Warner Losh <imp@bsdimp.com>
Cc:        Gary Palmer <gpalmer@freebsd.org>, "freebsd-usb@FreeBSD.org" <freebsd-usb@freebsd.org>
Subject:   Re: Digi Watchport/T temperature sensor as /dev/ttyU
Message-ID:  <alpine.BSF.2.20.1608091427030.36030@wonkity.com>
In-Reply-To: <CANCZdfr8Ygi_rtqF=Wi=aq3BuOVZUohz-HPg6UaBKjC-1VAXfw@mail.gmail.com>
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> <CAN6yY1tUg0GeNn6hkO9NPKyKO2z58erzOYT3PkYSQ1yiX0t0Gg@mail.gmail.com> <CANCZdfoVnZHmmvNcrJgaZ2k8o6e150LGFa0svufgodn6jeJu0Q@mail.gmail.com> <1469387555.84197.48.camel@freebsd.org> <20160809083654.25d2ac67@freyja.zeit4.iv.bundesimmobilien.de> <57A9DA8F.5000603@denninger.net> <20160809141054.GA47566@in-addr.com> <CANCZdfr8Ygi_rtqF=Wi=aq3BuOVZUohz-HPg6UaBKjC-1VAXfw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



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