Pages: 1 2 [3] 4   Go Down
Author Topic: Event-Based Library for Arduino  (Read 11506 times)
0 Members and 1 Guest are viewing this topic.
Topsham, Vermont USA
Offline Offline
Edison Member
*
Karma: 23
Posts: 1753
... in The Woods In Vermont
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Renato and Everyone,

I am from rural Vermont, USA and this is 'Home', but My wife Mary Alice and I have been working/living overseas last 7 years in Africa, China, Middle East and next year: Genoa, Italy. Couple more years and we will stay home in Vermont. She builds Libraries. I work online from anywhere.

Renato, I feel strongly that your ideas and software are key to doing more interesting and complex things with Arduino.  I would like to help with that and support your work in any way I can.

Interesting and important applications need the kind of organized "multi-tasking" and Event-Driven actions you are talking about:

- Home/Building Automation/Energy Management
- Application-specific Automation, from Machines to Fish Farming, etc., etc.
- Robotics, especially Autonomous Vehicles.

All of these need to handle and coordinate a variety of Sensors, Timers and Counters, Communications, and a variety of actuators.

Many Arduino projects get difficult and bogged down trying to make multiple things work together.  An organized way of building this kind of Arduino application is needed. I hope to write some examples soon...

Arduino, especially the 2560 variants, is perfectly capable of doing these applications.  I built significant automated machinery 20 years ago with big rack-mounted IBM Series/1 etc. But guess what? They had no more processor power or memory and less I/O capability than Arduino!

Let's figure out how to effectively collaborate and get this working.

Regards, Terry King
...In The Woods In Vermont
terry@yourduino.com

(STILL locked out of primary account here!)


Logged

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can also use templates.
http://www.artima.com/weblogs/viewpost.jsp?thread=84958
http://www.artima.com/weblogs/viewpost.jsp?thread=85301
« Last Edit: July 16, 2011, 02:25:15 pm by gentoouser » Logged

São Paulo
Offline Offline
Jr. Member
**
Karma: 0
Posts: 55
Renato
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Terry, I already created a project for it on google code, but I'm avoid speaking about in this topic to preserve it's focus. Unfortunately I'm needing to priorize some other small activities in these days, but I will try to keep you updated by email. I'm not receiving any reply from you. I'm not sure if it's because you're not receiving my messages or just not understanding my `brazilian english´.
Logged

Topsham, Vermont USA
Offline Offline
Edison Member
*
Karma: 23
Posts: 1753
... in The Woods In Vermont
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

PING --> ACK!

Hi Renato, I'm working on some definitions about Timers and Counter for discussion.

I'm In!

Regards, Terry King
...In The Woods In Vermont
terry@yourduino.com
Logged

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

São Paulo
Offline Offline
Jr. Member
**
Karma: 0
Posts: 55
Renato
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

 smiley-grin
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Guys...I love where this project is going.  Count me in for testing, debugging, contributions.  I have a project that I want to test these libs out on...things that need to eat timers and throw multiple events.  It will be a good test.  I'll get back with you on the results.
Logged

São Paulo
Offline Offline
Jr. Member
**
Karma: 0
Posts: 55
Renato
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Be welcome, mdrunk.  smiley-lol
Logged

Topsham, Vermont USA
Offline Offline
Edison Member
*
Karma: 23
Posts: 1753
... in The Woods In Vermont
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Everyone,

Also thinking about how Communications and it's Event-oriented property fits with this effort.

I have been working on low-cost Transceivers and software support for them.  The RF24 library and approach looks good.
I have some How-to and pointers here: http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo

Renato, how should I start thinking about this? How would communications integrate with your Event Based Library? 

Actually a more generic question is something like "What are the guidelines for writing Tasks/Functions that integrate well with EBL"??

I would like to try to integrate some RF24 support with some EBL example soon...

Regards, Terry King
...In The Woods In Vermont
terry@yourduino.com


Logged

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

São Paulo
Offline Offline
Jr. Member
**
Karma: 0
Posts: 55
Renato
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

AdvancedSerial class and their C# client API was the first idea about how to proceed with communication between devices or PC software. It was written with a simple message validation, handshake and, of course, events for arriving messages. The ideia is to abstract all message handling in one class to permit it's logic to be implemented over any transport layer. AdvancedSerial has not yet their message handling abstracted from transport layer because I had some doubts about how to properly handle includes between Arduino library files and I also thought that should be better to decide it while implementing a second transport, but if you see the C# code will note that it's already well implemented there.

