Introduction: Telnet to Your Arduino/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
Attachments
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.
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.
Step 3: Install Your Shell
Step 4: Telnet and Enjoy
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.
9 Comments
6 years ago
Nice, but still prefere docklight
It has much more useful options and also TCP/UDP terminal built in.
Their homepage is
http://docklight.de/
10 years ago on Introduction
Could you please make a Linux version. I have been looking for something like this since I started using the Arduino.
Reply 10 years ago on Introduction
hi,
thanks for the comment. You're wanting a Linux version of what?
cheers!
Gian
Reply 10 years ago on Introduction
I want the AVR terminal part
PS I'm sorry it took me so long to respond
11 years ago on Introduction
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.
Ralph
Reply 11 years ago on Introduction
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!
-gian
12 years ago on Introduction
Looks really good. Have you submitted this to the arduino forums yet?
Reply 12 years ago on Introduction
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.
Cheers!
-gian
/nev/dull
12 years ago on Introduction
Is this windows only? If so can you port it to linux? If not can you post the source code?