The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Message Prev][Message Next][Thread Prev][Thread Next][Message Index][Thread Index]

RE: Re: Serial bridge availability



------=_NextPart_000_000F_01CA9DA5.DBCE1040
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

Lehane,



All good ideas.



1. I've added a TX/RX indicator to the port setup to help reduce
unnecessary traffic being relayed.  If a micro only transmits data then the
bridge can be configured not to SEND it traffic reducing the transmitter
burden.  I've documented this on the xap-bridge wiki page.



2. I'll decouple the bridge receiver from the bridge sender and put each in
a separate pthread separated by a FIFO buffer.  This should deal with the
transmission from a fast network to a slow network.  This is next on my
list.



My first take will be have a single pthread to handle transmission to all
the serial devices in a round robin fashion.  If it turns out that they
can't all be serviced quickly enough I'll consider a pthread per serial
port, at the cost of making the FIFO a little more complex.   More threads
=
more locking problems.



3. As for directed bridging I'm going to leave this one for now and come
back to it once I've got point 2 out of the way.

With a FIFO we can see how much back pressure appears on the transmitter
for
large update messages and the time is takes to clear.

If this is significant then directed bridging would help but at the cost of
complexity.  We'll see how point 2. pans out.



4. TTL a point of contention, should packets get dropped?   Well I think a
TTL should be implemented its simple enough to do, but perhaps I'll have
the
default value at 2min which is high enough for it be ignored.  If the FIFO
buffer is expanding too large then the TTL can be tuned down to start
dropping packets.



Brett



From: xAP_developer@xxxxxxx [mailto:xAP_developer@xxxxxxx]
On Behalf Of Lehane Kellett (g8kmh)
Sent: 23 January 2010 19:22
To: xAP_developer@xxxxxxx
Subject: Re: [xAP_developer] Re: Serial bridge availability





Brett,
Looks interesting.

A few things you may have considered for implementation:

