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