Difference between revisions of "Mother Arduino"

From LVL1
Jump to navigation Jump to search
 
(9 intermediate revisions by the same user not shown)
Line 17: Line 17:
 
*SmDl = Small Delimiter
 
*SmDl = Small Delimiter
 
*BgDl = Big Delimiter
 
*BgDl = Big Delimiter
*HS = Handsake
+
*HS = Handshake
 
**WA = Wants Ack
 
**WA = Wants Ack
 
**Ack = Confirm Received
 
**Ack = Confirm Received
*FT = Future Use
+
*MSC = Message Segment Count
 +
*SOM = Start of Message
 +
*EOM = End of Message
 +
*XT = Extra Data
 
*DC = Device Code
 
*DC = Device Code
 
*DV = Device Value
 
*DV = Device Value
  
 
+
===Message Example===
Example: Device Value Update String
+
Type: Device Value Update String
 
{|style="border-collapse: collapse; border-width: 1px; border-style: solid; border-color: #000; cell padding="5"
 
{|style="border-collapse: collapse; border-width: 1px; border-style: solid; border-color: #000; cell padding="5"
 
|-
 
|-
!style="border-style: solid; border-width: 0px"| "  
+
!style="border-style: solid; border-width: 0px"| "
!style="border-style: solid; border-width: 1px"| MT
+
!style="border-style: solid; border-width: 1px"| MT  
 
!style="border-style: solid; border-width: 1px"|SmDl
 
!style="border-style: solid; border-width: 1px"|SmDl
 
!style="border-style: solid; border-width: 1px"| HS
 
!style="border-style: solid; border-width: 1px"| HS
 
!style="border-style: solid; border-width: 1px"|BgDl
 
!style="border-style: solid; border-width: 1px"|BgDl
!style="border-style: solid; border-width: 1px"| FT1
+
!style="border-style: solid; border-width: 1px"| MSC
 +
!style="border-style: solid; border-width: 1px"|SmDl
 +
!style="border-style: solid; border-width: 1px"|SOM
 +
!style="border-style: solid; border-width: 1px"|BgDl
 +
!style="border-style: solid; border-width: 1px"|XT1
 
!style="border-style: solid; border-width: 1px"|SmDl
 
!style="border-style: solid; border-width: 1px"|SmDl
!style="border-style: solid; border-width: 1px"|FT2
+
!style="border-style: solid; border-width: 1px"|XT2
 
!style="border-style: solid; border-width: 1px"|BgDl
 
!style="border-style: solid; border-width: 1px"|BgDl
 
!style="border-style: solid; border-width: 1px"|DC1
 
!style="border-style: solid; border-width: 1px"|DC1
Line 44: Line 51:
 
!style="border-style: solid; border-width: 1px"|SmDl
 
!style="border-style: solid; border-width: 1px"|SmDl
 
!style="border-style: solid; border-width: 1px"|DV2
 
!style="border-style: solid; border-width: 1px"|DV2
!style="border-style: solid; border-width: 0px"| "
+
!style="border-style: solid; border-width: 1px"|BgDl
 +
!style="border-style: solid; border-width: 1px"|EOM
 +
!style="border-style: solid; border-width: 0px"| "
  
 
|-
 
|-
|style="border-style: solid; border-width: 0px"|  
+
|style="border-style: solid; text-align:center; border-width: 0px"|  
|style="border-style: solid; border-width: 1px"| DVU
+
|style="border-style: solid; text-align:center; border-width: 1px"| DVU
|style="border-style: solid; border-width: 1px"|:
+
|style="border-style: solid; text-align:center; border-width: 1px"|<nowiki>:</nowiki>
|style="border-style: solid; border-width: 1px"| WA
+
|style="border-style: solid; text-align:center; border-width: 1px"| WA
|style="border-style: solid; border-width: 1px"||
+
|style="border-style: solid; text-align:center; border-width: 1px"|<nowiki>|</nowiki>
|style="border-style: solid; border-width: 1px"|x
+
|style="border-style: solid; text-align:center; border-width: 1px"|2
|style="border-style: solid; border-width: 1px"|:
+
|style="border-style: solid; text-align:center; border-width: 1px"|<nowiki>:</nowiki>
|style="border-style: solid; border-width: 1px"|x
+
|style="border-style: solid; text-align:center; border-width: 1px"|SOM
|style="border-style: solid; border-width: 1px"||
+
|style="border-style: solid; text-align:center; border-width: 1px"|<nowiki>|</nowiki>
|style="border-style: solid; border-width: 1px"|D1
+
|style="border-style: solid; text-align:center; border-width: 1px"|x
|style="border-style: solid; border-width: 1px"|:
+
|style="border-style: solid; text-align:center; border-width: 1px"|<nowiki>:</nowiki>
|style="border-style: solid; border-width: 1px"|1
+
|style="border-style: solid; text-align:center; border-width: 1px"|x
|style="border-style: solid; border-width: 1px"||
+
|style="border-style: solid; text-align:center; border-width: 1px"|<nowiki>|</nowiki>
|style="border-style: solid; border-width: 1px"|D2
+
|style="border-style: solid; text-align:center; border-width: 1px"|A1
|style="border-style: solid; border-width: 1px"|:
+
|style="border-style: solid; text-align:center; border-width: 1px"|<nowiki>:</nowiki>
|style="border-style: solid; border-width: 1px"|0
+
|style="border-style: solid; text-align:center; border-width: 1px"|1
|style="border-style: solid; border-width: 0px"|  
+
|style="border-style: solid; text-align:center; border-width: 1px"|<nowiki>|</nowiki>
 +
|style="border-style: solid; text-align:center; border-width: 1px"|A2
 +
|style="border-style: solid; text-align:center; border-width: 1px"|<nowiki>:</nowiki>
 +
|style="border-style: solid; text-align:center; border-width: 1px"|0
 +
|style="border-style: solid; text-align:center; border-width: 1px"|<nowiki>|</nowiki>
 +
|style="border-style: solid; text-align:center; border-width: 1px"|EOM
 +
|style="border-style: solid; text-align:center; border-width: 0px"|  
 
|}
 
|}
 +
