Tuesday, July 26, 2016

How To Configure Your Intel Edison

In this tutorial, I would like to show you how to configure your Intel Edison for the first time before you start using it in your project. To do this, you need to connect your Intel Edison with your PC (I’m using windows os) through serial port. For this tutorial I use Intel Edison mini breakout board. At mini breakout board you will find two USB socket, one is use for powering the board and flash the firmware, and the other is for remote connection through serial line. Before, we start you’ll need remote software. In this example I use “Putty” as a remote software.



After you connect your Intel Edison breakout board, run command prompt and type “mode” then press enter. You will see which serial port number connect to the board as seen in the picture down below:

Now, it’s time to connect remotely using “Putty”, by default Intel Edison use 115200 baudrate. You need to configure your serial connection (COM number may vary, depends on your PC serial port detection) in my case I’m connecting to “COM5”  as in the picture above.



Press “Open” button to start connection, if you see blank screen just press enter then you’ll be asked to enter login name (by default login name is root without password).




To configuration you need to type “configure_edison” command, here are some configuration you need before you start using your Intel Edison.

Change Intel Edison Name

By default your board will be name as “edison”, to change your board name type “configure_edison --name” then you’ll be asked to enter new name as send in the picture below:




To make sure the changing happens, just logout then you will see the new name in front of “login” prompt. (in my case “iotdev login:”).

Configure Password

By default Intel Edison password is empty, to configure you need to type “configure_edison --password"

Once, you’ve done. SSH on WiFi interface will be enable automatically. So, next step is to set your WiFi network.

Configure WiFi Network

To start configure you need to type “configure_edison --wifi". Immediately, Intel Edison will start scan wireless network available near you.



Select the number of wireless network you want to connect. In my case I use hidden SSID, so I type 2 then you will be ask to enter your hidden SSID name. Make sure you type it correctly then you’ll be ask to confirm your SSID name. Once, it confirm you have to choose which type of security configured in your access point. After that, you need to type your wireless network password. When your connection established it will show your Intel Edison IP address.



You can check your WiFi address has been set to your device using “configure_edison --showWiFiIP". To test your Intel Edison IP address, use command prompt on your windows machine to ping your device IP address.



Now, disconnect your USB cable connecting to your remote port and start new remote session using “Putty” with SSH connection.

In this point your Intel Edison get dynamic IP address from your access point. When you start your project it might be annoying when you restart your Intel Edison and you get different IP address. So, how to set fix IP address in your Intel Edison?
To do this, you need to edit configuration using text editor. In this example, I use nano text editor. This editor already bundle in Intel Edison linux os and its more suitable for me to use.
Ok, type “sudo nano /etc/wpa_supplicant/wpa_cli-actions.sh” then press enter. Just find this script

if [ “$CMD” = “CONNECTED” ]; then
     kill_daemon udhcpc /var/run/udhcpc-$IFNAME.pid
     udhcpc –i $IFNAME –p /var/run/udhcpc-$IFNAME.pid –s
fi

then remark line udhcpc … , and type ifconfig $IFNAME your_fix_ip_address netmask 255.255.255.0 as in the picture below:

After complete editing press [Ctrl]+[o] to save the modification and press [Ctrl]+[x] to quit. Type “reboot” to restart your Intel Edison. Wait for a couple of second then start new remote session with fix IP address you’ve just configure.
If you want to set the gateway you need to type “route add default gw gateway_ip_address”, as seen in the picture below:


Now, your device ready for your project!


Another way, to configure you can use “configure_edison --setup", this command will bring you to configure name, change password and wireless connection in one shoot.