Arduino Communications Using the netcat(nc) Utility
Jvaughters (Talk | contribs) |
Jvaughters (Talk | contribs) |
||
Line 1: | Line 1: | ||
+ | <anyweb>http://combustory.com/wiki/ads/ad_rtc.html</anyweb> | ||
+ | |||
+ | {{default}} | ||
+ | |||
+ | <!--------------------------------Featured picture------------------------------ | ||
+ | {| id="mp-tfp" style="margin:4px 0px 0px 0px; width:30%; background:none;" | ||
+ | |class="MainPageBG" style="width:30%; border:1px solid #ddcef2; background:#faf5ff; vertical-align:top; color:#000;"| | ||
+ | {| cellpadding="2" cellspacing="5" style="vertical-align:top; background:#faf5ff; color:#000; width:30%" | ||
+ | ! <h3 id="mp-tfp-h2" style="margin:0; background:#ddcef2; font-size:120%; font-weight:bold; border:1px solid #afa3bf; text-align:top; color:#000; padding:0.2em 0.4em">Featured picture</h3> | ||
+ | |- | ||
+ | |style="color:#000;"| {{Featured Picture}} | ||
+ | |} | ||
+ | |}<!-- | ||
+ | |||
+ | |||
+ | |||
+ | <---------Interwiki strapline----------> | ||
+ | <anyweb>http://combustory.com/wiki/ads/ad_rtc_1.html</anyweb> | ||
=Overview= | =Overview= | ||
Why reinvent the wheel. I have seen very complicated methods for communicating with the Arduino, Including some I have made on my own. What I have recently found out is that the easiest way to communicate to the Arduino is using the existing tool ''netcat''. It is soooooo simple and super powerful. You can send the output to a Network port and access the communications from literally any place in the world. | Why reinvent the wheel. I have seen very complicated methods for communicating with the Arduino, Including some I have made on my own. What I have recently found out is that the easiest way to communicate to the Arduino is using the existing tool ''netcat''. It is soooooo simple and super powerful. You can send the output to a Network port and access the communications from literally any place in the world. |
Revision as of 01:02, 8 September 2012
Welcome to Combustory
Any questions or comments:
- Send them to - combustor@combustory.com
|
Overview
Why reinvent the wheel. I have seen very complicated methods for communicating with the Arduino, Including some I have made on my own. What I have recently found out is that the easiest way to communicate to the Arduino is using the existing tool netcat. It is soooooo simple and super powerful. You can send the output to a Network port and access the communications from literally any place in the world.
Assumptions
- You have basic knowledge of command line usage
- You know how to load a program to the Arduino
Mini2440 or Embedded Systems
Embedded systems like the Mini2440, use Busy Box as a small utility package that includes a version of nc that makes communications to Arduino a breeze. All you have to do is go to a terminal and use these two commands after you plug in the Arduino.
stty -F /dev/ttyUSB0 cs8 115200 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts nc -f /dev/ttyUSB0
You should now have a terminal session that is communicating with the Arduino. Of course you should have a program that responds to serial communication on the Arduino, or nothing will be happening. How this works is the nc command has redirected the input and output streams of the /dev/ttyUSB0, which is the Arduino terminal and the stty command sets the serial communication parameters.