Getting Started with the Intel® Galileo Board on Linux*

Published: 03/10/2020, Last Updated: 09/09/2015

This guide contains steps to set up your Intel® Galileo board, including steps to setup a serial terminal, connect over Wi-Fi, and install your preferred integrated development environment (IDE) for general development in JavaScript*, C/C++, or Python*. If you want to get going quickly in Arduino*, skip to installing the Arduino IDE.

If you want to work with another operating system, see the getting started books for Windows* or Mac*.

OS Requirements

The software used to install and setup the board is compatible with both 32-bit and 64-bit versions of Linux*

Material Requirements

Here is a list of all the requirements you'll need in order to assemble and set up either your Gen 1 or Gen 2 board:

  • A micro-SD card. The card must be at least 2 GB and can be up to 32 GB
  • An SD card reader for your system
  • Intel® Galileo Gen 1 board needs:
    • A 5-V power supply
    • A DB-9-to-3.5mm audio cable
    • A serial-to-USB cable
  • Intel® Galileo Gen 2 board needs:
    • 6-pin Serial to Type A USB cable (FTDI cable # TTL-232R-3V3 is recommended)
    • A 7-15-V DC power supply
  • If you want to set up your board for Wi-Fi, you'll need one of these adapters:
    • Intel® Centrino® Wireless-N 135
    • Intel® Centrino® Advanced –N 6205

If you want to get going quickly in Arduino*, skip to installing the Arduino IDE.

Step 1: Make a Bootable Micro SD Card

You must boot your Intel® Galileo board using a micro SD card that contains the latest Intel® IoT Developer Kit version of the Yocto*-built Linux image.

Linux is the operating system that powers the Intel® Galileo board. While there is already a version of Linux built into your board, the developer-kit version of Yocto-built Linux includes even more libraries and resources to help developers create applications in their favorite programming language. This version includes GNU Compiler Collection (GCC)*, Python*, Node.js*, OpenCV, to name a few.

In addition, sketches that you upload to the Intel® Galileo board are erased when the board is powered down. To be able to resume the sketch even after powering down your board, you must boot from a micro SD card.

Requirements

You must have a few things to begin. The steps below are for creating a micro SD card with a Linux* host system. There are separate instructions for Windows, Mac OS X, and Linux.

Download and Extract the Image

This section contains steps to download and extract the latest developer kit version of the Linux image.

  1. Download the latest Intel® Galileo board microSD Card Linux* Operating System Image from the Intel® Galileo board Downloads page.
  2. Right-click the .bz2 file and select Extract here to start the extraction process.
  3. Wait for the file to finish expanding. You should now have a file called iot-devkit-version-mmcblkp0.direct alongside the original .bz2 file, where version is either latest or a date in the YYYYMMDDHHMM format.

    Extract the downloaded .bz2 file to a .direct file.

Format Your Card

This section contains steps to format and partition your micro SD card using Ubuntu* and Unity* Dash. See below for how to do it using the command line.

  1. Run Disks, as follows:
    1. Run Unity Dash (desktop search utility).
    2. Enter the command: disks.
    3. Select the Disks app.
  2. Insert the micro SD card into your computer.
  3. In the left sidebar, select the micro SD card.

    in Disk Utility select the SD card

  4. If you see multiple partitions, select a partition and click the icon to delete the partition.

    click the icon to delete extra partitions

  5. Click the + icon to create a new partition.

    click the + icon to create a new partition

  6. From the Type drop-down list, select Compatible with all systems and devices (FAT). In the Name field, type yocto to make it easier to identify in the steps below.

    define the partition type and name

  7. Wait for Disks to finish formatting your micro SD card. It should only take a moment. Once done, your micro SD card is mounted.

    verify that the SD card is mounted

Format Your Card (Command Line)

  1. Insert your sd card.
  2. Open a terminal window.
  3. Type: sudo df. You should see a display of mounted drives. If your SD card is 4GB, the 1k-Blocks should be stated at approximately 3980000.
  4. Note the name of the card in the left column.
  5. Unmount the card to allow formatting of the card:

    sudo umount /dev/sdb1

    where sdb1 is your card as shown in the left column.
  6. Format the card by doing the following:

    sudo mkdosfs /dev/sdb1 –F32

  7. When the format is complete, you can remount by either reinserting the card or:

    sudo mount /dev/sdb1

Write the Image to Your Card

This section contains steps to write the image to the micro SD card.

  1. Launch Terminal.
  2. Navigate to the location of your expanded .direct file. For example, if your .direct file is on your Desktop, enter the command:

    cd ~/Desktop/
  3. To list all mounted drives, enter the command:

    sudo fdisk -l
  4. When prompted, type your root password and press Enter.
  5. Look for the partition with type FAT32. Check the FAT32 partition against the parent disk size; it should be the size of your micro SD card. Note the disk name of the SD card, which should have a name similar to /dev/sdb. Be sure not to confuse the disk name with the partition name, which should have a name similar to /dev/sdb1.

    note the disk name of your SD card, not the partition name.

  6. Use the dd command to write the image to the card. Replace version with the version you are using, which should be either latest or a date in the YYYYMMDDHHMM format. Replace diskname with the disk number you noted in the previous step.

    Caution: Ensure that you have the correct disk name, as described in the step above. Copying and pasting the command below with the wrong disk name could result in your data being erased from the wrong drive.

    sudo dd if=iot-devkit-version-mmcblkp0.direct of=/dev/diskname bs=3M conv=fsync
  7. Wait for the write process to finish. Please be patient, as this may take up to 5 minutes. If the command is working properly, you should see flashing lights on your card reader. Once the lights stop flashing, you will see Terminal output confirming records in and out.

    Once the lights on your SD reader stop flashing, verify that your Terminal output contains records in and out.

    Once the write process is complete, you will have a bootable micro SD card named 53 MB Volume with the following contents:

    Complete the write process and verify that your bootable SD card has the correct contents.erify that your bootable SD card has the correct contents.

  8. Eject the micro SD card.

You can now insert the card into the micro SD card slot on your Intel Galileo board. When you power up your board, the board automatically boots using the image on the card.

Now that you have created your bootable card, continue to assemble and power your board. If you want to get going quickly in Arduino, skip to installing the Arduino IDE.

Step 2: Assemble and Power your Board

This section walks you through assembling your Intel® Galileo board.

Assemble the Intel® Galileo Gen 1 Board

Requirements

  • An Intel Galileo Gen 1 board

    Example of the Intel® Galileo Gen 1 board
  • A 5-V power supply (should have come with your board)

    A 5-V power supply

  • A DB-9 to 3.5mm audio cable

    ADB-9 to 3.5mm audio cable

  • A serial to USB cable

    A serial to USB cable

  • A 2-GB to 32-GB micro-SD card

    A micro-SD card with 2GB or greater

Set Up the Intel® Galileo Gen 1 Board

This section walks you through assembling your board.

  1. Confirm flashed SD card is inserted in your board properly.
  2. Plug in the power supply to your board. Plug the other end into your wall socket. You should see the LED in the lower left-hand corner light up.

    Galileo Gen 1 with power cable

  3. Plug the DB-9 to 3.5mm audio cable in to your board.

    Galileo Gen 1 with audio cable

  4. Connect the DB-9 end of the cable to the serial to USB converter.
  5. Plug the other end of the serial to USB converter in to a USB port on your computer.

    Galileo with all cables

Now that your board is ready, set up a serial connection to your board. If you want to get going quickly in Arduino, skip to installing the Arduino IDE.

Assemble Intel® Galileo Gen 2 Board

Requirements

  • An Intel Galileo Gen 2 board
  • A 7-15V DC power supply

    A 7-15V power supply

  • 6 pin Serial to Type A USB cable (FTDI cable # TTL-232R-3V3 is recommended)

    ADB-9 to 3.5mm audio cable

  • A 2-GB to 32-GB micro-SD card; see Step 1: Make a bootable SD card for setup prior to assembling your board.

    A micro-SD card with 2GB or greater

Set Up Galileo Gen 2 Board

  1. Confirm flashed SD card is inserted in your board properly.
  2. Plug the DC power supply in to your board. Plug the other end into your wall socket.

    Plug the power supply in to the board

  3. Wait for two green LEDs to light up.

    Wait for the two green LEDs to light up

  4. Plug in the 6 pin Serial (FTDI) to USB cable.

    Plug in the FTDI cable

  5. Plug the other end of the FTDI cable in to a USB port on your computer.

    Plug the FTDI cable in to your computer

Now that your board is ready, set up a serial connection to your board. If you want to get going quickly in Arduino, skip to installing the Arduino IDE.

Step 3: Set Up a Serial Terminal

This page describes how to set up a terminal emulator on a Linux system to use with the Intel Galileo board.

Install Drivers

Intel Galileo Gen 1 Board

Your computer should already have the USB converter drivers installed. If you have trouble establishing a connection, refer to the documentation provided by the manufacturer of the USB converter.

Intel Galileo Gen 2 Board

Your computer should already have the FTDI and USB drivers installed. If the FTDI drivers are not installed, we recommend following Sparkfun’s helpful tutorial.

Communicate

At the end of this section you will have connected to the Intel Galileo board through a terminal, and checked whether your firmware is up to date.

  1. If you haven't already, install the screen shell session manager by entering the following in the Terminal:

    sudo apt-get install screen

  2. Launch the Terminal.
  3. Connect to your board by entering:

    sudo screen /dev/ttyUSB0 115200

  4. You may be asked for your root password (within Linux). If so, type in your root password and press Enter.
  5. When you see a blank screen, press the Enter key twice.
  6. You should see a login screen.

    The standard login screen

  7. The password is empty, so press Enter. You should see the following:

    Prompt after logging in as root

    Note By default the root password is blank. You can set the root password by entering the command passwd.

Testing Your SD Card Image

  1. You can easily check the version of the image your board is using to boot up, as follows:
    1. Open a serial connection session with your board. Enter the following:

      cat /etc/version

    2. The image version is displayed in YYYYMMDDHHMM format. If your board is booting from its default image instead of the image you just downloaded, the version reflects an older date, such as 201410101603. You should see a more recent image version, such as 201502260041.

      Type cat /etc/version to check the version of your Yocto image.Type cat /etc/version to check the version of your Yocto image.

Step 4: Connect Over Wi-Fi

You will need a network connection to use the Intel® XDK or Intel® System Studio IoT Edition. In this guide you’ll set up network access to your Intel Galileo Board and obtain an IP address using Wi-Fi. To connect using Ethernet, follow the steps in the article Connecting your Intel® Galileo board using Ethernet.

Install Your Wi-Fi Adapter

For the purpose of this tutorial we are using the Intel® Centrino® Wireless-N 135.

  1. Assemble the wireless card with the aluminum plate, to help keep the wireless card in place on the board.

    assemble the wireless card

  2. Connect the antennas to the wireless card.

    connect the antennas

  3. Insert wireless card in the mini PCI Express slot. Once the wireless card is inserted into the Mini PCI Express slot, press the wireless card gently towards the board until it locks in place.

    insert the wireless card in the mini PCI Express slot

Establish Communication

  1. Once the Intel® Galileo board is powered up, you should verify the Wi-Fi adapter is connected and working. To do this, run the following Linux commands on your board, via the serial session described into Step 3: Set up a serial terminal.
  2. At the command prompt, type lspci -k | grep -A 3 -i "network" to verify your Wi-Fi adapter.
    root@galileo:# lspci -k | grep -A 3 -i "network"
    01:00.0 Network controller: Intel Corporation Centrino Wireless-N 135 (rev c4)
                                Subsystem: Intel Corporation Centrino Wireless-N 135 BGN
                                Kernel driver in use: iwlwifi
  3. The IoTDK contains the embedded connection manager connman, which we will use here to establish the Wi-Fi connection. Enter the command connmanctl to manage the Wi-Fi settings.
  4. Enter enable wifi to verify that Wi-Fi has been enabled.
  5. Enter scan wifi. This returns Scan completed for wifi.
  6. Enter services. This command lists the networks found, followed by the MAC address and other key information of that network necessary to make a connection. MyNet1 is the network in this example.
    connmanctl> services
                        *AO Wired  ethernet_000000000000_cable    
                      MyNET1     wifi_dc85de828967_38303944616e69656c74_managed_psk
                        OtherNet2  wifi_dc85de828967_3257495245363836_managed_wep
                      [...]
  7. After running these commands, you’ll see your wireless network name (in place of MyNET1). Note that in case of a hidden network, the network will be listed without a name preceding it. If MyNET1 was hidden, the output could be:
             connmanctl> services
                        *AO Wired  ethernet_000000000000_cable    
                        wifi_dc85de828967_38303944616e69656c74_hidden_managed_psk
                      [...]
  8. To connect to a secure Wi-Fi network, turn on the agent that allows user interaction on the console by typing agent on. Then type in connect and the wifi string starting with wifi_ and ending in managed_psk. Your specific Wi-Fi string may vary.
                connmanctl> agent on
                        Agent registered
                  connmanctl> connect wifi_dc85de828967_38303944616e69656c74_managed_psk 
                        Agent RequestInput wifi_0cd2926de3ae_486f6d65574c414e_managed_psk
  9. Enter the passphrase for MyNet1, then wait for the connection to be established (the link becomes ready message).
              Passphrase = [ Type=psk, Requirement=mandatory ]
                        Connected wifi_dc85de828967_38303944616e69656c74_managed_psk 
                        Passphrase? <passphrase goes here>
     
                [  928.015714] wlp1s0: authenticate with aa:bb:cc:dd:ee:ff
                [  928.060155] wlp1s0: capabilities/regulatory prevented using AP HT/VHT configuration, downgraded
                [  928.079977] wlp1s0: send auth to aa:bb:cc:dd:ee:ff (try 1/3)
                [  928.087854] wlp1s0: authenticated
                [  928.100157] wlp1s0: associate with aa:bb:cc:dd:ee:ff (try 1/3)
                [  928.116202] wlp1s0: RX AssocResp from aa:bb:cc:dd:ee:ff (capab=0x431 status=0 aid=3)
                [  928.129111] wlp1s0: associated
                [  928.132339] IPv6: ADDRCONF(NETDEV_CHANGE): wlp1s0: link becomes ready
  10. Exit the connman console by typing in quit. Then verify that a successful connection has been made with the display of a valid IP address by typing in ip a .
              connmanctl> quit
                root@galileo:# ip a
                1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue
                    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
                    inet 127.0.0.1/8 scope host lo
                    inet6 ::1/128 scope host
                       valid_lft forever preferred_lft forever
                2: enp0s20f6: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
                    link/ether 00:13:20:ff:14:43 brd ff:ff:ff:ff:ff:ff
                    inet 169.254.5.1/16 brd 169.254.255.255 scope link enp0s20f6:avahi
                    inet6 fe80::213:20ff:feff:1443/64 scope link
                       valid_lft forever preferred_lft forever
                3: wlp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq qlen 1000
                    link/ether aa:bb:cc:dd:ee:ff brd ff:ff:ff:ff:ff:ff
                    inet 192.168.0.2/24 brd 192.168.0.255 scope global wlp1s0
                    inet6 fe80::ed2:92ff:fe6d:f1d2/64 scope link
                       valid_lft forever preferred_lft forever

Next Steps

Now that you have connected to and obtained an IP address for your board, you can install your preferred IDE and begin programming the board.

Step 5: Set Up Your IDE

Now that you have set up your Intel® Galileo board, you can install your preferred integrated development environment (IDE) and begin programming your board.

Which Programming Language Will You Use?

The IDE you use to program your board depends on the programming language you want to develop in. The choices are:

  • Arduino*: Arduino is an easy-to-learn, open source C++ based programming environment. It's convenient for quickly adding sensors since there is a lot of available sensor code out there. Since the Intel® Edison and Intel Galileo boards are Arduino-pin compatible, there are also plenty of shields to choose from. The Arduino IDE is the application of choice for programming with Arduino. For steps to install the Arduino IDE, see Installing the Arduino IDE.

  • JavaScript* and Node.js*: These languages are great for creating web interfaces and also work well in cloud connectivity and getting devices talking to one another. We provide the Intel® XDK to program in JavaScript and Node.js. It comes with easy-to-use project templates to jumpstart your IoT projects. For steps to install the Intel XDK, see Installing the Intel® XDK.

  • C++: Alternatively, using C++ tends to be very powerful, giving you full control of the system while simultaneously taking advantage of a lot of available libraries. Intel® System Studio IoT Edition comes with a built-in capability to easily integrate sensors from our GitHub* library. For steps to install the Intel System Studio IoT Edition, see Installing the Intel® System Studio IoT Edition.

  • Java: Java is an accessible language newly supported by the Intel System Studio IoT Edition. For steps to install the Intel System Studio IoT Edition, see Installing the Intel System Studio IoT Edition.

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804