I've planned before to add a TCP support for ethernet and wifi shields as a next step for it because I realy believe in an full integration for PC and mobile devices as a more promising way to control a wide set of Arduino devices. And I like the mesh support from zigbee as well.

Well, if this device permits to send and receive data in a serial style, It should be easily added to our library. I never read about this device before you post it here, it really appears to be powerful and cheap.
Logged

Topsham, Vermont USA
Offline Offline
Edison Member
*
Karma: 23
Posts: 1753
... in The Woods In Vermont
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Renato,

I think maybe there are two different things to consider here:

- Communications between Arduino and the typical USB-connected host computer. 

- Communications between Arduinos 

It would be easier if these were all serial oriented.  But RF Radio Wireless communications has retries and error checking and actually sends packets of data.  I will try to see if there's a way for RF24 library to support 'serial stream' type transfers, or perhaps we can write that on top of the packet-transmission. I THINK that's what Xbee does.

...details :-)

I need to try out AdvancedSerial myself and get used to it...

Regards, Terry King
...In The Woods In Vermont
terry@yourduino.com


Logged

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

São Paulo
Offline Offline
Jr. Member
**
Karma: 0
Posts: 55
Renato
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There is nothing special in this "serial oriented" way. If I can "sendByte" here and then "readByte" there it will work independent of transport layer. It's only an validation sequence as explained bellow:

1) If there is nothing in buffer, I just wait for an STX byte because it tells me that a message is arriving;

2) Once a message started to arrive, I will first read its header. In case of AdvancedSerial it has a fixed size and it also brings the payload size;

3) If I have a valid payload size I start to fetch it from buffer;

4) When I finish reading the payload, then the next byte must be an ETX telling me that's the message ended.

If anything went wrong on validation we loose the message, otherwise we send back an ACKNOWLEDGE message. Once we combined ACK messages with a timeout+retry algorithmic we have a well reliable communication.

Maybe you need talk to arduino using USB, ethernet, TX/RX or whatever. The idea is to fit any project requirement as possible with the same protocol implementation, being it an offline configurator or even an real-time monitor.

Would be good if there was a RF24 hub or a usb dongle for it as well. The last one I think that we can quickly build by ourselves.

Finaly, using a common protocol implementation over any transport layer permit us to use different transport layers at same communication through converters like Serial2Ethernet and so on. Then one part can use their serial support while another one use the ethernet support and achieve a transparent communication.
« Last Edit: July 31, 2011, 11:35:59 am by Rferreira » Logged

Topsham, Vermont USA
Offline Offline
Edison Member
*
Karma: 23
Posts: 1753
... in The Woods In Vermont
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Would be good if there was a RF24 hub or a usb dongle for it as well. The last one I think that we can quickly build by ourselves.

Hi Renato,

I've been looking for one. Take a look at this:
http://arduino-direct.com/sunshop/index.php?l=product_detail&p=192

I found this at a supplier but don't have one yet.. and very little data.

Also Nordic site says their System-On-Chip with nRF24L01 can have USB ??

I'll try to find more info...

Regards, Terry King
...In The Woods In Vermont
terry@yourduino.com
Logged

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

São Paulo
Offline Offline
Jr. Member
**
Karma: 0
Posts: 55
Renato
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hmmm! Looks good...  smiley-cool  It made me curious...
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Renato,

I am just getting back to Arduino because your library finally promises to make it more pleasant! I'm using Arduino 1.0 on a Mac.

I just downloaded the Zip file and put it into arduino's libraries folder. When I open file/examples/buttonEvent/simplebutton and click "Verify" I get several compile errors. Does it look like I am doing something wrong? I get other compile errors with the other EBL examples.

Thanks!

In file included from SimpleButton.cpp:1:
/Applications/Arduino 1.0.app/Contents/Resources/Java/libraries/ButtonEvent/ButtonEvent.h:33:22: error: WProgram.h: No such file or directory
In file included from SimpleButton.cpp:1:
/Applications/Arduino 1.0.app/Contents/Resources/Java/libraries/ButtonEvent/ButtonEvent.h:40: error: 'byte' does not name a type
/Applications/Arduino 1.0.app/Contents/Resources/Java/libraries/ButtonEvent/ButtonEvent.h:60: error: 'byte' has not been declared
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 168
Posts: 12428
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


The 1.0 version has several things changed
- Wprogram.h ==>  Arduino.h
- byte ==> uint8_t

or use 0.22 ...
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Pages: 1 2 [3] 4   Go Up
Jump to: