[beagleboard] Re: trying to learn enough to get started

2014-09-25 Thread jfsbac
Sounds like you need some EE courses with control theory ;)  Since you are 
controlling a greenhouse with a considerable amount of wiring, it sounds 
like your relays and A/D will be far from your main controller (BBB). 
 Light to medium duty mechanical relays need 12VDC and a relay driver, 
heavy duty relays require 110VAC.  If the controlled devices are far (more 
than a few feet) you have to worry about voltage drops across the wiring, 
especially if the control signals are bridging the distance (ie the relay 
is near the controlled device).  Some sort of distributed control might be 
in order.  By that I mean an Arduino like micro (there are a couple of 
small compatible boards out there) controlling one or several relays on 
command from the BBB and reporting status back, over serial (RS485 is 
multi-drop) or wireless like Zigbee.  Relays are open loop type devices, 
there is no built-in feedback to know they have closed, usually one just 
assumes they closed within the time they specify.  An interrupt on closing 
would have to be an added circuit, do you really need it?  Hmm, you don't 
say if you are using mechanical or Solid State relays.  If there are Capes 
with relays, I would expect they would have an external power input.  Make 
sure to pay attention to the power required to size your supply.

www.controlanything.com has been making relay control boards for years, 
starting with RS232 and migrating to USB, Zigbee, and now ethernet/wifi. 
 They may not be what you want, but they have some good application and 
usage notes.  If you are controlling heavy loads you have to worry about 
noise feedback.  

I would start by making a block diagram of the setup, then listing all the 
devices controlled and monitored and their requirements (current, voltage, 
distance from the main controller, etc).

Don't forget about enclosures.  Greenhouses are pretty humid, damp and 
electronics does NOT like moisture.  It sounds like you have an interesting 
and challenging project.

I hope this helps,

Jonathan

On Saturday, September 6, 2014 7:33:29 PM UTC-4, ccrisle...@gmail.com wrote:

 The original question was one of hardware. I can figure out the software 
 based on what I know and feel comfortable with. My question is: how do I 
 control roughly 20 relays, some that I need to set and some that I need to 
 'read', ideally as an interrupt when they close? I also need to work with a 
 couple of A/D inputs, mainly temperature. From the documentation that I 
 have seen, no cape can support that many relays, so I need multiple capes. 
 How do I do that? Can they be stacked? Can I use I2C to select the address 
 to 'write' to in order to energise the relay coil? How do I organize them 
 to allow I2C to select an address through multiple capes? How do I get the 
 power to drive a relay? TTL logic can't do that. These are my fundamental 
 questions. Where can I go to get the answers? I really want to learn rather 
 than be handed answers. I can deal with the software issues well enough, it 
 is the hardware decisions that are stumping me.

 On Wednesday, September 3, 2014 10:24:01 PM UTC-4, ccrisle...@gmail.com 
 wrote:

 I have a significant project that I want to accomplish this fall/winter. 
 I would like to build a digital controller for my greenhouse. I have been a 
 software engineer for 35 years so the programming will be easy. I don't 
 have any experience with microprocessors and need to learn so that I can 
 do. What introductory and intermediate sources of information would people 
 recommend? I am thinking about a BBB running Ubuntu but am open to 
 suggestions.

 Thank you,
 Chuck Crisler



-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
BeagleBoard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[beagleboard] Re: Getting comms going on UART1

2014-09-23 Thread jfsbac
Hi,

Not and expert here, but I did manage to get communication with a device 
connected to UART1.  What do you have connected?  If there is nothing there 
your transmit data will just go off into space.  To see data come back you 
would have to have a device in loopback mode, or at least the Tx connected 
to the Rx.  

I am running the Debian image, and used the ADAFRUIT-UART2 overlay.  It 
shows up as ttyo1 (thats oh one, not zero one).  I have a Sparkfun MAX3232 
module that translates the 3V TTL to RS232 which goes to a little micro 
that responds to commands like /sh/s and returns some text.  I use screen 
to type the text commands until I get my C program working on the BBB, or 
try javascript.  Oh, there are also two Zigbee modules in between the micro 
and the BBB creating a wireless RS232 link.

Hope this helps,

Jonathan

On Monday, September 22, 2014 12:35:56 PM UTC-4, Julian Gold wrote:

 Oh, my board revision is B6.

 On Monday, 22 September 2014 17:34:44 UTC+1, Julian Gold wrote:

 I've been struggling to get serial comms going on UART1. I have enabled 
 it by creating a service that performs

 echo BB-UART1  /sys/devices/bone_capemgr.9/slots

 and lo! the device /dev/ttyO1 appears. However, with two terminal windows 
 open, doing 'cat /dev/ttyO1' in one and 'echo wibble  /dev/ttyO1' in the 
 other results in nothing at all appearing in the cat window. I've tried 
 several combinations of baud rates and flow control, with no success. What 
 am I missing?



-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
BeagleBoard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[beagleboard] Re: How to use UART Serial Port Using BoneScript Library

