Intel Galileo: I can’t live without a shell…

Hi ,

as promised in my last post, it’s time to write some code and to create some solded part! :-) So…let’s start.

An embedded Linux board without a shell has no sense in my opinion. I think this after many, many, toooooo many experience with embedded boards, so similar to black boxes! :-(

You know, I prefer the old style serial shell (the original RS-232 one!), but since Intel Galileo has a fast ethernet plug one can use also a telnet or ssh connection.

So, if you prefer the RS-232 shell, you must build a simple cable in the following way:

Material:

  • One jack 3.5” stereo male connector (you can reuse it form an old pair of earphones!)
  • One DE-9 pin standard female connector for RS-232
  • Three not too long wires
  • Some basic soldering skill :-)

Schema (drawn by myself ):

serial Galileo

The cable will be connected to the Galileo using a devoted female jack 3.5” connector (right, you can’t use it to plug in your earphones! ^__^) and to the host pc via a native RS-232 male connector or (more probably) using a ten-euros Usb-to-Serial converter.

At this point you will connect to the Galileo using a shell program (in Linux and Mac I use Minicom, on Windows I use PuTTY) with the following (I know, you know… they are always the same) parameters:

  • Serial Port: the identifier of the connected port on the host pc (i.e. COMxx, /dev/ttyUsbx etc. depending on your operating system)
  • Speed: 115200 bps
  • Flow Control: None
  • Parity: None
  • Stop bits: 1
  • Data bits: 8

If you prefere a more “network oriented” solutyion, you can use a telnet shell.

In order to do this, you must download a particular sketch via Arduino IDE for Intel Galileo. This sketch will call some Linux system shell commands (yes, you can launch Linux shell scripts using the Arduino skecth programming…it’s very interesting and it is one of the more celebrated features of Intel Galileo!!!).

You can connect the host pc and the Galileo board via cross-patch network cable or using a Fast Ethernet switch between the host pc and the board.

This is the sketch I used . You can copy/paste it on the Arduino IDE then you will download it on Galileo after his boot, lastly open the IDE serial terminal to see the output of linux commands.

//Sketch to connect a PC host to Linux Galileo via telnet 
// Written by M. Lastri fo garretlabs.wordpress.com
//The sketch will:
//1. set the Galileo IP to 169.254.1.1 
//2. start telnet server
//------>>>>>After this the user can:
//3. From the pc host (i.e. with IP =169.254.1.2) send ping 169.254.1.1 and verify the answer
//4. From the host send the famous command "telnet 169.254.1.1"...and the Linux Galileo shell should appear (user: root, no password)!
//5. Enjoy!
void setup() 
{
  system("ifconfig > /dev/ttyGS0");
  system("ifconfig eth0 169.254.1.1 netmask 255.255.0.0 up");
  system("ifconfig > /dev/ttyGS0");
  system("telnetd -l /bin/sh");
}
void loop() 
{
  //nothing here 
}

Important note: someone on internet verified that if Galileo starts without the ethernet cable connected, the telnet server will not start properly, so, ensure that you will power on the Galileo board with the ethernet link connected (directy to the host pc or to the switch).

Another important thing: if using for Galileo and for host pc the well known LAN addresses 192.168.1.x with mask 255.255.255.0, the connection between pc and Galileo doesn’t seem to work in my setup. It is a very strange behavior in my opinion…so we should investigate on it! ;-)

In the next post dedicated to Galileo I will start to play with porting sketches (and their problems) from Arduino UNO/Mega ADK¬† to the Intel platform. Well’ verify that it’s no so simple… or, better,as we say in Italy, “It isn’t all gold which is brilliant” ! :-)

…Bye (male & female) geeks!

About these ads

One thought on “Intel Galileo: I can’t live without a shell…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s