<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>electrodesigns.net</title>
	<atom:link href="http://electrodesigns.net/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://electrodesigns.net/blog</link>
	<description>Electronic Circuit Designing, Firmware Development, Technical Writing and Idea Sharing!</description>
	<lastBuildDate>Tue, 15 Jan 2013 11:09:54 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Importance of Good Contacts for Embedded Systems Developers</title>
		<link>http://electrodesigns.net/blog/importance-good-contacts-embedded-system/</link>
		<comments>http://electrodesigns.net/blog/importance-good-contacts-embedded-system/#comments</comments>
		<pubDate>Sat, 17 Nov 2012 09:59:09 +0000</pubDate>
		<dc:creator>Aftab Sarwar</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Professional]]></category>
		<category><![CDATA[components]]></category>
		<category><![CDATA[cost]]></category>
		<category><![CDATA[gerber and drill files]]></category>
		<category><![CDATA[good contacts]]></category>
		<category><![CDATA[importance]]></category>
		<category><![CDATA[pcb]]></category>
		<category><![CDATA[pcb files]]></category>

		<guid isPermaLink="false">http://electrodesigns.net/blog/?p=782</guid>
		<description><![CDATA[If you want to succeed in this field, you got to have some really good contacts. Designing a product idea<a href="http://electrodesigns.net/blog/importance-good-contacts-embedded-system/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
				<content:encoded><![CDATA[<p><a href="http://electrodesigns.net/blog/importance-good-contacts-embedded-system/business-contacts/" rel="attachment wp-att-2259"><img class="alignleft  wp-image-2259" style="margin-left: 10px; margin-right: 10px;" title="business contacts" alt="business contacts" src="http://electrodesigns.net/blog/wp-content/uploads/2012/11/business-contacts.jpg" width="100" height="96" /></a>If you want to succeed in this field, you got to have some really good contacts. Designing a product idea is one thing, getting it into full blown product and a usable commodity in the field is the other. For that an embedded systems developer needs to do much more than design.</p>
<p>Lets face the fact that most developer or engineers do not have in house prototyping machinery. This includes PCB fabrication and stuffing/soldering. Also we need to source components, which, most of the times can not be found from local market. Therefore, you need someone out there to search and buy electronics components and send to you. You need to know your supplier well.</p>
<p>To know if he is reliable. Ask him if his already sent some components before. If there is an URL of his company. Is there any other guy to cross check what he is telling you. By the way most of the Chinese people I came to know during the process were extremely helpful and honest. The only problem has been communication issues and non-technical nature of their education as for technical marketing you do need to have technical knowledge and experience.<span id="more-782"></span></p>
<p>You should know if he/she is technical. Most of the people sitting near Shenzhen are purely marketing people and it is really hard to make them understand what you really want to import. For their convenience you can add the pictures of part or a link to their datasheets. But don&#8217;t try to disclose the price of it. Let him/her search in his/her local market which is cheaper than most online sources like Digikey, Mouser etc.</p>
<p><span style="text-decoration: underline;">Before you transfer the money:</span></p>
<ul>
<li>How much is the lead time.</li>
<li>Confirm he/she understands each and every part and its part number.</li>
<li>What is the shipping cost? Sometimes they quote less then try to cover the cost in shipping.</li>
<li>Chinese don&#8217;t like small quantities and a quantity of 1000 is a small quantity for them. While you are at the stage of prototyping and you don&#8217;t need more than 5 sets and your client wants even lower prices then that, you need some special skills to convince your Chinese partner to send you this small quantity, cheap.</li>
</ul>
<p><span style="text-decoration: underline;">For PCB fab:</span></p>
<ul>
<li>Know what specs your PCB will have. Convey what you want to the PCB fab guys, the PCB material, PCB thickness, copper thickness and other details. Understand what they are offering to you. Google it if you don&#8217;t understand.</li>
<li>Take quotation from different suppliers and compare them for best offer.</li>
<li>Know what you need to transfer them. Only Gerber and drill files is required. BOM list is required in case of PCBA. As an example, one of my clients accidentally transferred some of the PCB design files (the source files) along-with CAD files while he had signed an NDA with me! Strange, haan? What you want to give them is only Gerber and Drill files, they will not ask you more and they don&#8217;t need more than that, OK?</li>
<li>It&#8217;s better if PCB makers are near you in your country that will save the shipment cost and delay. But I know there are very good online PCB services as well. Doesn&#8217;t matter if you know they are good at that.</li>
</ul>
<p>So for all that, you need some very good contacts so that you can get the complete job done, without unwanted delays. Good contacts will add up to your success stories, build up a better career and the profession will turn into enjoyable voyage with plenty of good things to remember. Best of luck.</p>
<p>&nbsp;</p>
<div class="SPOSTARBUST-Related-Posts"><H3>Related Posts</H3><ul class="entry-meta"><li class="SPOSTARBUST-Related-Post"><a title="PCB Design with Diptrace" href="http://electrodesigns.net/blog/pcb-design-diptrace/" rel="bookmark">PCB Design with Diptrace</a></li>
<li class="SPOSTARBUST-Related-Post"><a title="PIC32MX1 Breakout Board" href="http://electrodesigns.net/blog/pic32mx1-breakout-board/" rel="bookmark">PIC32MX1 Breakout Board</a></li>
<li class="SPOSTARBUST-Related-Post"><a title="Simple PCB Design Tips" href="http://electrodesigns.net/blog/simple-pcb-design-tips/" rel="bookmark">Simple PCB Design Tips</a></li>
<li class="SPOSTARBUST-Related-Post"><a title="Diptrace Lib 2012-02-02" href="http://electrodesigns.net/blog/diptrace-lib-2012-02-02/" rel="bookmark">Diptrace Lib 2012-02-02</a></li>
</ul></div><p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Felectrodesigns.net%2Fblog%2Fimportance-good-contacts-embedded-system%2F&amp;title=Importance%20of%20Good%20Contacts%20for%20Embedded%20Systems%20Developers" id="wpa2a_2"><img src="http://electrodesigns.net/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://electrodesigns.net/blog/importance-good-contacts-embedded-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eagle vs Diptrace</title>
		<link>http://electrodesigns.net/blog/eagle-vs-diptrace/</link>
		<comments>http://electrodesigns.net/blog/eagle-vs-diptrace/#comments</comments>
		<pubDate>Thu, 18 Oct 2012 12:20:06 +0000</pubDate>
		<dc:creator>Aftab Sarwar</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[PCB Design]]></category>
		<category><![CDATA[Product Reviews]]></category>
		<category><![CDATA[Professional]]></category>
		<category><![CDATA[auto router]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[Diptrace]]></category>
		<category><![CDATA[eagle]]></category>
		<category><![CDATA[import ses]]></category>
		<category><![CDATA[import ses file]]></category>
		<category><![CDATA[pcb design]]></category>
		<category><![CDATA[using eagle]]></category>

		<guid isPermaLink="false">http://electrodesigns.net/blog/?p=2181</guid>
		<description><![CDATA[I just started to use Cadsoft Eagle for PCB design some weeks ago. I tried many times in past but<a href="http://electrodesigns.net/blog/eagle-vs-diptrace/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
				<content:encoded><![CDATA[<p><a href="http://electrodesigns.net/blog/eagle-vs-diptrace/eagle-vs-diptrace-2/" rel="attachment wp-att-2185"><img class="alignleft size-full wp-image-2185" title="eagle vs diptrace" src="http://electrodesigns.net/blog/wp-content/uploads/2012/10/eagle-vs-diptrace.jpg" alt="eagle vs diptrace" width="264" height="131" /></a>I just started to use Cadsoft Eagle for PCB design some weeks ago. I tried many times in past but somehow left in between due to lack of interest. This time, however, I had a project in hand and the client requirement was to do it in Eagle. I am more used to the Diptrace software and <a href="http://electrodesigns.net/blog/pcb-design-diptrace/">I have reasons to like it</a>. But Eagle is also a very popular PCB design software so I desire of using it.</p>
<p>In Eagle, I specially liked the schematic section as it looks very pretty at the end. It looks surely much more professional than drawn in Diptrace. Most of the hobby projects on Internet with pretty looking schematics you will see are designed in Eagle. Eagle saves its library files in XML format. So one can copy/paste a chuck of XML in the file to create a new footprint. Then can edit the part in the library editor of Eagle.<span id="more-2181"></span></p>
<p>There are a few things, however, which I think are inferior to Diptrace:</p>
<ul>
<li>The auto-router is less efficient. It will route far less nets compared to Diptrace.</li>
<li>The export feature is very limited. I was using Eagle version 6.2.0 and I tried to export the .DSN file using ULP &#8220;brd_to_dsn_v6.ulp&#8221;. The Specctra auto router was throwing error. Most of the auto-routing I do is using Specctra which is a wonderful tool for that purpose. I will later look into this error and try to know the issue.</li>
</ul>
<p><a href="http://electrodesigns.net/blog/eagle-vs-diptrace/specctra_error/" rel="attachment wp-att-2186"><img class="alignnone size-full wp-image-2186" title="specctra_error" src="http://electrodesigns.net/blog/wp-content/uploads/2012/10/specctra_error.jpg" alt="Eagle DSN export" width="434" height="131" /></a></p>
<ul>
<li>I could not figure out how to import the .SES file back into Eagle to keep the design flow systematic. If you can import the SES file back, how to keep all the design under single tool. This compelled me to work on manual routing. The board was small enough so I gladly accepted that.</li>
<li>Well, the manual routing wasn&#8217;t that bad but the thing which annoyed me was a missing feature of Diptrace and that is called &#8220;Edit trace&#8221;. In Eagle, I rather had to use &#8220;move&#8221; tool. But moving a single segment could distort the adjacent two segments. Hence, editing the traces in Eagle can take much of your time and energy.</li>
<li>Exporting the files to Gerber and Drill is also tricky. One finds it easier in Diptrace.</li>
<li>Another thing which was strange for me was you need to keep the board file open while editing the schematic to keep sync between two. At first it looked very strange but then I got used to it.</li>
<li>The BOM/BOQ generation is also not that robust like Diptrace. You need to edit heavily the BOM generated by Eagle, unlike Diptace where all settings are under your control while working in schematics.</li>
</ul>
<p>I haven&#8217;t tried the 3D feature yet but one thing which I have noted by looking at <a href="http://www.matwei.de/lib/exe/fetch.php?w=&amp;h=&amp;cache=cache&amp;media=images:eagle3d:e3d_example_3d.jpg">some samples on internet</a> that the Eagle 3D preview looks much more realist than that of Diptrace. It looks very close to the real prototype. In a net shell its a very nice little tool to design even professional level PCBs. It is very user friendly and well suited for hobbyists and newbies.It was a charm working in Eagle.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Felectrodesigns.net%2Fblog%2Feagle-vs-diptrace%2F&amp;title=Eagle%20vs%20Diptrace" id="wpa2a_4"><img src="http://electrodesigns.net/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://electrodesigns.net/blog/eagle-vs-diptrace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PIC USART, I2C, SPI</title>
		<link>http://electrodesigns.net/blog/pic-usart-i2c-spi/</link>
		<comments>http://electrodesigns.net/blog/pic-usart-i2c-spi/#comments</comments>
		<pubDate>Thu, 30 Aug 2012 12:12:40 +0000</pubDate>
		<dc:creator>Aftab Sarwar</dc:creator>
				<category><![CDATA[Firmware]]></category>
		<category><![CDATA[Free Electronic Resources]]></category>
		<category><![CDATA[I2C]]></category>
		<category><![CDATA[PIC]]></category>
		<category><![CDATA[spi]]></category>
		<category><![CDATA[usart]]></category>

		<guid isPermaLink="false">http://electrodesigns.net/blog/?p=2167</guid>
		<description><![CDATA[Two very simple examples for USART + I2C and USAT + SPI. Both developed for PIC18F97J60 microcontroller running at 25MHz<a href="http://electrodesigns.net/blog/pic-usart-i2c-spi/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
				<content:encoded><![CDATA[<p>Two very simple examples for USART + I2C and USAT + SPI. Both developed for PIC18F97J60 microcontroller running at 25MHz with HS+PLL setup.</p>
<p><strong>Download Files:</strong></p>
<div id='filelist1'><ul id="listyofiles">
<li><a href="http://electrodesigns.net/blog/free-stuff/PIC%20USART-I2C-SPI/Firmware%20I2C.zip" target="_blank">Firmware I2C.zip</a></li>
<li><a href="http://electrodesigns.net/blog/free-stuff/PIC%20USART-I2C-SPI/Firmware%20SPI.zip" target="_blank">Firmware SPI.zip</a></li>
</ul>
</div>

<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Felectrodesigns.net%2Fblog%2Fpic-usart-i2c-spi%2F&amp;title=PIC%20USART%2C%20I2C%2C%20SPI" id="wpa2a_6"><img src="http://electrodesigns.net/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://electrodesigns.net/blog/pic-usart-i2c-spi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>lwIP TCP Server on LM3S8962</title>
		<link>http://electrodesigns.net/blog/lwip-tcp-server/</link>
		<comments>http://electrodesigns.net/blog/lwip-tcp-server/#comments</comments>
		<pubDate>Thu, 19 Jul 2012 10:52:01 +0000</pubDate>
		<dc:creator>Aftab Sarwar</dc:creator>
				<category><![CDATA[Free Electronic Resources]]></category>
		<category><![CDATA[Software/ Host Apps]]></category>
		<category><![CDATA[Stellaris (ARM Cortex-M3)]]></category>
		<category><![CDATA[LM3S8962]]></category>
		<category><![CDATA[LM3S8962 TCP Server]]></category>
		<category><![CDATA[TCP Server]]></category>

		<guid isPermaLink="false">http://electrodesigns.net/blog/?p=2111</guid>
		<description><![CDATA[This TCP server is setup for Stellaris series (LM3S8962) from TI. The TCP/IP stack is lwIP shipped with enet_io app<a href="http://electrodesigns.net/blog/lwip-tcp-server/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
				<content:encoded><![CDATA[<p>This TCP server is setup for Stellaris series (LM3S8962) from TI. The TCP/IP stack is lwIP shipped with enet_io app in StellarisWare.</p>
<p><a href="http://electrodesigns.net/blog/lwip-tcp-server/port-conn/" rel="attachment wp-att-2119"><img class="alignnone  wp-image-2119" style="margin-top: 10px; margin-bottom: 10px;" title="tcp port connectivity" src="http://electrodesigns.net/blog/wp-content/uploads/2012/07/port-conn.jpg" alt="tcp port connectivity test" width="500" height="431" /></a></p>
<p>First create and add a C file &#8220;tcp_server.c&#8221; at &#8220;..\StellarisWare\third_party\lwip-1.3.2\apps\tcpserver&#8221; folder. Include the prototype in enet_io.c file.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//*****************************************************************************</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">// External Application references.</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">//*****************************************************************************</span>
<span style="color: #000000; font-weight: bold;">extern</span> <span style="color: #993333;">void</span> httpd_init<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">extern</span> <span style="color: #993333;">void</span> tcp_server_init<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>In the main function, call the tcp_server_init() function.<br />
<span id="more-2111"></span></p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">// Initialize a sample httpd server.</span>
<span style="color: #666666; font-style: italic;">//</span>
httpd_init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// initialize tcp server</span>
tcp_server_init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Here is the TCP server portion of code. The code is taken from <a href="http://www.ultimaserial.com/avr_lwip_tcp.html#raw" target="_blank">here</a>.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="c" style="font-family:monospace;"><span style="color: #339933;">#include &quot;utils/lwiplib.h&quot;		</span>
<span style="color: #339933;">#include &lt;string.h&gt;</span>
<span style="color: #339933;">#define srvr_port 1000</span>
&nbsp;
<span style="color: #993333;">char</span> mydata<span style="color: #009900;">&#91;</span><span style="color: #0000dd;">1024</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #993333;">static</span> <span style="color: #993333;">void</span> close_conn<span style="color: #009900;">&#40;</span><span style="color: #993333;">struct</span> tcp_pcb <span style="color: #339933;">*</span>pcb<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      tcp_arg<span style="color: #009900;">&#40;</span>pcb<span style="color: #339933;">,</span> NULL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      tcp_sent<span style="color: #009900;">&#40;</span>pcb<span style="color: #339933;">,</span> NULL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      tcp_recv<span style="color: #009900;">&#40;</span>pcb<span style="color: #339933;">,</span> NULL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      tcp_close<span style="color: #009900;">&#40;</span>pcb<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">static</span> err_t echo_recv<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span> <span style="color: #339933;">*</span>arg<span style="color: #339933;">,</span> <span style="color: #993333;">struct</span> tcp_pcb <span style="color: #339933;">*</span>pcb<span style="color: #339933;">,</span> <span style="color: #993333;">struct</span> pbuf <span style="color: #339933;">*</span>p<span style="color: #339933;">,</span> err_t err<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      <span style="color: #993333;">int</span> i<span style="color: #339933;">;</span>
      <span style="color: #993333;">int</span> len<span style="color: #339933;">;</span>
      <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>pc<span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>err <span style="color: #339933;">==</span> ERR_OK <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> p <span style="color: #339933;">!=</span> NULL<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;">// Inform TCP that we have taken the data. </span>
            tcp_recved<span style="color: #009900;">&#40;</span>pcb<span style="color: #339933;">,</span> p<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>tot_len<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  
&nbsp;
            <span style="color: #666666; font-style: italic;">//pointer to the pay load</span>
            pc<span style="color: #339933;">=</span><span style="color: #009900;">&#40;</span><span style="color: #993333;">char</span> <span style="color: #339933;">*</span><span style="color: #009900;">&#41;</span>p<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>payload<span style="color: #339933;">;</span>  
&nbsp;
            <span style="color: #666666; font-style: italic;">//size of the pay load</span>
            len <span style="color: #339933;">=</span>p<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>tot_len<span style="color: #339933;">;</span> 
&nbsp;
            <span style="color: #666666; font-style: italic;">//copy to our own buffer</span>
            <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> itcp_sndbuf<span style="color: #009900;">&#40;</span>pcb<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> len<span style="color: #339933;">=</span> tcp_sndbuf<span style="color: #009900;">&#40;</span>pcb<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
            <span style="color: #666666; font-style: italic;">//Send out the data </span>
			<span style="color: #666666; font-style: italic;">//err = tcp_write(pcb, &quot;\r\n&quot;, 2, 0); </span>
            err <span style="color: #339933;">=</span> tcp_write<span style="color: #009900;">&#40;</span>pcb<span style="color: #339933;">,</span> mydata<span style="color: #339933;">,</span> len<span style="color: #339933;">,</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
			<span style="color: #666666; font-style: italic;">// No need to call back </span>
            tcp_sent<span style="color: #009900;">&#40;</span>pcb<span style="color: #339933;">,</span> NULL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
	  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
            pbuf_free<span style="color: #009900;">&#40;</span>p<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
&nbsp;
      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>err <span style="color: #339933;">==</span> ERR_OK <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> p <span style="color: #339933;">==</span> NULL<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            close_conn<span style="color: #009900;">&#40;</span>pcb<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #b1b100;">return</span> ERR_OK<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">static</span> err_t echo_accept<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span> <span style="color: #339933;">*</span>arg<span style="color: #339933;">,</span> <span style="color: #993333;">struct</span> tcp_pcb <span style="color: #339933;">*</span>pcb<span style="color: #339933;">,</span> err_t err<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      LWIP_UNUSED_ARG<span style="color: #009900;">&#40;</span>arg<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      LWIP_UNUSED_ARG<span style="color: #009900;">&#40;</span>err<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      tcp_setprio<span style="color: #009900;">&#40;</span>pcb<span style="color: #339933;">,</span> TCP_PRIO_MIN<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      tcp_recv<span style="color: #009900;">&#40;</span>pcb<span style="color: #339933;">,</span> echo_recv<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      tcp_err<span style="color: #009900;">&#40;</span>pcb<span style="color: #339933;">,</span> NULL<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Don't care about error here</span>
      tcp_poll<span style="color: #009900;">&#40;</span>pcb<span style="color: #339933;">,</span> NULL<span style="color: #339933;">,</span> <span style="color: #0000dd;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//No polling here</span>
      <span style="color: #b1b100;">return</span> ERR_OK<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #993333;">void</span> tcp_server_init<span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #993333;">struct</span> tcp_pcb <span style="color: #339933;">*</span>pcb<span style="color: #339933;">;</span>
&nbsp;
	pcb <span style="color: #339933;">=</span> tcp_new<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  	tcp_bind<span style="color: #009900;">&#40;</span>pcb<span style="color: #339933;">,</span> IP_ADDR_ANY<span style="color: #339933;">,</span> srvr_port<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  	pcb <span style="color: #339933;">=</span> tcp_listen<span style="color: #009900;">&#40;</span>pcb<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  	tcp_accept<span style="color: #009900;">&#40;</span>pcb<span style="color: #339933;">,</span> echo_accept<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><strong>Download Files:</strong></p>
<div id='filelist2'><ul id="listyofiles">
<li><a href="http://electrodesigns.net/blog/free-stuff/LM3S8962%20TCP%20Server/tcp_server.c" target="_blank">tcp_server.c</a></li>
</ul>
</div>

<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Felectrodesigns.net%2Fblog%2Flwip-tcp-server%2F&amp;title=lwIP%20TCP%20Server%20on%20LM3S8962" id="wpa2a_8"><img src="http://electrodesigns.net/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://electrodesigns.net/blog/lwip-tcp-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing Modbus-TCP on Mango M2M</title>
		<link>http://electrodesigns.net/blog/testing-modbus-tcp-mango-m2m/</link>
		<comments>http://electrodesigns.net/blog/testing-modbus-tcp-mango-m2m/#comments</comments>
		<pubDate>Fri, 13 Jul 2012 12:59:05 +0000</pubDate>
		<dc:creator>Aftab Sarwar</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Embedded Networking]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[data points]]></category>
		<category><![CDATA[data source]]></category>
		<category><![CDATA[input status]]></category>
		<category><![CDATA[modbus]]></category>
		<category><![CDATA[modbus slave utility]]></category>
		<category><![CDATA[modbus tcp]]></category>
		<category><![CDATA[modbus tcp ip]]></category>
		<category><![CDATA[tcp]]></category>
		<category><![CDATA[tcp ip]]></category>

		<guid isPermaLink="false">http://electrodesigns.net/blog/?p=2083</guid>
		<description><![CDATA[Here is a very simple example of testing Modbus-TCP with Mango M2M. TCP is a convenient way to transport sensor/control data. The<a href="http://electrodesigns.net/blog/testing-modbus-tcp-mango-m2m/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
				<content:encoded><![CDATA[<p><a href="http://electrodesigns.net/blog/testing-modbus-tcp-mango-m2m/modbus/" rel="attachment wp-att-2090"><img class="alignleft size-thumbnail wp-image-2090" style="margin-left: 10px; margin-right: 10px;" title="modbus" src="http://electrodesigns.net/blog/wp-content/uploads/2012/07/modbus-150x120.jpg" alt="Modbus-Mango M2M" width="150" height="120" /></a>Here is a very simple example of testing Modbus-TCP with Mango M2M. TCP is a convenient way to transport sensor/control data. The lower layers of TCP insure data reliability. This example only simulates a quick integration of a Modbus-TCP enabled remote terminal unit (RTU) with a SCADA (Mango in this case); it doesn&#8217;t give any details of Modbus RTU itself. Modbus data may transported through many other physical media as well, RS485 being the most common. There are several reasons I personally recommend Ethernet over RS485, <a href="http://electrodesigns.net/blog/replace-rs485-ethernet/" target="_blank">this post may give you an idea why</a>. This is true not just for Modbus but any communication protocol.</p>
<ul>
<li>The first step is to download Modbus Slave utility from <a href="http://www.modbustools.com/modbus_slave.asp" target="_blank">here</a>. The is only a 10 minute demo but will serve our purpose. You can search a better option for yourself. Open up the program and click &#8220;Connection&#8221;, choose &#8220;Modbus TCP/IP&#8221;.</li>
</ul>
<div><a href="http://electrodesigns.net/blog/testing-modbus-tcp-mango-m2m/1-optimized-5/" rel="attachment wp-att-2091"><img class="alignnone  wp-image-2091" style="margin-top: 10px; margin-bottom: 10px;" title="Modbus-Mango M2M" src="http://electrodesigns.net/blog/wp-content/uploads/2012/07/1-Optimized.jpg" alt="Modbus-Mango M2M" width="500" height="345" /></a></div>
<div><a href="http://electrodesigns.net/blog/testing-modbus-tcp-mango-m2m/1-optimized-5/" rel="attachment wp-att-2091"><span id="more-2083"></span></a></div>
<ul>
<li>Right click on bit0 of register and choose the Function to be &#8220;Input Status&#8221;</li>
</ul>
<div><a href="http://electrodesigns.net/blog/testing-modbus-tcp-mango-m2m/2-optimized-3/" rel="attachment wp-att-2092"><img class="alignnone  wp-image-2092" style="margin-top: 10px; margin-bottom: 10px;" title="Modbus-Mango M2M" src="http://electrodesigns.net/blog/wp-content/uploads/2012/07/2-Optimized.jpg" alt="Modbus-Mango M2M" width="500" height="235" /></a></div>
<ul>
<li>Open up Mango M2M and add a new data source, it should be Modbus TCP/IP. Give some name to the data source, say, Modbus-TCP. Give the IP address of Modbus host. Since you are running the Modbus slave utility on the same machine so use your machine&#8217;s IP. Other things remain unchanged for now</li>
</ul>
<div><a href="http://electrodesigns.net/blog/testing-modbus-tcp-mango-m2m/3-optimized-3/" rel="attachment wp-att-2093"><img class="alignnone  wp-image-2093" style="margin-top: 10px; margin-bottom: 10px;" title="Modbus-Mango M2M" src="http://electrodesigns.net/blog/wp-content/uploads/2012/07/3-Optimized.jpg" alt="Modbus-Mango M2M" width="500" height="350" /></a></div>
<ul>
<li>On the right side click the button &#8220;Scan for nodes&#8221;, you will see &#8220;1&#8243; appearing. Click on it and choose Register range to be &#8220;Input status&#8221;. Click on &#8220;Read data&#8221; and you will see register values.</li>
</ul>
<div><a href="http://electrodesigns.net/blog/testing-modbus-tcp-mango-m2m/4-optimized-3/" rel="attachment wp-att-2094"><img class="alignnone  wp-image-2094" style="margin-top: 10px; margin-bottom: 10px;" title="Modbus-Mango M2M" src="http://electrodesigns.net/blog/wp-content/uploads/2012/07/4-Optimized.jpg" alt="Modbus-Mango M2M" width="500" height="348" /></a></div>
<ul>
<li>Add data points to the data source. Every bit in the input status register of Modbus host represents a data source. Adjust the properties as shown below.</li>
</ul>
<div><a href="http://electrodesigns.net/blog/testing-modbus-tcp-mango-m2m/5-optimized-3/" rel="attachment wp-att-2095"><img class="alignnone  wp-image-2095" style="margin-top: 10px; margin-bottom: 10px;" title="Modbus-Mango M2M" src="http://electrodesigns.net/blog/wp-content/uploads/2012/07/5-Optimized.jpg" alt="Modbus-Mango M2M" width="500" height="342" /></a></div>
<ul>
<li>Add the newly configured data points into watch list</li>
</ul>
<p><a href="http://electrodesigns.net/blog/testing-modbus-tcp-mango-m2m/6-optimized-3/" rel="attachment wp-att-2096"><img class="alignnone  wp-image-2096" title="Modbus-Mango M2M" src="http://electrodesigns.net/blog/wp-content/uploads/2012/07/6-Optimized.jpg" alt="Modbus-Mango M2M" width="500" height="325" /></a></p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Felectrodesigns.net%2Fblog%2Ftesting-modbus-tcp-mango-m2m%2F&amp;title=Testing%20Modbus-TCP%20on%20Mango%20M2M" id="wpa2a_10"><img src="http://electrodesigns.net/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://electrodesigns.net/blog/testing-modbus-tcp-mango-m2m/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Smart Energy, Who Will Take the Initiative?</title>
		<link>http://electrodesigns.net/blog/smart-energy-initiative/</link>
		<comments>http://electrodesigns.net/blog/smart-energy-initiative/#comments</comments>
		<pubDate>Sun, 01 Jul 2012 12:10:29 +0000</pubDate>
		<dc:creator>Aftab Sarwar</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Professional]]></category>
		<category><![CDATA[government]]></category>
		<category><![CDATA[grid]]></category>
		<category><![CDATA[grid solar]]></category>
		<category><![CDATA[power]]></category>
		<category><![CDATA[power solar]]></category>
		<category><![CDATA[power solar panel]]></category>
		<category><![CDATA[smart]]></category>
		<category><![CDATA[smart grid]]></category>
		<category><![CDATA[smart meters]]></category>
		<category><![CDATA[solar]]></category>
		<category><![CDATA[solar panel]]></category>

		<guid isPermaLink="false">http://electrodesigns.net/blog/?p=2024</guid>
		<description><![CDATA[A few years back I was a part of heated discussed in my company about Smart Grid technology. Basically, our<a href="http://electrodesigns.net/blog/smart-energy-initiative/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
				<content:encoded><![CDATA[<p><a href="http://electrodesigns.net/blog/smart-energy-initiative/smart-energy/" rel="attachment wp-att-2031"><img class="alignleft size-thumbnail wp-image-2031" title="smart energy" src="http://electrodesigns.net/blog/wp-content/uploads/2012/06/smart-energy-101x150.jpg" alt="smart energy" width="101" height="150" /></a>A few years back I was a part of heated discussed in my company about Smart Grid technology. Basically, our company was asked by a government institution in power sector to do all this. I, along-with one of my colleague, were on our way for a survey for a small demo to be presented before some government officials which could show them the &#8220;goodies&#8221; of Smart Grid. To demonstrate them how it can control billing, have advanced fault indications, energy harvesting, solve our greatest issue the energy theft and other features.</p>
<p>We spent days selecting the platform for demo as well as for long-term production. We prepared a list of several vendors offering solutions of smart meters. Suddenly the whole project got frozen due to lack of interest from the government agency. All our efforts were in vain. We, as a private company, could not invest resources in something which did not seem fruitful, at least for the time being.</p>
<p><span id="more-2024"></span></p>
<p>Smart Grid is sum of big projects, it means revolution. It includes not just monitoring but control as well. Huge support and funding is required from government to execute it. It is government who can regulate laws, impose them and come up with solution with the help of private industry. This left me with impression that what if the government is not interested at all in upgrading this 18th century power distribution system and do we have any choice in that case? I think that at least there is something which we can do. At least we can regulate our personal usage. So, exactly what can we do?</p>
<p>Following diagram shows a simple power management system of a small house. It has two power sources, 1 the main supply from the grid, the other from solar cells. The main component of this system is the charging and inverter unit. It can accept 220VAC from mains as well as around 37VDC volts from solar panel. A 24VDC battery set which is very common is used to store energy. This kind of arrangement is called off-grid solar power because it does not feed back into the grid. Off-course, we can not feed power into local grid without government permission. Infact in some countries, a prior permission may be needed for off-grid solar system as well. So you need to check that before investing in this adventure.</p>
<p><a href="http://electrodesigns.net/blog/smart-energy-initiative/smart-energy-opt/" rel="attachment wp-att-2039"><img class="alignnone  wp-image-2039" style="margin-top: 10px; margin-bottom: 10px;" title="smart energy at home" src="http://electrodesigns.net/blog/wp-content/uploads/2012/07/smart-energy-opt.jpg" alt="smart energy at home" width="500" height="368" /></a></p>
<p>The above is rather a very conventional way of integrating the solar system into an existing power backup system which already uses a UPS. Our solar power system, basically, is a solar panel. We, ideally, charge the existing batteries of <a href="http://electrodesigns.net/blog/ups/" target="_blank">UPS</a> from the electricity generated by this solar panel. We can add a switching scheme (Intelligent Power Switch) which intelligently disables the power from grid if we have enough power from solar panel. The Watt meters basically tell us how much power is obtained from which source. We can then compare it which the consumed power which is measured by a smart energy meter. We can optimize the system to use maximum power from solar panel.</p>
<p>How to calculate the solar panel, charger requirements etc.? I have attached a simple <a href="http://electrodesigns.net/blog/solar-power-calculator/" target="_blank">excel sheet which calculates these parameters as per load</a>.</p>
<p><a href="http://electrodesigns.net/blog/smart-energy-initiative/solar-power-calculator-opt/" rel="attachment wp-att-2042"><img class="alignnone  wp-image-2042" style="margin-top: 10px; margin-bottom: 10px;" title="solar power calculator" src="http://electrodesigns.net/blog/wp-content/uploads/2012/07/solar-power-calculator-opt.jpg" alt="solar power calculator" width="500" height="300.5" /></a></p>
<p>One of the practices to increase efficiency is to use DC equipment instead of AC.  Though this does not seem practical but it is possible if you are building a new house and the load like lights and fans can easily be used with DC as power source.</p>
<p>Where to get the smart meters? They must be expansive. Not at all! Smart meters are conventional meter, digital mostly these days, with some sort of connectivity option(s). At least they have RS485 connectivity available. Some advanced meters have Zigbee options as well. For a small home RS485 connectivity is enough. You can, then, interface it with normal PC to log the data and see results as much as desired. The price range of a smart meter with an average feature set is somewhere from 40$-150$ largely depends upon brand and functionality.</p>
<p>In a nut shell it is possible that we monitor, manage and control our power consumption without government initiative and make best use of our ever depleting resources of planet earth. Are you ready to take initiative?</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Felectrodesigns.net%2Fblog%2Fsmart-energy-initiative%2F&amp;title=Smart%20Energy%2C%20Who%20Will%20Take%20the%20Initiative%3F" id="wpa2a_12"><img src="http://electrodesigns.net/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://electrodesigns.net/blog/smart-energy-initiative/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Solar Power Calculator</title>
		<link>http://electrodesigns.net/blog/solar-power-calculator/</link>
		<comments>http://electrodesigns.net/blog/solar-power-calculator/#comments</comments>
		<pubDate>Sun, 01 Jul 2012 11:44:02 +0000</pubDate>
		<dc:creator>Aftab Sarwar</dc:creator>
				<category><![CDATA[Free Electronic Resources]]></category>
		<category><![CDATA[Software/ Host Apps]]></category>
		<category><![CDATA[calculate]]></category>
		<category><![CDATA[output]]></category>
		<category><![CDATA[parameters]]></category>
		<category><![CDATA[power]]></category>
		<category><![CDATA[rating]]></category>

		<guid isPermaLink="false">http://electrodesigns.net/blog/?p=2044</guid>
		<description><![CDATA[Often we need to calculate the power ratings of different components in a solar power systems. This may include the<a href="http://electrodesigns.net/blog/solar-power-calculator/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
				<content:encoded><![CDATA[<p><a href="http://electrodesigns.net/blog/solar-power-calculator/solar-power-calculator-opt-2/" rel="attachment wp-att-2047"><img class="alignleft size-thumbnail wp-image-2047" title="solar power calculator" src="http://electrodesigns.net/blog/wp-content/uploads/2012/07/solar-power-calculator-opt1-150x150.jpg" alt="solar power calculator" width="150" height="150" /></a>Often we need to calculate the power ratings of different components in a solar power systems. This may include the battery rating, solar charger rating, number of panels and their ratings. It all depends upon the output load, charging time and resources available. Attached is a very simple excel sheet which helps to calculate these parameters. Just change the parameters on left to see the reflected output calculations on right.</p>
<p><strong>Download Files:</strong></p>
<div id='filelist3'><ul id="listyofiles">
<li><a href="http://electrodesigns.net/blog/free-stuff/Solar%20Calculator/Solar%20Power%20Calculator.xls" target="_blank">Solar Power Calculator.xls</a></li>
</ul>
</div>

<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Felectrodesigns.net%2Fblog%2Fsolar-power-calculator%2F&amp;title=Solar%20Power%20Calculator" id="wpa2a_14"><img src="http://electrodesigns.net/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://electrodesigns.net/blog/solar-power-calculator/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Integrating Embedded SNMP Agent with Mango M2M</title>
		<link>http://electrodesigns.net/blog/integratin-embedded-snmp-agent-mango-m2m/</link>
		<comments>http://electrodesigns.net/blog/integratin-embedded-snmp-agent-mango-m2m/#comments</comments>
		<pubDate>Thu, 28 Jun 2012 14:15:33 +0000</pubDate>
		<dc:creator>Aftab Sarwar</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Embedded Networking]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[data source]]></category>
		<category><![CDATA[embedded snmp agent]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[m2m]]></category>
		<category><![CDATA[mango m2m]]></category>
		<category><![CDATA[mib file]]></category>
		<category><![CDATA[snmp]]></category>
		<category><![CDATA[snmp agent]]></category>
		<category><![CDATA[tcp ip stack]]></category>

		<guid isPermaLink="false">http://electrodesigns.net/blog/?p=575</guid>
		<description><![CDATA[Here is a little demo of about integrating an embedded SNMP agent with Mango M2M for data monitoring. Manago M2M<a href="http://electrodesigns.net/blog/integratin-embedded-snmp-agent-mango-m2m/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
				<content:encoded><![CDATA[<p><a href="http://electrodesigns.net/blog/integratin-embedded-snmp-agent-mango-m2m/7-optimized-2/" rel="attachment wp-att-2004"><img class="alignleft size-full wp-image-2004" title="Mango M2M" src="http://electrodesigns.net/blog/wp-content/uploads/2012/06/7-Optimized1.jpg" alt="Mango M2M" width="195" height="62" /></a>Here is a little demo of about integrating an embedded SNMP agent with Mango M2M for data monitoring. Manago M2M is an open source SCADA which is very easy to use. I am using a board design based on PIC18F97J60 Ethernet microcontroller.</p>
<p>This demo assumes that you have some previous knowledge of <a href="http://electrodesigns.net/blog/microchip-tcpip-stack-adding-4mb-spi-flash/" target="_blank">Microchip TCP/IP stack</a> and <a href="http://electrodesigns.net/blog/alarm-monitoring-snmp-tcp/" target="_blank">alarm monitoring</a> in general.</p>
<ul>
<li>The first step is to install Mango M2M on your system using <a href="http://mango.serotoninsoftware.com/download.jsp" target="_blank">these instructions on Mango website</a>. This installation is pretty straight forward but if you still need help, <a href="http://electrodesigns.net/blog/contact/" target="_blank">just contact me</a>.</li>
<li>Second is to install the latest Microchip TCPIP stack. I am using version 5.1 for this demo.</li>
<li>Run the &#8220;TCPIP Config&#8221; utility and make sure that SNMP agent is enabled in your code.</li>
</ul>
<div><a href="http://electrodesigns.net/blog/integratin-embedded-snmp-agent-mango-m2m/1-optimized-4/" rel="attachment wp-att-1990"><img class="wp-image-1990 alignnone" style="margin-top: 10px; margin-bottom: 10px;" title="Mango M2M - Setting up SNMP Agent" src="http://electrodesigns.net/blog/wp-content/uploads/2012/06/1-Optimized3.jpg" alt="Mango M2M - Setting up SNMP Agent" width="500" height="366" /></a></div>
<div><a href="http://electrodesigns.net/blog/integratin-embedded-snmp-agent-mango-m2m/1-optimized-4/" rel="attachment wp-att-1990"><span id="more-575"></span></a></div>
<ul>
<li>Download the firmware in your embedded board like PICDEM.NET2. I am using a varient of PICDEM.NET2 with <a href="http://electrodesigns.net/blog/microchip-tcpip-stack-adding-4mb-spi-flash/" target="_blank">enhanced memory</a>.</li>
<li>Download and install iReasoning MIB browser to brows the MIB file. The iReasoning is a free and very good tool for testing SNMP agents.</li>
<li>Load MIB file &#8220;mchip.mib&#8221; provided with the TCP/IP stack from File-&gt; Load MIBs in iReasoning MIB browser.</li>
<li>Write the correct IP address of the SNMP agent and click &#8220;Go&#8221;.</li>
</ul>
<div><a href="http://electrodesigns.net/blog/integratin-embedded-snmp-agent-mango-m2m/2-optimized-2/" rel="attachment wp-att-1991"><img class="wp-image-1991 alignnone" style="margin-top: 10px; margin-bottom: 10px;" title="Mango M2M - Browsing the MIB Table" src="http://electrodesigns.net/blog/wp-content/uploads/2012/06/2-Optimized1.jpg" alt="Mango M2M - Browsing the MIB Table" width="500" height="197" /></a></div>
<ul>
<li>Right click the first row which appears below and then left click on &#8220;Walk&#8221;. You will see all MIB table with their current value. Click the variable which you want to examin, the OID text field will show the corresponding OID value of it.</li>
<li>Now login to your Mango M2M installation and click on &#8220;Data Sources&#8221; icon (See the image below).</li>
<li>From the drop down menu select SNMP, click &#8220;Add&#8221; icon and you will be displayed with data source properties window.</li>
</ul>
<div><a href="http://electrodesigns.net/blog/integratin-embedded-snmp-agent-mango-m2m/3-optimized-2/" rel="attachment wp-att-1992"><img class="wp-image-1992 alignnone" style="margin-top: 10px; margin-bottom: 10px;" title="Mango M2M - Selecting Data Source" src="http://electrodesigns.net/blog/wp-content/uploads/2012/06/3-Optimized1.jpg" alt="Mango M2M - Selecting Data Source" width="500" height="620" /></a></div>
<ul>
<li>Type &#8220;Embedded SNMP Agent&#8221; in the Name field (or whatever you like). Type the Host IP. This is the IP of your Microchip board. Select SNMP version 2c. By default &#8220;Community&#8221; field is empty, write &#8220;public&#8221; in this field. I have changed the time to 2 sec for quick response. Click save.</li>
<li>We have added the data source, now we need to add the Data points.</li>
</ul>
<div><a href="http://electrodesigns.net/blog/integratin-embedded-snmp-agent-mango-m2m/4-optimized-2/" rel="attachment wp-att-1993"><img class="wp-image-1993 alignnone" style="margin-top: 10px; margin-bottom: 10px;" title="Mango M2M - Selecting Data Points" src="http://electrodesigns.net/blog/wp-content/uploads/2012/06/4-Optimized1.jpg" alt="Mango M2M - Selecting Data Points" width="500" height="112" /></a></div>
<ul>
<li>Click &#8220;Add Point&#8221; icon, a point properties dialog will open. In the name files write the name of point like &#8220;Temperature sensors&#8221; etc. and fill the OID field with appropriate OID. Add other point as you like. Keep the Data type &#8220;numeric&#8221;. Click Save.</li>
</ul>
<div><a href="http://electrodesigns.net/blog/integratin-embedded-snmp-agent-mango-m2m/5-optimized-2/" rel="attachment wp-att-1994"><img class="wp-image-1994 alignnone" style="margin-top: 10px; margin-bottom: 10px;" title="Mango M2M - Configuring Data Points" src="http://electrodesigns.net/blog/wp-content/uploads/2012/06/5-Optimized1.jpg" alt="Mango M2M - Configuring Data Points" width="500" height="176" /></a></div>
<ul>
<li>Now click the Watch icon on the left most of your screen. You will see a list of points on left. Click the small arrows in front of each point to add them into the watch list and see the values against each added point.</li>
</ul>
<div><a href="http://electrodesigns.net/blog/integratin-embedded-snmp-agent-mango-m2m/6-optimized-2/" rel="attachment wp-att-1998"><img class="wp-image-1998 alignnone" style="margin-top: 10px; margin-bottom: 10px;" title="Mango M2M - View live data" src="http://electrodesigns.net/blog/wp-content/uploads/2012/06/6-Optimized1.jpg" alt="Mango M2M - View live data" width="500" height="117" /></a></div>
<div>There are other ways to monitor alarms. Infact, Mango M2M supports a long list of industrial and network protocols which can be used to integrate alarms.</div>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Felectrodesigns.net%2Fblog%2Fintegratin-embedded-snmp-agent-mango-m2m%2F&amp;title=Integrating%20Embedded%20SNMP%20Agent%20with%20Mango%20M2M" id="wpa2a_16"><img src="http://electrodesigns.net/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://electrodesigns.net/blog/integratin-embedded-snmp-agent-mango-m2m/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Economics of Open Source Hardware</title>
		<link>http://electrodesigns.net/blog/economics-open-source-hardware/</link>
		<comments>http://electrodesigns.net/blog/economics-open-source-hardware/#comments</comments>
		<pubDate>Tue, 26 Jun 2012 12:35:52 +0000</pubDate>
		<dc:creator>muteeb</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Professional]]></category>
		<category><![CDATA[comparative advantage]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[open]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[open source hardware]]></category>
		<category><![CDATA[product]]></category>
		<category><![CDATA[source]]></category>

		<guid isPermaLink="false">http://electrodesigns.net/blog/?p=1969</guid>
		<description><![CDATA[Open Source Software vs Open Source Hardware In the field of open source software, a community develops new program or<a href="http://electrodesigns.net/blog/economics-open-source-hardware/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
				<content:encoded><![CDATA[<p><strong>Open Source Software vs Open Source Hardware</strong></p>
<p><a href="http://electrodesigns.net/blog/economics-open-source-hardware/economics/" rel="attachment wp-att-1970"><img class="alignleft size-thumbnail wp-image-1970" title="economics" src="http://electrodesigns.net/blog/wp-content/uploads/2012/06/economics-150x150.jpg" alt="" width="150" height="150" /></a>In the field of open source software, a community develops new program or makes addition to an existing program. Similarly, this type of approach is also used in open source hardware. But the difference between the open source software and hardware is that the development of software is free of cost, while in case of hardware, the physical developments are not easy and require some sort of investment.</p>
<p><strong>Economic Advantages</strong></p>
<ul>
<li><span style="text-decoration: underline;">Open way of Product Development without Market Research:</span> Open source hardware approach also helps to know about the customer’s needs and preferences without any market research. Consumers of specific product show their interest in a product and also indicate that what type of new product they want. For example their demands is 10 mega pixel cameras with zoom in and zoom out functions similarly Wi-Fi connectivity in a mobile etc. provides information about consumers demands and expectation about mobile devices. We have seen different innovative ideas through this channel. This type information and ideas enables companies in providing of best marketable products. This is also playing a vital role in products development.<span id="more-1969"></span></li>
<li><span style="text-decoration: underline;">Access to International Market and Competitiveness:</span> Today the world becomes a global village and countries are working to increase their share in the world trade. For this purpose countries only get access in the international market when they are producing product with best international standards on lower cost. Free hardware source gives an opportunity to the companies to be noticed by greater number of audience worldwide.</li>
<li><span style="text-decoration: underline;">Factors of Production and Comparative Advantage:</span> Countries who are capital are technology intensive has comparative advantage in the production and innovation in the open source hardware while it is difficult and costly for land or labor intensive countries.  Countries which are capital or technology intensive have comparative advantage over the land or labor intensive countries in the development of open source hardware.</li>
<li><span style="text-decoration: underline;">Specialization:</span> In the open source software specialization have not matter much but for physical development, specialization have play a vital role. Now only those economies are working towards specialization in the field of open source hardware whose have comparative advantage. It is difficult for labor or land intensive economies for achieving specialization in the field of open source hardware.</li>
</ul>
<p><strong>Economic Disadvantages</strong></p>
<ul>
<li><span style="text-decoration: underline;">Limitation in Open Source Hardware:</span> The economic philosophy work behind the open source hardware is to keep all the IP freely accessible to everybody. However, some companies allow restricted access to some of its product components to everyone. For example iRobot manufacturing company has its intellectual property rights of its reprogramming. Similarly some computer manufacturing companies encourage the access to all its components except the motherboards of these computers.</li>
<li><span style="text-decoration: underline;">Complex and Difficult to Open:</span>  In the open source hardware have many complexities and difficulties. For a hardware design or modification we required complete information of materials, dimensions and schematics. So in this case we need complete information, understanding as well as we face cost. This operation also takes time so the opportunity cost of a hardware design is very high.</li>
</ul>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Felectrodesigns.net%2Fblog%2Feconomics-open-source-hardware%2F&amp;title=Economics%20of%20Open%20Source%20Hardware" id="wpa2a_18"><img src="http://electrodesigns.net/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://electrodesigns.net/blog/economics-open-source-hardware/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Alarm Monitoring – Using SNMP or TCP?</title>
		<link>http://electrodesigns.net/blog/alarm-monitoring-snmp-tcp/</link>
		<comments>http://electrodesigns.net/blog/alarm-monitoring-snmp-tcp/#comments</comments>
		<pubDate>Tue, 19 Jun 2012 10:39:52 +0000</pubDate>
		<dc:creator>Aftab Sarwar</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Embedded Networking]]></category>
		<category><![CDATA[Professional]]></category>
		<category><![CDATA[alarm]]></category>
		<category><![CDATA[alarms]]></category>
		<category><![CDATA[alarms transmitted]]></category>
		<category><![CDATA[microchip tcp]]></category>
		<category><![CDATA[microchip tcp ip]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[snmp]]></category>
		<category><![CDATA[tcp]]></category>
		<category><![CDATA[tcp client]]></category>
		<category><![CDATA[tcp ip stack]]></category>

		<guid isPermaLink="false">http://electrodesigns.net/blog/?p=1955</guid>
		<description><![CDATA[Alarm monitoring is a popular field where multiple network node, some times called agents, get information from attached sensors and<a href="http://electrodesigns.net/blog/alarm-monitoring-snmp-tcp/" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
				<content:encoded><![CDATA[<p><a href="http://electrodesigns.net/blog/alarm-monitoring-snmp-tcp/mango/" rel="attachment wp-att-1962"><img class="alignleft size-thumbnail wp-image-1962" title="mango" src="http://electrodesigns.net/blog/wp-content/uploads/2012/06/mango-150x150.png" alt="Mango M2M" width="150" height="150" /></a>Alarm monitoring is a popular field where multiple network node, some times called agents, get information from attached sensors and transmit it onto the network where one or multiple servers called network monitoring system(s) (NMS) are listening to these alarms. The NMSs gather the info, calculate the statistics and present them in a way which is easily readable for human operators. The operators, then, are able to take quick decision based on these statistics.</p>
<p>This practice is very common in large networks where every single server, router or any other device typically keeps its own MIB (management information base) file and maintains it according to device condition. The device, other than doing it specific job, also send alarms which are typically called traps to the NMSs. However, the field has extended to general purpose small embedded devices as well for multiple applications like, power monitoring, environment and security to name a few.</p>
<p><span id="more-1955"></span></p>
<p>There are many ways of alarm transmission including HTTP, FTP, SMTP, SSH, SSL, TELNET etc but the most common are SNMP and CMIP. SNMP is (usually) employed over UDP while CMIP over TCP.</p>
<p><strong>About SNMP:</strong></p>
<ul>
<li>Widely used, small resources required to implement an embedded SNMP agent. Built in support in stacks available like that in Microchip TCP/IP stack or lwIP stack.</li>
<li>SNMP can easily be integrated into available NMSs like Nagios, TeMIP etc.</li>
<li>SNMP is UDP based</li>
<li>SNMP not very reliable because of two reasons. First, it is deployed on UDP, second, traps have no acknowledgement protocol defined. Although after SNMP v2, &#8220;<em>InformRequest</em>&#8221; can be used for that purpose but usually they have limited application.</li>
<li>Should be used when are lots of traps to be generated hence lots of traffic to the NMS</li>
<li>SNMP is less secure primarily due to UDP</li>
</ul>
<p><strong>About Custom TCP:</strong></p>
<ul>
<li>TCP is reliable</li>
<li>Important alarms should be transmitted over TCP</li>
<li>Implementing TCP client/server in microchip TCP/IP stack is very easy. Same is the case with lwIP.</li>
<li>Custom alarm feed can be used</li>
<li>System is more flexible</li>
<li>TCP has relatively better security than SNMP</li>
<li>You need to write your own alarm string formats unless the MCU is powerful enough to support protocols like CMIP which usually is not the case as CMIP is resource hungry and usually not preferred in embedded device. That’s why you would find (currently) much examples of it on internet.</li>
<li>TCP is especially useful when control is also desired alongside monitoring</li>
</ul>
<p>In a nutshell, keep all your alarms on SNMP, let it bear the traffic. While keep the critical alarms on TCP “as well” so the communication is reliable. Keep your controls over TCP. Of-course you can use many protocols simultaneously and this is cheap on modern microcontrollers. In one application I had used SNMP, HTTP pages for alarm status, TCP client which would communicate with remote TCP server using socket communication. At the same time alarms were transmitted over GSM network in the form of SMSs. Of-course somebody may think of using internet as well over GSM/EDGE or other network. It solely depends on recurring cost which is acceptable to the client.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Felectrodesigns.net%2Fblog%2Falarm-monitoring-snmp-tcp%2F&amp;title=Alarm%20Monitoring%20%E2%80%93%20Using%20SNMP%20or%20TCP%3F" id="wpa2a_20"><img src="http://electrodesigns.net/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://electrodesigns.net/blog/alarm-monitoring-snmp-tcp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.400 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2013-05-19 13:20:00 -->