Using a FIFO buffer on messages from the PC/E-net side to serial as there
can be more messages than the RS232 can cope with when a 'big' device
updates its status (like n Netiom's). Add some inteliigence to drop
messages
if queued for too long (though I'm sure this would be considered as bad
form!).
Keep a list of the serial attached devices and don't send targetted
messages
to non existent devices. This of course assumes the serial isn't 1:1 but
multidrop (RS485).

Lehane


dbzoo_com wrote:



Neil,

As the community doesn't seem to have a solid working bridge I thought I
write one as part of my home automation project.

http://www.dbzoo.com/livebox/xap_bridge

This code is BETA and your welcome to try it out, please let me know how
you
get on, I've only done very limited testing, so you may run into bugs that
I
have yet to find myself.

Brett






------=_NextPart_000_000F_01CA9DA5.DBCE1040
Content-Type: text/html; charset=US-ASCII
Content-Transfer-Encoding: 7bit





<head>

<style type="text/css">
<!--

/* start of attachment style */
.ygrp-photo-title{
clear: both;
font-size: smaller;
height: 15px;
overflow: hidden;
text-align: center;
width: 75px;
}
div.ygrp-photo{
background-position: center;
background-repeat: no-repeat;
background-color: white;
border: 1px solid black;
height: 62px;
width: 62px;
}

div.photo-title
a,
div.photo-title a:active,
div.photo-title a:hover,
div.photo-title a:visited {
text-decoration: none;
}

div.attach-table div.attach-row {
clear: both;
}

div.attach-table div.attach-row div {
float: left;
/* margin: 2px;*/
}

p {
clear: both;
padding: 15px 0 3px 0;
overflow: hidden;
}

div.ygrp-file {
width: 30px;
valign: middle;
}
div.attach-table div.attach-row div div a {
text-decoration: none;
}

div.attach-table div.attach-row div div span {
font-weight: normal;
}

div.ygrp-file-title {
font-weight: bold;
}
/* end of attachment style */
-->
</style>
</head>
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml";
xmlns="http://www.w3.org/TR/REC-html40";>

<head>
<meta http-equiv=Content-Type content="text/html;
charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered
medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#1E66AE;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#1E66AE;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
code
{mso-style-priority:99;
font-family:"Courier New";}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
tt
{mso-style-priority:99;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
p.attach, li.attach, div.attach
{mso-style-name:attach;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:9.0pt;
font-family:"Arial","sans-serif";}
p.bold, li.bold, div.bold
{mso-style-name:bold;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:10.0pt;
font-family:"Arial","sans-serif";
font-weight:bold;}
p.green, li.green, div.green
{mso-style-name:green;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";
color:#628C2A;}
p.replbq, li.replbq, div.replbq
{mso-style-name:replbq;
margin:3.0pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
p.ad, li.ad, div.ad
{mso-style-name:ad;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
p.underline, li.underline, div.underline
{mso-style-name:underline;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
span.yshortcuts
{mso-style-name:yshortcuts;}
p.ad1, li.ad1, div.ad1
{mso-style-name:ad1;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
p.ad2, li.ad2, div.ad2
{mso-style-name:ad2;
mso-margin-top-alt:auto;
margin-right:0cm;
margin-bottom:7.5pt;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
p.underline1, li.underline1, div.underline1
{mso-style-name:underline1;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";
text-decoration:underline;}
span.yshortcuts1
{mso-style-name:yshortcuts1;
font-family:"Verdana","sans-serif";
font-weight:bold;}
span.yshortcuts2
{mso-style-name:yshortcuts2;
font-family:"Verdana","sans-serif";
font-weight:normal;}
span.EmailStyle34
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{mso-list-id:1471707483;
mso-list-template-ids:-622147360;}
@list l0:level1
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:36.0pt;
mso-level-number-position:left;
text-indent:-18.0pt;
mso-ansi-font-size:10.0pt;
font-family:Symbol;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>

<body bgcolor=white lang=EN-GB link="#1E66AE"
vlink="#1E66AE">


<!-- **begin egp html banner** -->

<br><br>

<!-- **end egp html banner** -->




<div class=Section1>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Lehane,<o:p></o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>All good
ideas.<o:p></o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>&nbsp;1. I've added a TX/RX indicator to the port
setup to help
reduce unnecessary traffic being relayed.&nbsp; If a micro only
transmits data
then the bridge can be configured not to SEND it traffic reducing the
transmitter burden.&nbsp; I've documented this on the xap-bridge wiki
page.<o:p></o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>&nbsp;2. I'll decouple the bridge receiver from the
bridge sender
and put each in a separate pthread separated by a FIFO buffer.&nbsp;
This should
deal with the transmission from a fast network to a slow network.&nbsp;
This is
next on my list.<o:p></o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>My first take will be have a single pthread to handle
transmission to all the serial devices in a round robin fashion.&nbsp;
If it
turns out that they can't all be serviced quickly enough I'll consider a
pthread per serial port, at the cost of making the FIFO a little more
complex. &nbsp;&nbsp;More
threads = more locking
problems.<o:p></o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>3. As for directed bridging I'm going to leave this one
for now
and come back to it once I've got point 2 out of the
way.<o:p></o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>With a FIFO we can see how much back pressure appears on
the transmitter
for large update messages and the time is takes to
clear.<o:p></o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>If this is significant then directed bridging would help
but at
the cost of complexity.&nbsp; We'll see how point 2. pans
out.<o:p></o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>4. TTL a point of contention, should packets get
dropped?&nbsp;&nbsp; Well I think a TTL should be implemented its
simple enough
to do, but perhaps I'll have the default value at 2min which is high enough
for
it be ignored.&nbsp; If the FIFO buffer is expanding too large then the
TTL can
be tuned down to start dropping
packets.<o:p></o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Brett<o:p></o:p></span></p>

<p class=MsoNormal><span
style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>&nbsp;<o:p></o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm
0cm 0cm'>

<p class=MsoNormal><b><span lang=EN-US
style='font-size:10.0pt;font-family:
"Tahoma","sans-serif"'>From:</span></b><span
lang=EN-US style='font-size:10.0pt;
font-family:"Tahoma","sans-serif"'>
xAP_developer@xxxxxxx
[mailto:xAP_developer@xxxxxxx]
<b>On Behalf Of </b>Lehane Kellett
(g8kmh)<br>
<b>Sent:</b> 23 January 2010 19:22<br>
<b>To:</b> xAP_developer@xxxxxxx<br>
<b>Subject:</b> Re: [xAP_developer] Re: Serial bridge
availability<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>&nbsp; <o:p></o:p></p>

<div id=ygrp-mlmsg>

<div id=ygrp-msg>

<div id=ygrp-text>

<p>Brett,<br>
Looks interesting.<br>
<br>
A few things you may have considered for implementation:<br>
<br>
Using a FIFO buffer on messages from the PC/E-net side to serial as there
can
be more messages than the RS232 can cope with when a 'big' device updates
its
status (like n Netiom's). Add some inteliigence to drop messages if queued
for
too long (though I'm sure this would be considered as bad form!).<br>
Keep a list of the serial attached devices and don't send targetted
messages to
non existent devices. This of course assumes the serial isn't 1:1 but
multidrop
(RS485).<br>
<br>
Lehane<br>
<br>
<br>
dbzoo_com wrote: <o:p></o:p></p>

<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'>

<p class=MsoNormal>&nbsp; <o:p></o:p></p>

<div id=ygrp-text>

<p style='margin-bottom:12.0pt'>Neil,<br>
<br>
As the community doesn't seem to have a solid working bridge I thought I
write
one as part of my home automation project.<br>
<br>
<a href="http://www.dbzoo.com/livebox/xap_bridge";>http://www.dbzoo.com/livebox/xap_bridge</a><br>
<br>
This code is BETA and your welcome to try it out, please let me know how
you
get on, I've only done very limited testing, so you may run into bugs that
I
have yet to find myself.<br>
<br>
Brett<o:p></o:p></p>

</div>

</blockquote>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal><span
style='color:white'><o:p></o:p></span></p>

</div>

</div>





<!-- **begin egp html banner** -->

<br>



<br>

<!-- **end egp html banner** -->


<div width="1" style="color: white; clear:
both;"/>__._,_.___</div>

<!-- Start Recommendations -->
<!-- End Recommendations -->



<!-- **begin egp html banner** -->

<img src="http://geo.yahoo.com/serv?s=97476590/grpId=9629476/grpspId=1705007709/msgId=2073/stime=1264414069";
width="1" height="1"> <br>

<!-- **end egp html banner** -->


<!-- **begin egp html banner** -->

<br>
<div style="font-family: verdana; font-size: 77%; border-top: 1px
solid #666; padding: 5px 0;" >
Your email settings: Individual EmailTraditional <br>
<a href="http://groups.yahoo.com/group/xAP_developer/join;_ylc=X3oDMTJmamk3Z2lnBF9TAzk3NDc2NTkwBGdycElkAzk2Mjk0NzYEZ3Jwc3BJZAMxNzA1MDA3NzA5BHNlYwNmdHIEc2xrA3N0bmdzBHN0aW1lAzEyNjQ0MTQwNjk-";>Change
settings via the Web</a> (Yahoo! ID required) <br>
Change settings via email: <a href="mailto:xAP_developer-digest@xxxxxxx?subject=Email
Delivery: Digest">Switch delivery to Daily Digest</a>  <a
href = "mailto:xAP_developer-fullfeatured@xxxxxxx?subject=Change
Delivery Format: Fully Featured">Switch to Fully Featured</a>
<br>
<a href="http://groups.yahoo.com/group/xAP_developer;_ylc=X3oDMTJkOWFkaTR1BF9TAzk3NDc2NTkwBGdycElkAzk2Mjk0NzYEZ3Jwc3BJZAMxNzA1MDA3NzA5BHNlYwNmdHIEc2xrA2hwZgRzdGltZQMxMjY0NDE0MDY5";>
Visit Your Group
</a>
<a href="http://docs.yahoo.com/info/terms/";>
Yahoo! Groups Terms of Use
</a>
<a href="mailto:xAP_developer-unsubscribe@xxxxxxx?subject=Unsubscribe";>
Unsubscribe
</a>
<br>
</div>
<br>

<!-- **end egp html banner** -->


<div style="color: white; clear:
both;"/>__,_._,___</div>
</body>

</html>

------=_NextPart_000_000F_01CA9DA5.DBCE1040--


xAP_Development Main Index | xAP_Development Thread Index | xAP_Development Home | Archives Home

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.