<br>
 +
 +
===Message Details===
 +
 +
Each message consist of two portions: Message details and Message Data. Message details include all data from the start of the message to the SOM segment and contains information describing thy type of data included in the message and how the data should be handled. 
 +
All portions of a message are divided into multiple message segments. Message segments are defined as all the data in between two Large Delimiters.  The starting and ending segments do not contain a starting or trailing Big Delimeter. Each segment consist of two pieces of segment data which are seperated by a colon.
 +
 +
 +
=== Mother Device/Ardunio Pin Number Relations===
 +
Each Ardunio connected to Mother is given its own Mother HouseCode (Valid house codes are any letter from a-z, and is defined in the arduino sketch.) This needs to be a "clean" house code with not existing devices. Since arduino uses pins 0 and 1 for serial transmission, the first pin to be used as a Mother device is Arduinos Pin2.  In order to keep consistency between Mother DeviceCodes and ArdunioPins we use MotherDeviceCode2 as the first device code which relates to Arduino Pin2.  So for an ardunio set with a house code of "A", pin2 would be seen as MotherDevice A2.  Mother will use A1 to store this specific arduino's extra details. These extra details are contained in the Message Details section of each message within the "XT" segment.  These values have yet to be defined or implemented.

Latest revision as of 13:13, 14 January 2012

Mother Navigation

MotherStatus | Mother To-Do List | Mother Wish List | MotherMain

Overview

The goal is to allow Mother to be able to monitor and control Arduino boards and devices. The solution consist of a sketch that can be loaded onto any arduino and allow all pins to be updated to the mother system.

Method of Integration

Integration of arduino boards consist of the following scripts:

  • Mother script to open the corresponding com port and monitor for serial data
  • Mother script triggered by incoming data on monitored com port to parse data and set devices as needed
  • Arduino sketch that updates device values as they change and that allows the Arduino to receive device control commands from Mother

Protocols

Definitions

  • MT = Message Type
    • DVU = Device Value Update Message
  • SmDl = Small Delimiter
  • BgDl = Big Delimiter
  • HS = Handshake
    • WA = Wants Ack
    • Ack = Confirm Received
  • MSC = Message Segment Count
  • SOM = Start of Message
  • EOM = End of Message
  • XT = Extra Data
  • DC = Device Code
  • DV = Device Value

Message Example

Type: Device Value Update String

" MT SmDl HS BgDl MSC SmDl SOM BgDl XT1 SmDl XT2 BgDl DC1 SmDl DV1 BgDl DC2 SmDl DV2 BgDl EOM "
DVU : WA | 2 : SOM | x : x | A1 : 1 | A2 : 0 | EOM


Message Details

Each message consist of two portions: Message details and Message Data. Message details include all data from the start of the message to the SOM segment and contains information describing thy type of data included in the message and how the data should be handled. All portions of a message are divided into multiple message segments. Message segments are defined as all the data in between two Large Delimiters. The starting and ending segments do not contain a starting or trailing Big Delimeter. Each segment consist of two pieces of segment data which are seperated by a colon.


Mother Device/Ardunio Pin Number Relations

Each Ardunio connected to Mother is given its own Mother HouseCode (Valid house codes are any letter from a-z, and is defined in the arduino sketch.) This needs to be a "clean" house code with not existing devices. Since arduino uses pins 0 and 1 for serial transmission, the first pin to be used as a Mother device is Arduinos Pin2. In order to keep consistency between Mother DeviceCodes and ArdunioPins we use MotherDeviceCode2 as the first device code which relates to Arduino Pin2. So for an ardunio set with a house code of "A", pin2 would be seen as MotherDevice A2. Mother will use A1 to store this specific arduino's extra details. These extra details are contained in the Message Details section of each message within the "XT" segment. These values have yet to be defined or implemented.