DHT11 Grove on Beaglebone and general impression on Beaglebone

Hi all (first message in this forum),

I got my Beaglebone Green recently as well as a DHT11 humidity/temperature sensor.
I would like to use it in Bonescript or Python.
I already use Bonescript on the BBB for accessing all my sensors data from my Raspberry (my main “server” written in Java).

I have already a BBB working fine with three temperature sensors (LM35 and DS18B20 to regulate my heating system) (Python) and a light sensor in node js.
Just to say that my experience is not too bad.
As soon as the light is too low outside (on the BBB), the movement sensor on my Raspberry with activate some light in the house.

My DHT11 works fine on an Arduino.
I probably needs some libraries on the BBG and install them.

BBB is really the best “system” I have used up to now (my Galileo “burnt” … but too expensive). Great Cloud9.
The NodeMCU I ordered with the BBG is also a nice cheap “think”.

I think I will try Java on BBB … just for the fun!
Experience: Linux (and driver too … a little bit), C, C++, Java, Ruby, Python and slowly more and more with Bonescript (and the “strange” callback way for an OO guy like me).

Thanks in advance for a quick answer, since I am 67 years old == full time on my small “machines” in winter time!?!

Yes … very “bavard” (talkative in french (switzerland))

Just see now that this blog is not too active!!!???!!!

Expecting a response in under 2 minutes?

Use the irc channel for that..

anywho, the DHT11 is a 5volt analog output sensor.. The adc pins on
the bbb are good too 1.8? so make sure you add some resistors so you
don't blow and pins..

Regards,

The BeagleBone community forum is not too active, sure. It’s a pity for such a good board and concept.
I found today one or two good articles like “Is BoneScript more trouble than its worth?”
I have myself problem every 4-5 days with a Bonescript Web server distributing my sensor data, where I have to add soon a watchdog (a for loop does not help).

With IRC channel, your probably means I2C. Voltage and resistors, it’s clear.
Then, it’s a question of hardware and conditions, like a DS18B20 on my BBB with 5V over a 5 meters cable … and works as a charm.

Anyway, that was not my question here, dealing with the software only.

I believe I found it an hour ago: https://github.com/adafruit/Adafruit_Python_DHT

For the humidity I do not need precision, and for the temperature I will probably add an LM35 or DS18B20.
On my BBB I implemented in Python a function to read many times the two LM35 (2m cables!!), to remove the highest and lowest values, and to compute the average: great result with precision of about .5 degrees are far sufficient.

Thanks Robert: I just consulted now a number of your documents. Very good work!
Regards Robert … and the others

The BeagleBone community forum is not too active, sure. It's a pity for such
a good board and concept.

Are you participating in this discussion by sending email to
beagleboard@googlegroups.com, or via some other way? I see it as an
email stream of a dozen or so messages a day. I'd call it pretty
active.

I found today one or two good articles like "Is BoneScript more trouble than its worth?"
I have myself problem every 4-5 days with a Bonescript Web server
distributing my sensor data, where I have to add soon a watchdog

Do you require constant running, or do you sleep and run? If the
latter, you probably should respawn a fresh interpreter each time, do
the work and quit---otherwise you are at the mercy of memory leaks
that are hard to avoid in an interpreter.

With IRC channel, your probably means I2C. Voltage and resistors, it's clear.

No, IRC is the Internet Relay Chat software, a distributed chat
application that developers tend to use. When people log in into IRC,
they tend to watch it in real time, so potentially It provides more
immediate communication. This list is email-based so everyone has to
actively go and check the new emails.

Then, it's a question of hardware and conditions, like a DS18B20 on my BBB with 5V over a 5 meters cable ... and works as a charm.

If you place an analog voltage greater than 1.8 Volts on the analog
input pin of the BBB, you will destroy that input. This is different
from DS18B20, which has a digital one-wire interface using I think
standard 3.3V digital signaling. Note that 5V is too much: you need to
drop the voltage to 3.3V even for digital signals.

and it looks like mis-read the data sheet... the dh11 actually is a
simple bus, i first thought it was analog out..

It can be powered by 3.3v and there is kernel driver for this:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/iio/humidity/dht11.c?id=refs/tags/v4.5-rc2

and the dt bindings:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/iio/humidity/dht11.txt

Regards,

See my answers below:

The BeagleBone community forum is not too active, sure. It’s a pity for such
a good board and concept.

Are you participating in this discussion by sending email to
beagl...@googlegroups.com, or via some other way? I see it as an
email stream of a dozen or so messages a day. I’d call it pretty
active.

I just use http://beagleboard.org/Community/Forums
Something better?

