Introduction: Telnet to Your Arduino/AVR!

Picture of Telnet to Your Arduino/AVR!
The other day I was wanting to check on one of my AVR's but I was upstairs and god knows it was too much of a hassle to go downstairs to where the microcontroller was. But, there were two idle computers sitting upstairs next to my lazy butt, so I had a half-day from work and decided to write an application that binds two ports: a serial port to connect to the Arduino/AVR and a TCP/IP port that I could telnet into from my wireless network or over the Internet. The application then act as a proxy between the TCP/IP network and the AVR.

To see the video better, click twice and bring it up in its own window and enlarge.  Otherwise, squint and you can see what's being typed.

So, I ended up modifying the AVR Terminal serial connection application that I had already written, and I added TCP/IP support to it. To go along with it, I wrote some firmware that provides something like a UNIX shell, giving me remote access to all the pins, fuse settings, etc. You can turn on LED's and all that stuff remotely. It even supports adjusting the clock speed in real-time and has a pseudo-password system that gives the framework for Access Control Lists or authentication for root-level commands (like powering down subsystems, etc). Here are some of the things it can do:
  • Display your cpu frequency
  • Set any pin to input or output
  • Read the state of any pin
  • Send logic 1 and 0 to any pin to turn on LED's, etc
  • Power down and power up the SPI, TWI, USART, and ADC peripherals
  • Read the lower fuse, higher fuse, external fuse and lock bits in real-time
  • Start timers for automatically timing events and things.
  • A framework for an authentication system into EEPROM
  • Establish any available clock prescaler in real-time
  • Written in C++ and compiled for an ATmega328P

This instructable details how you can download the software (and firmware, if you like), install it, and start accessing your AVR from your wireless home network or over the Internet.

Step 1: What You'll Need

  • An stand-alone AVR or Arduino/clone (for detailed instructions on how to make your own, fairly complete stand-alone AVR system including an external crystal, decoupling capacitors, and a regulated power source, see my other instructable).
  • A serial or USB connection to your host PC
  • The AVR Terminal version that has the embedded TCP/IP server
  • Optionally, the AVR Shell (avrsh) if you want to run firmware on your target AVR/Arduino to get access to your peripherals.

The TCP/IP gateway works with whatever firmware you may be using or want to write as long as it communicates via the UART to the PC. Unfortunately, there is not a Java version, so the AVR Terminal only runs on Windows at the moment.

Step 2: Download and Install the AVR Terminal and TCP/IP Server

Picture of Download and Install the AVR Terminal and TCP/IP Server

The AVR Terminal is a windows application that I introduced in earlier instructables.  It can talk to your AVR via the RS232 USART as well as listen for inbound TCP/IP connections and relaying them across the RS232 connection for response from your waiting AVR.  It isn't feature-complete but offers an initial tour of features detailed here and in my other instructables.  The most recent version can be downloaded here.

The software doesn't take a full install; you can just run the software from it's directory.  The text box in the tool bar that says ANY is the IP address to be bound for listening.  ANY will bind any and all IP addresses, or optionally you may list one to bind to particularly.

The text box to the right of the IP address is the IP port to which the server will be bound.  Default is 23232 but you can change this to whatever you like.

Step 3: Install Your Shell

Before your AVR can communicate back with you, you'll need to have some sort of operating system or shell on the target AVR.  There are a couple availble including my AVR Shell and the Bitlash shell.

Alternately, use this experience as a chance to write your own minimal shell.

Step 4: Telnet and Enjoy

Picture of Telnet and Enjoy
Remember your configuration information or you may keep it at defaults.  In my example picture, I am on a host named "newton" and telnet to the machine that my AVR is connected to, a host called "quadcpu1."  You can see the standard telnet output.

So, if you have kept it at defaults, you can access your AVR/Arduino from your TCP/IP network with:

telnet 23232

or if you're on the same box:

telnet localhost 23232

Just remember to use the configuration you changed it to, if you changed it.

That should be it.  The source code for both the telnet server and the AVR firmware are freely available as open source and should provide you with enough good info to let you modify it or write your own versions of either.  Next step might be to write a Java or Qt implementation of the TCP/IP server so that Mac and Linux users could benefit.


electronics-base (author)2017-01-14

Nice, but still prefere docklight

It has much more useful options and also TCP/UDP terminal built in.

Their homepage is

jgidel (author)2012-10-25

Could you please make a Linux version. I have been looking for something like this since I started using the Arduino.

nevdull (author)jgidel2012-10-26


thanks for the comment. You're wanting a Linux version of what?


jgidel (author)nevdull2012-11-05

I want the AVR terminal part

PS I'm sorry it took me so long to respond

Ralphxyz (author)2012-04-03

So far this is going PC to ATmega which is great, how about going the other way?

Say I wanted to contact a time server?

Thanks for posting this.


nevdull (author)Ralphxyz2012-04-06

Hey Ralph,

Well, you have a couple of options. Using the existing connection, you could read serially over the USB for comms from the AVR and then proxy that information out through your PC's internet connection, then back for the reply. Alternatively, you could use an ENC28J60 and a pulse jack to access the ethernet using a custom TCP/IP stack (say, uIP) or even attach a WIZ811 module that manages the MAC/PHY of ethernet plus has a built-in TCP/IP stack on top of it, all accessed via SPI between the MCU and the WIZ811.

Just a few ideas.

Good luck!

Goosen (author)2011-01-14

Looks really good. Have you submitted this to the arduino forums yet?

nevdull (author)Goosen2011-01-14

Thanks! No, I haven't submitted it to the arduino forums. I started to rewrite it in Qt and ended up beginning rewriting it in Java because it had a better COM port access system. It currently runs on Ubuntu Linux, Windows, and Mac but it's just begun.

As for source code, I'll be glad to post it up here. Look for it soon.


Goosen (author)2011-01-14

Is this windows only? If so can you port it to linux? If not can you post the source code?

About This Instructable




Bio: Gian is a computational biologist and is the Managing Director at Open Design Strategies, LLC. He holds a BA in Molecular/Cellular Biology and an ... More »
More by nevdull:Create A Custom Medieval-/Fantasy-Style Calligraphy QuillPractical DACsUsing Enumerated Types as Bitflags
Add instructable to: