Outils pour utilisateurs

Outils du site


wiki:tutoriels:intel_galileo_linux

Ceci est une ancienne révision du document !


Part 1 :Serial Terminal Introduction

The purpose of this section is to propose a protocol for a new user to be able to create a serial connection to their Intel Galileo Gen 2 using a “terminal emulator”. A “terminal emulator” is a program that will allow us to communicate with the Galileo via command line. Note The command line communication in and of itself offers no benefit to a newbie user. However, it is the only way to take advantage of a whole host of tools to better exploit our Galileo Gen 2.

The reader should already have read through the previous sections and should be familiar with the basic Terminal Connection Vocabulary. Just as importantly all drivers and firmware should be up to date. The reader should equally have already installed the Arduino IDE and have successfully tested the communication with the Galileo using the "Blink" example.

Intel's IoT devellopement kit

To start we must first download a larger version of linux than what is already found within the galieo's flash drive. We must also download a software that will allow us to write this software onto a microSD card. I will be using Win32 The software can be downloaded from the “Galileo Basic's section” of this tutorial or can be found here:

Intel's IoT Dev Kit

Win32 Disk Imager

  • After downloading Win32 Disk Imager install as you would any other program
  • After downloading Intel's Iot dev kit:
    • Create a new folder “IoT” in the C:/Galileo/ folder
    • Unzip into C:/Galileo/IoT
    • You should have a filenamed “iot-devkit-prof-dev… .direct”
  • Place your MicroSD (1gb-32gb) into a card reader and connect it to your PC
    • Many PC's have an integrated SD card reader
    • If yours does not you will need a USB to SD card converter
  • Open Win32 Disk Imager

  • Select the blue folder next to the large blank space

  • Enable “search all file types” in the bottom right corner of the search menu
  • Search within C:/galileo/IoT
  • Select the “iot-dev-… .direct” file

  • The large blank space is now “iot-dev-… .direct'
  • Verify that the selected “write drive” next to the blue folder is the drive that corresponds with your SD card
    • You can easily test this by connecting then disconnecting your SD card reader and noting the drive that no longer appears. This is your SD card.
  • Select Write

  • You will br promoted to confirm the operation
  • Select Yes
  • The file transfer will require 3-5 minutes
  • DO NOT DISCONNECT THE SD CARD DURING THIS OPERATION
  • When complete you will be prompted that the file transfer has been successful

Accessing the Linux Shell

I will be using PuTTY for this tutorial which can be downloaded here:

PuTTY. This is a well known software for Windows that will enable SSH and serial communication with the Galileo.

There are multiple methods to establish serial communication with the Galileo. In this tutorial we will be using just an Ethernet Cable and a pre-made Arduino Script. Other methods require special FTID cables which I do not currently have.

<note>

void setup() {

Serial.begin(9600);
//It’ll not continue until you send an ‘a’ through the serial monitor
while(Serial.read()!='a'){
  Serial.println("hello");
  delay(1000);
}
//Display ifconfig result to serial monitor
system("ifconfig > /dev/ttyGS0");

}

void loop() { } </note>

  • First we will copy/paste this code into the Arduino IDE
    • The command “system(“ifconfig > /dev/ttyGS0”);” will ask for, then transmit the Galileo's Ethernet IP address and send it to the Arduino Serial monitor

  • Before transfering the sketch verify the the COM#
  • Now that linux is being ran from the SD card, arduino MAY recognise the arduino under a different COM#
  • You can verify the COM# using start>run>devmgmt.msc>Ports(COM & LPT) mine is now COM5
    • Verify connection with “Blink Example”
  • Transfer the sketch, after succesful tranfer, open the Serial Monitor

  • The serial monitor (at 9600 baud) will be transmitting “hello”
  • Type “a” into the serial monitor in the top bar
  • You will now have this list of IP addresses and other information
    • We need the IP address that has been highlighted in blue
    • Copy this IP address

  • run PuTTY
  • Within “Host address” Paste the IP address previously Copied
  • Select Open

  • You are presented with a security alert
  • Select Yes
  • It may take a moment to connect

  • You will now be asked to login into Linux that has been installed onto the Galileo
  • Use the login “root”
  • When ” root@galileo:~# “ appears, you are succesfully signed into the Linux shell

  • We can see that Python can be easily invoked using this interface
  • We simply type “Python” into the command line and we have Python now running on our galileo.
  • Yes; 2+3 does equal 5

Part 1 Conclusion

After reading the first part of the Linux Terminal Communication, you should now have the Intel IoT devellopement kit installed onto your Galileo Gen 2. We have introduced only 1 means of serial communication; using an ethernet cable and an arduino sketch. We hope to explore the pros/cons of this choice over an alternative method. To test a second method, we will need an FTDI cable.

It should be noted that there exist multiple terminal emulators, each with pros & cons. It may interest certain users to consider:

Part 2: SSH for Newbies

Secure Shell is a cryptographic network protocol for operating network services securely over an unsecured network. It is the method that we must use in order to communicate with the Intel Galileo. In order to help new users, we have compiled a short list of helpful commands to get jump started.

For all of these examples:

  • Hit enter/return after every command unless specified otherwise
  • All commands are lowercase and case sensitive
  • All commands will be presented with first their SSH defintion
    • Then a more casual term to help us understand what it does
    • Finally a brief explanation of what it does

Where am I

  • print working directory
  • pwd
  • It will identify what file you are currently in.
    • In this case /home/root

What is in here

  • list command - all files in long format (date/size/ect) h (display setting)
  • ls -alh?
  • It will give a full list of all folders and files within the current directory
    • In this case I have node_history, python_history, ect

Run a Program

  • Type the name (case sensitive) of the file we want to execute
  • In this example we will use “python”
    • Python 2.7.3 is now operating on our Galileo

Terminate a running program

  • Ctrl-d will terminate a running program
  • Ctrl-d will terminate the terminal session if no program is running

Create a new folder

  • make directory
  • mkdir “directory name” or mkdir “dir/file/path”
  • We will create a folder named dirTest
    • mkdir dirTest
    • use ls -alh to verify it exists

cd

  • change directory
  • allows you to go into other files
LDAP: couldn't connect to LDAP server
wiki/tutoriels/intel_galileo_linux.1482196446.txt.gz · Dernière modification: 2016/12/20 01:14 de royce