I found today one or two good articles like “Is BoneScript more trouble than its worth?”
I have myself problem every 4-5 days with a Bonescript Web server
distributing my sensor data, where I have to add soon a watchdog

Do you require constant running, or do you sleep and run? If the
latter, you probably should respawn a fresh interpreter each time, do
the work and quit—otherwise you are at the mercy of memory leaks
that are hard to avoid in an interpreter.

Just this:

#!/bin/bash
cd /root/nodejs
while :
do
exec sudo node bbbserver.js >/dev/null
sleep 1
done

Loop in case bbbserver.js crashes
and:

var http = require(“http”);
var url = require(‘url’);
var fs = require(‘fs’);
var io = require(‘/usr/local/lib/node_modules/socket.io’);
var b = require(‘/usr/local/lib/node_modules/bonescript’);
//Lets define a port on 192.168.1.61 where we want to listen to
const PORT=8001;
//console.log(“Server listening on port %s”, PORT);
var server = http.createServer(function(request, response) {
var path = url.parse(request.url).pathname;
switch(path){
case ‘/’:

break;
case ‘/lightsync’:
response.writeHead(200, {‘Content-Type’: ‘text/plain’});
var reading = b.analogRead(‘P9_40’); //Synchronous light value (< 1.0 Volt))
value = (10000 - ((1.0 - (readingreadingreading)) * 10000)) | 0
response.write(‘’ + value); //string conversion
response.end();
break;
case ‘/fixed.html’:

break;
default:
response.writeHead(404);
response.write(“opps this doesn’t exist - 404”);
response.end();
break;
}
});
server.listen(PORT);
var value = 9999
var listener = io.listen(server);
listener.sockets.on(‘connection’, function(socket) {
b.analogRead(‘P9_40’, computeValue);

socket.emit(‘message’, {‘message’: value});
});
function computeValue(x) {
reading = x.value
value = (10000 - ((1.0 - (readingreadingreading)) * 10000)) | 0
}

The value calculation allows to react more at middle range of light (sensor outside).

My Raspberry calls this BBB Webserver during 2 periods erlay in the morning and the evening up to a predefined time like 23:30 in a config file (not in the night for instance).
My Raspberry computes the sunrise and sunset depending of the seasons, and of some predefined time, will switch on or off the lights connected on my Raspberry relays. Everthing in Java and stable.

By checking the light outside (BBB) I can switch on or off the light depending on the darkness before the sunset period and after the sunrise period.
That system simulates presence too and has a movement sensor too (pratical in the night)

I should probably check the memory leak on the BBB before ps-greping the node bbbserver.js process in a watchdog rebot loop.

With IRC channel, your probably means I2C. Voltage and resistors, it’s clear.

No, IRC is the Internet Relay Chat software, a distributed chat
application that developers tend to use. When people log in into IRC,
they tend to watch it in real time, so potentially It provides more
immediate communication. This list is email-based so everyone has to
actively go and check the new emails.

I understand now, sorry. No need of IRC I think. I think it’s a good way too to search for learning (as well as finding crazy comments)! Although!

Then, it’s a question of hardware and conditions, like a DS18B20 on my BBB with 5V over a 5 meters cable … and works as a charm.

If you place an analog voltage greater than 1.8 Volts on the analog
input pin of the BBB, you will destroy that input. This is different
from DS18B20, which has a digital one-wire interface using I think
standard 3.3V digital signaling. Note that 5V is too much: you need to
drop the voltage to 3.3V even for digital signals.

Thanks for the 1.8V input. I did not care too much!

The way I did: I built my 3 temperature cables (2 with LM35 and one longer going outside) and check them on the Arduino by identifying the right voltage/resistance. Then I installed them, one by one, on the BBB with individual python scripts,

At the end everything goes into one python script running all the time.
The 3 temperatures are read constantly and stored in a delimited file.
One to measure the input of the heating system, another for the output (heatpump (geothermic)) and the last for the outside temperature. With that I was able to adapt the regulation of the heating system to get the best temperature in the house with the best costs (2 different tarifs in the day and better usage of my 60m2 photovolaic panels).
The analysis in made on PC with Excel graph and this is really nice and the result fine!
The python part works from 6 months, the light measurement (Bonescript) recent.

Thanks a lot
Best regards
Jean-Bernard

Thanks a lot Robert

I'd recommend the "show all topics" view:
https://groups.google.com/forum/#!categories/beagleboard

Personally, I have it set to email me every message posted in the forum.

cheers,
drew

show-all.png

view.png

email.png

Yes, great, thanks