In today's post we are gonna see how to connect Arduino YUN with Putty and access the files on Linux OS in Arduino YUN. In my last post Getting Started With Arduino YUN, I have explained in detail about basics of Arduino YUN. I am recall few important things here. Arduino YUN is a very powerful board with two processors on it. One is Arduino microcontroller used to control the output / input pins. The other processor is named as Atheros and it has Linus operating system on it, so one can easily run python scripts on it and can do any server or client side coding in it.
So, today we are gonna see ow to access this Linux operating system of Arduino YUN using Putty software in Windows. Putty is a third party software used for accessing serial terminal, perform telnet or SSH communication etc. So using this software we can easily access the Linux OS on Arduino YUN. So let's have a look how we are gonna do this.
Access Linux Server of Arduino YUN with Putty
- First of all, download the putty software. Its a free software and you can download it quite easily using google.
- After downloading the software, open it and you will have a screen similar to below image:
- Now first of all select the SSH, which is shown in above figure by # 2, then give the IP address of your arduino YUN and Port will remain 22. If you don't know how to get the IP address of Arduino YUN then read Getting Started With Arduino YUN.
- After adding this information, click on the Open button and for the first time, it will show a window similar to below image, simply click on YES.
- This above Window will appear only when you are using putty for the first time, it won't appear afterwards.
- After clicking YES, the below Window will open up asking for Login as:
- When it asks for login, give log in as "root" and the default password is "arduino".
- If you have changed the password in first tutorial Getting Started With Arduino YUN, then give that password now.
- When you will be typing the password, nothing will appear on putty that's common so you just simply type the password and hit ENTER.
- Now once you entered the password, it will get connected and you will get the below window.
- Now you are in the root folder of your Arduino YUN Linux operating system, now its just like a command prompt or Linux Command Line.
- Let's write some commands and test it out. Check out the below image:
- In the above figure, you can see the first command sent is "cd .." to go into previous folder.
- After that I send the command "cd mnt/sda1" to access the sd card, its the default folder for sd card.
- Next command I sent is "ls", it will show all the files or folder present in the sd card. Currently I have just one folder in my sd card named as Shell.
- After that I updated the opkg package by giving command "opkg update".
- As I am connected with internet on my Arduino YUN sield, so its automatically downloaded and updated and finally I got "Signature check passed".
- Next I installed a new package named as nano. In order to install it I used the command "opkg install nano". Nano is kind of notepad in Linux.
- Now we are gonna write a python script, so I typed "nano TEP.py", and after entering this command the below window will open up.
- In this window, you can write your python script and press Cntrl+X to Exit and it will ask for the save. Hit Y to save and N to No, and when you press Y then it will be saved.
- Let's check it out whether its saved or not, and in order to do so we have to again send the same command "ls" and it will give us the folders and files as shown below:
- You can see now we have TEP.py as well along with Shell folder.
- So, today we have seen how to connect Arduino YUN with putty and access the Linux side of YUN. Afterwards we tested few commands and also check how to write a python code in YUN.