IntelAcademic IoT Lab 02 Linux Side
IntelAcademic IoT Lab 02 Linux Side
IntelAcademic IoT Lab 02 Linux Side
Nicolas Vailliet
www.Intel-Software-Academic-Program.com
[email protected]
Intel Software
2014-02-01
Prerequisites and objectives
We assume that:
- You are able to download an archive, to unzipped it and run a program under
the OS you’re familiar to.
- You are able to read pieces of code and comments written in a C-like language.
In general,
Our goal is to point out that Galileo Arduino support is implemented under Linux. It
also explains how to use bash interpreter to perform the same actions than with an
Arduino sketch.
Before you start
What do you need?
Desktop OS
We assume you’re under Microsoft Windows.
Linux and Mac users should not have any problem to do the same.
Hardware
- An Intel Galileo Development Board.
- The box comes with power supply and cable.
- A Wi-Fi adaptor (N-2200 Mini-PCIe)
- A micro SD card (8GB with the full Linux image we provide)
Software
A SSH client like Putty for Windows. Mac and Linux users only need a terminal.
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
A Debian distribution
It’s possible to have a Debian distribution (i386) which is almost compatible with Pentium-4-like
Quark’s set of instructions (i586).
On your computer
- Connect to “intel” Wi-Fi network
- Run putty.exe
- Host name is : [email protected]
- Click on Open
- You’re connected to your board
NB: Please connect to “intel” or “intel2” networks. Balance traffic between both.
Extra: WinSCP tutorial
WinSCP
Specifying connection information
- Start WinSCP
- Click on New Site
- Select SCP as file protocol
- Host name is your IP address
- Port Number is 22
- User name is root
- No password
- Click on Save and then OK
Your are now connected to the board. You are able to browse its file system.
WinSCP
Transmitting files from/to the Galileo board Linux file system
# cd ~/tools/nano-2.2.6
# ./configure
# make install
(NB: Don’t run make, we have already done it!)
C and C++,
# gcc hello.c –o hello
# ./hello
(G++ and GDB are also available.)
Bash
# ./hello.sh
Node.JS 0.8.18
# node hello.js
Python 2.7.3
# python hello.py
Controlling digital output 7 (see next slide for GPIO numbers mapping)
~# echo -n "27" > /sys/class/gpio/export
~# echo -n "out" > /sys/class/gpio/gpio27/direction
~# echo -n "strong" > /sys/class/gpio/gpio27/drive
~# echo -n "1" > /sys/class/gpio/gpio27/value
~# cat /sys/class/gpio/gpio27/value
Accessing analog input voltage (to be previously set up, see next slide)
~# cat /sys/bus/iio/devices/iio\:device0/in_voltage0_raw
http://creativecommons.org/licenses/by/3.0/