From Serial Monitor to Port Monitor

Feb 11, 2014 19:49



it's been a while since i wrote something for the "tech tweaks" tag. plus the fact there aren't much proper walkthroughs or tutorials for the topic i'm covering today. anyway, here goes!

Arduino users are pretty familiar with the Serial Monitor which most of the time shows the output of their Arduino sketches. but with the arrival of the Arduino YUN, things get more complicated especially if the microcontroller is powered independently from the computer it communicates with. see, using the serial monitor is only possible if there is a USB (Universal Serial Bus, get it?) connection between the two. so if there's none, how can you see the sketch's output right off the bat? the folks at Arduino introduces us to the Port Monitor, or simply known as the Console.

the Arduino guys give us this description:

The Console, based on Bridge, enables you to send information from the Yún to a computer just as you would with the serial monitor, but wirelessly. It creates a secure connection between the Yún and your computer via SSH.

so! let's go about with the how-to's, shall we?

to get the Console Monitor to work, you have to download PuTTY first if you are using Windows because Windows won't understand the commands you will be sending. otherwise, just fire up any terminal.

before going any further, open up your Arduino IDE and make sure you select the Arduino YUN under "Board" and the YUN's name and IP address under "Port" (both are under the "Tools" menu). this is only possible if your computer and the YUN are on the same wifi network.

NOTE: If your board is on a different network, you won't see it in the Ports menu.

USING SSH/PUTTY

*for non-Windows users*

type ssh root@yourYunsName.local in the terminal to establish a secure shell connection.

*for Windows users using PuTTY*

move the PuTTY executable file under C:/Windows so you can easily call it from the windows start menu. open the application and you'll encounter this:



under host name/ip address, type in the network address of your YUN (name + ".local"), for example "arduino.local". leave everything else to their default values.

you may encounter a Security Alert regarding connection to a server, just accept and click yes.

you will be next asked to "login as", type "root". then you will be prompted for the password, type the password to your YUN.

if everything goes well you now have access to the command line of the YUN!

THE PORT MONITOR

to get to the wireless Port Monitor, send the following command to your YUN on the terminal: telnet localhost 6571

VOILA! either your YUN will await input from you or you will see the data your YUN will be sending to you wirelessly! :)


tech tweaks

Previous post Next post
Up