2014-09-12 Thread jfsbac
I tried to use this example to write to a device I have connected to serial 
port /dev/ttyO1.  I know the device answers because I can use screen and 
get responses.  My code to send out /sh/s is:

var b = require('bonescript');

var cmd = '/sh/s';

var port = '/dev/ttyO1';

var options = {

baudrate: 9600

};


b.serialOpen(port, options, onSerial);


b.serialWrite(port, cmd);


function onSerial(x) {

if (x.err) {

console.log('***ERROR*** ' + JSON.stringify(x));

}

if (x.event == 'open') {

   console.log('***OPENED***');

}

if (x.event == 'data') {

console.log(String(x.data));

}

}

I get the following response:

debian@beaglebone:~/nodews$ node shedrd.js 


/usr/local/lib/node_modules/bonescript/my.js:55

var slotRegex = new RegExp('\\d+(?=\\s*:.*,bs.*' + pin.key + 
')', 

  ^

TypeError: Cannot read property 'key' of undefined

at Object.exports.load_dt 
(/usr/local/lib/node_modules/bonescript/my.js:55:67)

at Object.newFunction [as serialOpen] 
(/usr/local/lib/node_modules/bonescript/my.js:228:25)

at Object.anonymous (/home/debian/nodews/shedrd.js:8:3)

at Module._compile (module.js:456:26)

at Object.Module._extensions..js (module.js:474:10)

at Module.load (module.js:356:32)

at Function.Module._load (module.js:312:12)

at Function.Module.runMain (module.js:497:10)

at startup (node.js:119:16)

at node.js:902:3

debian@beaglebone:~/nodews$

Thanks for the help

Jonathan


On Monday, April 7, 2014 1:13:13 PM UTC-4, Jason Kridner wrote:



 On Thursday, March 27, 2014 4:59:00 PM UTC-4, Mark A. Yoder wrote:

 Nick:
   I have some bonescript code that works with the UART, but I'm not using 
 the built-in bonescript calls. It works fine with a GPS, though I don't use 
 it to transmit.

 I took would like to see an example that uses the bonescript calls. 


 I haven't had a chance to try it out as I don't have a device easy to 
 wire-up until later today, but can you try out this live in-a-webpage 
 example at: http://jsfiddle.net/jkridner/AjnJs/

  

  Before ruing the code you need to:

 beagle# *npm install -g serialport*


 BoneScript simply uses this same library, so using BoneScript avoids 
 needing to install it.
  


 beagle# *echo BB-UART4  /sys/devices/bone_capemgr.*/slots*


 BoneScript loads this same overlay for you.

 A basic listening example would be:

 var b = require('bonescript');
 var port = '/dev/ttyO4';
 var options = {
 baudrate: 115200
 };

 b.serialOpen(port, options, onSerial);

 function onSerial(x) {
 if (x.err) {
 console.log('***ERROR*** ' + JSON.stringify(x));
 }
 if (x.event == 'open') {
console.log('***OPENED***');
 }
 if (x.event == 'data') {
 console.log(String(x.data));
 }
 }

 To write, you'd do:

 b.serialWrite(port, data);


 Hopefully you'll see some value in the simplicity.

  


 --Mark
 #!/usr/bin/env node
 // From: https://github.com/voodootikigod/node-serialport
 // From: https://github.com/jamesp/node-nmea

 var b = require('bonescript');
 var nmea = require('nmea');

 //console.log(b.serialOpen);

 //var sp = b.serialOpen('/dev/ttyO4', {baudrate: 9600} );
 // parser: b.serialParsers.readline(\n)});


 var serialport = require(serialport);
 var SerialPort = serialport.SerialPort; // localize object constructor

 var sp = new SerialPort(/dev/ttyO4, {
 parser: serialport.parsers.readline(\n)
 });

 sp.on(data, function (data) {
 console.log(here: +data);
 console.log(nmea.parse(data));
 });


 On Thursday, December 19, 2013 1:49:30 AM UTC-5, Nick Farrell wrote:

 I am a newbie to BeagleBone Black(BBB) but have good knowledge about 
 Arduino. I would like to know how to open a serial port in BBB using the 4 
 UARTs available in BBB using BoneScript library and use cloud9 ide to see 
 the serial data on the console. Can anyone help me on this issue.



-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
BeagleBoard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[beagleboard] BBB Debian Distribution Web Page Questions

2014-08-27 Thread jfsbac
Hello,

I have a BeagleBone Black running the Debian distribution.  I am looking at 
the web page setup and the interface with node.js in preparation to set up 
my own web page that will display some information that I am reading over a 
serial port.  It appears that Apache is running as the web server as I see 
apache2 processes.  I understand that node.js can be its own web server, so 
I am a little perplexed why apache is used in addition to node.js and how 
node.js works with apache.  

I also don't see the web pages in the normal /var/www/ location and am 
wondering where they are located.

Thanks

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
BeagleBoard group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.