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.

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

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.
For more details, click: Telnet to your Arduino/AVR!

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top