Difference between revisions of "Galileo"

From Earlham CS Department
Jump to navigation Jump to search
(Specs)
m (Resources)
 
(90 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
The Galileo is a fusion of a Linux PC running Intel's architecture and an Arduino. The purpose is to provide the benefits of a pc (connectivity, power, storage, ports) with the benefits of an Arduino (an open-platform hardware interface.)
 
The Galileo is a fusion of a Linux PC running Intel's architecture and an Arduino. The purpose is to provide the benefits of a pc (connectivity, power, storage, ports) with the benefits of an Arduino (an open-platform hardware interface.)
  
This page specifically discusses the Galileo. Anything Arduino-specific should get relegated to [[Arduino|here]].
+
This page is intended to express what we've learned about the Galileo. There are other resources, and Google is your friend, but this is the knowledge we've learned from our experience here.
  
=Notes=
+
=Getting Started Guide=
NOTES!
+
==Galileo==
 +
To start with, you need three things to use the Galileo board and to run Arduino sketches:
 +
# Galileo Board
 +
# USB cable to connect board to computer
 +
# The Galileo development software (special version for Galileo that you can get [https://communities.intel.com/docs/DOC-22226 here])
 +
 
 +
Follow this tutorial,
 +
* [https://communities.intel.com/servlet/JiveServlet/previewBody/22204-102-1-25429/Galileo_GettingStarted_329685_005.pdf Getting started guide from Intel]
 +
* Start with step 3. Complete it.
 +
* Complete step 4 and 5.
 +
* Complete steps 7, 8, 9, and 10. They shouldn't take long.
 +
 
 +
In addition, this [https://learn.sparkfun.com/tutorials/galileo-getting-started-guide/all Sparkfun guide] might be useful.
 +
 
 +
==Arduino==
 +
 
 +
=Resources & Reference=
 +
 
 +
==Basic Electrical Reference:==
 +
The Galileo requires 5 volts of incoming power. Do not use more; I killed one this way. The Galileo will output 3.3volts or 5 volts on its digital output pins which is compatible with Arduino devices.
 +
 
 +
Please give these at least a glance so you don't end up frying your sensors!
 +
* Sparkfun:
 +
** [https://learn.sparkfun.com/tutorials/what-is-electricity What is Electricity?]
 +
** [https://learn.sparkfun.com/tutorials/voltage-current-resistance-and-ohms-law Voltage, Current, Resistance, and Ohm's Law]
 +
** [https://learn.sparkfun.com/tutorials/what-is-a-circuit What is a Circuit?]
  
 
==Photos==
 
==Photos==
[[File:Waves Produced by Earthquake.jpg|thumb|left|alt=This is a photo.|This is a description.]]
+
 
[[File:Tsunami.jpg|thumb|center|alt=This is a photo.|This is a description.]]
+
[[File:Micro-B-USB.jpeg|thumb|right|alt=Micro-B USB|This is a micro-B USB cable. All of the Galileo boards use them.]]
[[File:NOT MINUTES.jpg|thumb|left|alt=This is a photo.|This is a description.]]
+
[[File:Mini-B-USB.jpeg|thumb|right|alt=Mini-B USB|This is a mini-B USB cable. Some of the Arduino Uno boards use them.]]
[[File:Earthquake Detection.jpg|thumb|center|alt=This is a photo.|This is a description.]]
+
[[File:USB-B.jpeg|thumb|right|alt=USB-B USB|This is a USB-B cable. Some of the Arduino Uno boards use them.]]
[[File:Implementation Process.jpg|thumb|center|alt=This is a photo.|This is a description.]]
 
  
 
==Design Philosophy==
 
==Design Philosophy==
* Change one thing at a time.
+
* When doing research talk to scientists early on. Seriously, it helps.
* Check if it works after every change.
+
* Test after every change. This saves a lot of time.
* When success has been reached, repeat it: do it again.
+
* When success has been reached, do it again. Document it.
* When success has been repeated, replicate it: have others do it.
+
* When success has been repeated, have others do it. Spread your success.
  
==Failure List==
+
==Troubleshooting Checklist==
Having problems?
+
# The Galileo is still a beta product and can be finicky. Google is your friend.
# Are you using Galileo's arduino ide?
+
# Be aware that some libraries/shields made for Arduino are not compatible with the Galileo at this time.
# Are you using the right pin number? Is it analog or digital?
+
** Known Issues:
# Is your pin mode set correctly?
+
*** The SotwareSerial library does not work.
# Is the ground and power connected correctly?
+
*** The Stepper motor library (and the Motor Shield) don't work.
#* order is power, ground, and then input/output
+
*** More broadly, any routine that relies on fast toggling of the digital or analog pins will not work the same on Galileo because of hardware limitations.
# Do you have pin terminators on all power columns?
+
# Troubleshoot the best you can.
# If too many sensors are connected, you might run out of power. Try reducing the number of sensors.
+
# If nothing else works,
# Talk to scientists.
+
#* try a different piece of hardware.
# Research if your sensor needs a resistor. (330m or 10k)
+
#* try unplugging/replugging or restarting or the equivalent.
# If nothing else works, try a different breadboard or a different arduino or replacement sensors.
+
# If you're still having trouble, ask a TA.
# If still having trouble, ask Ben.
 
  
==Info Dump==
+
===Connection Issues===
IoTkit handles ethernet transactions. It connects to a host and sends a packet with [string, val] where val is the value you wish to send. You can save information locally and push it to a server later. A watch battery can be used to preserve machine state between power-on's. [validate]
+
# Are both of the LEDs on the Galileo not lighting up?
 +
#* Is the power plugged in?
 +
#* Maybe power is routed incorrectly on the breadboard. Try unplugging the power pins on the Galileo and seeing if it works.
 +
# If working in the Arduino IDE,
 +
#* are you using Galileo's Arduino IDE?
 +
#* are you using the correct port?
 +
#* are you using the correct board?
 +
#* do you have the mini usb cable plugged in next to the Ethernet port?
 +
#* unplug/replug the USB and wait 30-60 seconds
 +
#* unplug/replug the USB and power and wait 30-60 seconds (power always gets unplugged last)
 +
#* If on Windows, and without hope, try changing the COM port of the Galileo and restarting your computer.
 +
# If working in the Galileo terminal,
 +
#* do you have the RS232 -> 3.5mm cable plugged in next to the Ethernet port?
 +
#* are you using the correct port?
 +
#* are you using the correct username / password?
 +
 
 +
===Breadboard/Sensor Issues===
 +
# software,
 +
#* Is the pin mode set correctly?
 +
#* Are you using the correct pin numbers? Analog or digital?
 +
# hardware,
 +
#* are your wires loose?
 +
#* are you using the right resistor for that sensor?
 +
#* do you actually know which cables go where?
 +
# power,
 +
#* are the power and ground connected correctly?
 +
#* If your power columns are separated into multiple sections, are you bridging power as needed?
 +
#* If too many sensors are connected you might run out of power. Try unplugging power from some sensors.
 +
 
 +
===Resetting the Galileo===
 +
# Unplug the Galileo cables connected to your computer.
 +
# Unplug Galileo's power.
 +
# Replug power. Wait for the one light. (Which light?)
 +
# Replug cables. Ensure that the device port is the same.
  
There are no packages installed on Intel's Linux distro.
 
  
There's an interface for C++ that lets you access the Arduino.
+
=Resources=
  
Always connect the power first.
+
* [https://communities.intel.com/docs/DOC-22204 Installation Guide (super useful Galileo start guide)]
 +
* [http://arduino.cc/en/ArduinoCertified/IntelGalileo Technical Overview of Galileo (meet Galileo hardware]
 +
* [http://arduino.cc/en/Reference/HomePage Arduino Reference (meet Arduino software)]
 +
* [http://playground.arduino.cc/ Arduino Playground (meet Arduino software some more)]
 +
* [https://communities.intel.com/docs/DOC-21837 Release Notes (inc. supported software/hardware, bugs)]
 +
* [https://communities.intel.com/community/makers Intel Maker forums (inc. forum for Galileo)]
 +
* [http://arduino.cc/en/Guide/HomePage Arduino Getting Started]
  
When flashing the firmware, YOU MUST HAVE THE POWER CONNECTED. Otherwise you risk bricking the board.
+
=Downloads=
  
There are example sketches for every sensor included in Intel's sensor kit. Where? Good question.
+
* [https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=23171 Software Packages]
 +
* [https://communities.intel.com/docs/DOC-22226 Drivers]
  
Costs $60+ as of 2/5/14. Purchase is currently cheapest at [[http://www.microcenter.com/product/424730/Galileo_Development_Board Micro Center]] and [[http://www.amazon.com/gp/product/B00GGM6KJQ/ref=amb_link_391457722_3?pf_rd_m=ATVPDKIKX0DER&pf_rd_s=auto-sparkle&pf_rd_r=0YETJYR48ZGF8VHYN4E5&pf_rd_t=301&pf_rd_p=1665886302&pf_rd_i=intel%20galileo Amazon]].
+
=Research=
 +
Moved to [[Disaster-Preparedness|here]].
  
=Resources=
+
=Code=
 +
==Pins==
 +
You must specify which pin you're using to read/write to the Galileo. Declare variables for each of the pins you're using at the top of your code. It'll make life simpler.
  
[[https://communities.intel.com/docs/DOC-22204 Getting Started]]
+
For example use,
 +
*const int pin_temp = A0;
 +
*const int pin_tilt = 4;
 +
to give your pin a useful name and to make the pin number easier to change.
  
[[http://arduino.cc/en/ArduinoCertified/IntelGalileo Comprehensive Overview]]
+
==Analog vs Digital==
  
[[https://communities.intel.com/docs/DOC-21882 BSP Build Guide]]
+
# analog pins,
 +
#* analog pin numbers have an "A" in front of them, like A0, A1, A2, etc
 +
#* return a range of values between 0-1023 when read from
 +
#* use values 0-255 when written to
 +
#* required for sensors that provide a range of values
 +
#* can be used as digital pins if necessary
 +
# digital pins,
 +
#* digital pin numbers are referenced by number, like 0, 1, 2, etc
 +
#* return binary values, either 0 or 1
 +
#* can not be used as analog pins.
  
[[https://communities.intel.com/message/207619 FAQ]] (useful)
+
==Setting PinMode==
 +
The pinmode ensures that you only read/write from a pin. It helps prevent bugs.
  
[[https://communities.intel.com/docs/DOC-21837 Release Notes]] (supported software/hardware and bugs)
+
for input use,
 +
*pinMode(pin, INPUT);
  
[[https://communities.intel.com/community/makers Intel Maker forums]]
+
for output use,
 +
*pinMode(pin, OUTPUT);
  
=Downloads=
+
==Read vs Write==
 +
# for analog,
 +
#* analogRead(pin)
 +
#* analogWrite(pin, value)
 +
# for digital,
 +
#* digitalRead(pin)
 +
#* digitalWrite(pin, value)
  
[[https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=23171 Software Packages]]
+
==Printing to the Serial Interface==
 +
# set serial baud rate in setup using,
 +
#* Serial.begin(9600);
 +
# write to serial using,
 +
#* Serial.print(str);
 +
#* Serial.println(str);
  
[[https://communities.intel.com/docs/DOC-22226 Drivers]]
+
==Sleeping==
 +
# sleep like this,
 +
#* delay(length); where length is in ms
  
=Installation=
+
==IoTKit==
You're impossible to please. Read the documentation from [[https://communities.intel.com/servlet/JiveServlet/previewBody/22204-102-1-25429/Galileo_GettingStarted_329685_005.pdf Intel]] or [[https://learn.sparkfun.com/tutorials/galileo-getting-started-guide Sparkfun]] instead.
+
IoTKit allows you to publish data to intel's cloud Internet of Things service. It's an easy way to make your sensor's data remotely readable.
  
=Disasters=
+
https://github.com/enableiot/iotkit-samples
These are notes and observations after research.
 
  
==Earthquake==
+
=Hardware Specs=
* occur due to movement in tectonic plates
+
* 400mhz cpu
* only seconds of notice, 5-10 seconds
+
* 256mb ram
* [[http://en.wikipedia.org/wiki/P_wave p waves]] are much faster than [[http://en.wikipedia.org/wiki/S-wave s waves]] and the actual waves that cause the earthquake.
+
* max of 32gb micro sd
** earthquakes travel at about the same speed as data networks
+
* 10/100 ethernet
* can be measured by motion (on surface or underground) and pressure (underground)
+
* PCI Express mini-card with up to PCIe 2.0
** downside of underground monitoring is 1) power and 2) transmission
+
* USB host and client
*** can use repeaters or solar power to solve these issues
+
* 5v/3.3v power
** advantage of being underground is distance from noise (such as animals and humans) and being closer to the source of the earthquake
+
* same Arduino pin layout
** being attached to or submersed in denser materials is good (?)
 
  
===Resources===
+
==Arduino Sensors==
  
[[http://science.howstuffworks.com/nature/natural-disasters/earthquake2.htm introduction]]
+
[http://wiki.cs.earlham.edu/index.php/Arduino_Sensors click here for documentation]
  
[[http://en.wikipedia.org/wiki/Seismic_wave wave types]]
+
=System Administration=
 +
''' restarting IoTkit'''
  
==Tsunami==
+
0) ssh as root: ssh root@galileo-<galileo#>
* in the deep sea pressure sensors are used to measure the relatively small sea-level change (in centimeters)
 
* nearer to shore, where waves start to form, altitude could be measured by buoy
 
* travel at hundreds of miles per hour
 
* tsunami headquarters in Hawaii
 
* notification could be minutes to hours in advance depending on distance from source of tsunami
 
* height/speed of wave reduces with distance
 
  
=Code=
+
1) change directory to iotkit-agent-master: cd iotkit-agent-master
==XYZ + tilt using arrays, v0.24==
+
 
<code>
+
2) run the shell script start-agent.sh: ./start-agent.sh
// having trouble using an array of char arrays
 
  
// include directives
+
3) if that fails run node agent: node agent
// #include <string>
+
//#include <Ethernet.h>
+
''' creating a non-root user'''
//#include <IoTkit.h>
 
#include <sstream>
 
#include <string>
 
using namespace std;
 
  
// pin declarations
+
For the non-sys admin types use:
const int pin_temp = A0;
 
const int pin_magnet = 4;
 
  
// delay on loop
+
0) create the user eccs and a home directory for it.: useradd -m -d /home/eccs eccs
const int delay_time = 100;
 
  
// output separators
+
1)change the password using: passwd
char csv[] = ", ";
+
 
char columns[] = " | ";
+
'''Updating Node.js'''
 +
To update node.js on the Galileo
  
// sensors
+
0) download [https://communities.intel.com/servlet/JiveServlet/download/221298-75632/nodejs_0.10.25-r0_i586.ipk.zip this package]
float temp;
 
int magnet;
 
int magnet_digital;
 
int flame;
 
  
// xyz sensors
+
1) unzip the file and scp the file to the board
const int size = 3;
 
int pin[] = {0, 1, 2};
 
boolean val[size];
 
boolean last[size];
 
boolean change[size];
 
  
//IoTkit iotkit;
+
2) move the package to /tmp on the board
  
// intializing pin modes
+
3) Run the command opkg install /tmp/nodejs_0.10.25-r0_i586.ipk
void setup() {
 
  Serial.begin(115200);
 
 
 
  //iotkit.begin();
 
  //iotkit.registerMetric("x", "string", "X Change");
 
 
 
  pinMode(pin_temp, INPUT);
 
  //pinMode(pin_magnet, INPUT);
 
 
 
  for(int i = 0; i < size; i++) {
 
    pinMode(pin[i], INPUT);
 
  }
 
}
 
  
void loop() {
+
4) To confirm correct version run node -v
  setArray(change, size, false);
 
 
 
  readTemp();
 
  readAxes();
 
  //readMagnet();
 
  output(change, size, csv);
 
 
 
  delay(delay_time);
 
}
 
  
void readFlame() {
+
=Building Custom Images=
  //flame = analogRead(pin_flame);
+
==Setting up the BSP Build Environment==
  //float f = flame * (5.0 / 1023.0);
+
* You will need:
  //output("F ", f);
+
** Linux (Tested on Debian 7.5 and Debian 7.0, other distros may also work)
}
+
** Up to 30 gb disk space
 +
** The latest version of the [https://downloadcenter.intel.com/Detail_Desc.aspx?DwnldID=23197 Board Support Package sources] from Intel
 +
** A copy of the Intel Quark BSP Build Guide, avaliable at the same location, for additional reference
 +
* Host machine setup:
 +
** Necessary Packages:
 +
*** build-essential
 +
*** gcc-multilib
 +
*** vim-common
 +
*** git
 +
*** diffstat
 +
*** texinfo
 +
*** gawk
 +
*** chrpath
 +
*** file
 +
** Apart from installing those packages, no part of this process requires root access.
 +
* Setting up the working directory (from section 6 of the BSP build guide)
 +
** Extract the Board Support Package into a convenient working directory
 +
** Run the following commands:
 +
  <code>tar -xvf meta-clanton*.tar.gz
 +
  cd meta-clanton*
 +
  ./setup.sh</code>
 +
* Patch one source file to account for a changed checksum
 +
  <code>sed -i 's/1cffe9f406cc54f4759fc9eeb85598fb8cae66c7/bfed708c5358a2b4ef65923fb0683cefa9184e6f/' meta-oe/meta-oe/recipes-multimedia/x264/x264_git.bb </code>
 +
* Set up the build environment variables
 +
  <code>source poky/oe-init-build-env yocto_build</code>
 +
* Build an image (This step will take several hours and require significant disk space and ram).
 +
  <code>bitbake image-full-galileo</code>
 +
* The completed images will be found in ./tmp/deploy/images
 +
** These files must be on the SD card for the Galileo to book correctly:
 +
*** grub.efi
 +
*** image-full-galileo-clanton.ext3
 +
*** core-image-minimal-initramfs-clanton.cpio.gz
 +
*** bzImage
 +
*** boot/
 +
Note that some of these files are symlinks; be careful to copy the file content.
 +
==Customize the Linux kernel of the image==
 +
* be in the root build directory (meta-clanton*/)
 +
cd poky
 +
source oe-init-build-env
 +
  <code>bitbake linux-yocto -c menuconfig </code>
 +
* enable the desired kernel components
 +
* rebuild the kernel
 +
from the meta-clanton* directory:
 +
<code>source poky/oe-init-build-env yocto_build
 +
bitbake image-full-galileo</code>
 +
== Customize the software added to the image==
 +
* Make sure that the package you wish to add has a recipe
 +
[http://layers.openembedded.org/layerindex/branch/master/layers/ List of layers and recipies] each piece of software to be built for the Galileo has a recipie within a layer. Most layers containing applications are found within the meta-oe/ directory.
 +
* Make sure the layer containing the recipie has been enabled in yocto_build/conf/bblayers.conf
 +
if it hasn't add the path to the list of BBLAYERS
 +
* run <code>bitbake <packageName></code>
 +
be sure you are in the yocto_build directory and have sourced the oe-init-build-env script in that shell
 +
* add the package to the image build script
 +
edit the yocto_build/conf/local.conf file to include the line:
 +
  <code>IMAGE_INSTALL_append = " <packageName>" </code>
 +
note that that leading space is vital (don't blame me, I didn't write this scripting system!)
 +
* run <code>bitbake image-full-galileo</code> to construct the new image.
 +
==Integrate support for FTDI USB-serial controllers==
 +
This is essential to the HERMES project. It also demonstrates how to customize the Galileo with .bbappend files.
 +
* download the compendium of Galileo recipies from AlexT's github page
 +
<code>git clone https://github.com/alext-mkrs/meta-alext-galileo</code>
 +
* remove .disabled from the .bbappend file you wish to use
 +
for us that's <code>recipes-addfeatures/enable_ftdi_sio/linux-yocto-clanton_3.8.bbappend</code>
 +
* add the path to the layer directory to the yocto_build/conf/bblayers.conf file
 +
* run <code>bitbake image-full-galileo</code> again.
  
void readTemp() {
+
=IotKit Tutorial =
  temp = analogRead(pin_temp);
+
[http://cluster.earlham.edu/~blyee11/IoT_test.ino sample code]
  temp = (temp * 500) / 1024.0;
 
  temp = ((temp*9)/5) + 32;
 
  temp = temp / 10.0;
 
  //output("T ", temp);
 
}
 
  
void readMagnet() {
+
=Info Dump=
  magnet = analogRead(pin_magnet);
+
IoTkit handles ethernet transactions. It connects to a host and sends a packet with [string, val] where val is the value you wish to send. You can save information locally and push it to a server later. A watch battery can be used to preserve machine state between power-on's. [validate]
  //magnet -= 460;
 
  //output("M ", magnet);
 
}
 
  
void readAxes() {
+
There are no packages installed on Intel's Linux distro.
  for(int i = 0; i < size; i++) {
 
    val[i] = digitalRead(pin[i]);
 
   
 
    //change[i] = val[i];
 
    if(val[i] != last[i]) {
 
      change[i] = true;
 
      last[i] = val[i];
 
    }
 
  }
 
}
 
  
void setArray(boolean arr[], int size, boolean val) {
+
There's an interface for C++ that lets you access the Arduino.
  for(int i = 0; i < size; i++) {
 
    arr[i] = val;
 
  }
 
}
 
  
string blank = "      ";
+
Always connect the power first.
void output(boolean arr[], int size, char sep[]) {
 
  stringstream os; // output stream;
 
 
 
  for(int i = 0; i < size; i++) {
 
    if(arr[i])
 
      os << "change";
 
    else
 
      os << "      ";
 
   
 
    //if(i != size - 1)
 
      os << sep;
 
  }
 
 
 
  os << temp;
 
 
 
  Serial.println(os.str().c_str());
 
 
 
  stringstream oc; // output command
 
  oc << "printf \"" << os.str().c_str() << "\\n\" >> output.dat";
 
  //oc << "printf " << os.str().c_str() << " >> output.dat \n";
 
  system(oc.str().c_str());
 
 
 
  //Serial.println(oc.str().c_str());
 
}
 
  
void outputIOTkit() {
+
When flashing the firmware, YOU MUST HAVE THE POWER CONNECTED. Otherwise you risk bricking the board.
  //iotkit.send("x", change[0]);
 
}
 
</code>
 
  
==Accelerometer, v0.1==
+
There are example sketches for every sensor included in Intel's sensor kit. Where? Good question.
Available in the google drive.
 
  
=Specs=
+
Costs $60+ as of 2/5/14. Purchase is currently cheapest at [[http://www.microcenter.com/product/424730/Galileo_Development_Board Micro Center]] and [[http://www.amazon.com/gp/product/B00GGM6KJQ/ref=amb_link_391457722_3?pf_rd_m=ATVPDKIKX0DER&pf_rd_s=auto-sparkle&pf_rd_r=0YETJYR48ZGF8VHYN4E5&pf_rd_t=301&pf_rd_p=1665886302&pf_rd_i=intel%20galileo Amazon]].
* 400mhz cpu
 
* 256mb ram
 
* max of 32gb micro sd
 
* 10/100 ethernet
 
* PCI Express mini-card with up to PCIe 2.0
 
* USB host and client
 
* 5v/3.3v power
 
* same Arduino pin layout
 

Latest revision as of 16:33, 15 May 2015

The Galileo is a fusion of a Linux PC running Intel's architecture and an Arduino. The purpose is to provide the benefits of a pc (connectivity, power, storage, ports) with the benefits of an Arduino (an open-platform hardware interface.)

This page is intended to express what we've learned about the Galileo. There are other resources, and Google is your friend, but this is the knowledge we've learned from our experience here.

Getting Started Guide

Galileo

To start with, you need three things to use the Galileo board and to run Arduino sketches:

  1. Galileo Board
  2. USB cable to connect board to computer
  3. The Galileo development software (special version for Galileo that you can get here)

Follow this tutorial,

In addition, this Sparkfun guide might be useful.

Arduino

Resources & Reference

Basic Electrical Reference:

The Galileo requires 5 volts of incoming power. Do not use more; I killed one this way. The Galileo will output 3.3volts or 5 volts on its digital output pins which is compatible with Arduino devices.

Please give these at least a glance so you don't end up frying your sensors!

Photos

Micro-B USB
This is a micro-B USB cable. All of the Galileo boards use them.
Mini-B USB
This is a mini-B USB cable. Some of the Arduino Uno boards use them.
USB-B USB
This is a USB-B cable. Some of the Arduino Uno boards use them.

Design Philosophy

  • When doing research talk to scientists early on. Seriously, it helps.
  • Test after every change. This saves a lot of time.
  • When success has been reached, do it again. Document it.
  • When success has been repeated, have others do it. Spread your success.

Troubleshooting Checklist

  1. The Galileo is still a beta product and can be finicky. Google is your friend.
  2. Be aware that some libraries/shields made for Arduino are not compatible with the Galileo at this time.
    • Known Issues:
      • The SotwareSerial library does not work.
      • The Stepper motor library (and the Motor Shield) don't work.
      • More broadly, any routine that relies on fast toggling of the digital or analog pins will not work the same on Galileo because of hardware limitations.
  1. Troubleshoot the best you can.
  2. If nothing else works,
    • try a different piece of hardware.
    • try unplugging/replugging or restarting or the equivalent.
  3. If you're still having trouble, ask a TA.

Connection Issues

  1. Are both of the LEDs on the Galileo not lighting up?
    • Is the power plugged in?
    • Maybe power is routed incorrectly on the breadboard. Try unplugging the power pins on the Galileo and seeing if it works.
  2. If working in the Arduino IDE,
    • are you using Galileo's Arduino IDE?
    • are you using the correct port?
    • are you using the correct board?
    • do you have the mini usb cable plugged in next to the Ethernet port?
    • unplug/replug the USB and wait 30-60 seconds
    • unplug/replug the USB and power and wait 30-60 seconds (power always gets unplugged last)
    • If on Windows, and without hope, try changing the COM port of the Galileo and restarting your computer.
  3. If working in the Galileo terminal,
    • do you have the RS232 -> 3.5mm cable plugged in next to the Ethernet port?
    • are you using the correct port?
    • are you using the correct username / password?

Breadboard/Sensor Issues

  1. software,
    • Is the pin mode set correctly?
    • Are you using the correct pin numbers? Analog or digital?
  2. hardware,
    • are your wires loose?
    • are you using the right resistor for that sensor?
    • do you actually know which cables go where?
  3. power,
    • are the power and ground connected correctly?
    • If your power columns are separated into multiple sections, are you bridging power as needed?
    • If too many sensors are connected you might run out of power. Try unplugging power from some sensors.

Resetting the Galileo

  1. Unplug the Galileo cables connected to your computer.
  2. Unplug Galileo's power.
  3. Replug power. Wait for the one light. (Which light?)
  4. Replug cables. Ensure that the device port is the same.


Resources

Downloads

Research

Moved to here.

Code

Pins

You must specify which pin you're using to read/write to the Galileo. Declare variables for each of the pins you're using at the top of your code. It'll make life simpler.

For example use,

  • const int pin_temp = A0;
  • const int pin_tilt = 4;

to give your pin a useful name and to make the pin number easier to change.

Analog vs Digital

  1. analog pins,
    • analog pin numbers have an "A" in front of them, like A0, A1, A2, etc
    • return a range of values between 0-1023 when read from
    • use values 0-255 when written to
    • required for sensors that provide a range of values
    • can be used as digital pins if necessary
  2. digital pins,
    • digital pin numbers are referenced by number, like 0, 1, 2, etc
    • return binary values, either 0 or 1
    • can not be used as analog pins.

Setting PinMode

The pinmode ensures that you only read/write from a pin. It helps prevent bugs.

for input use,

  • pinMode(pin, INPUT);

for output use,

  • pinMode(pin, OUTPUT);

Read vs Write

  1. for analog,
    • analogRead(pin)
    • analogWrite(pin, value)
  2. for digital,
    • digitalRead(pin)
    • digitalWrite(pin, value)

Printing to the Serial Interface

  1. set serial baud rate in setup using,
    • Serial.begin(9600);
  2. write to serial using,
    • Serial.print(str);
    • Serial.println(str);

Sleeping

  1. sleep like this,
    • delay(length); where length is in ms

IoTKit

IoTKit allows you to publish data to intel's cloud Internet of Things service. It's an easy way to make your sensor's data remotely readable.

https://github.com/enableiot/iotkit-samples

Hardware Specs

  • 400mhz cpu
  • 256mb ram
  • max of 32gb micro sd
  • 10/100 ethernet
  • PCI Express mini-card with up to PCIe 2.0
  • USB host and client
  • 5v/3.3v power
  • same Arduino pin layout

Arduino Sensors

click here for documentation

System Administration

restarting IoTkit

0) ssh as root: ssh root@galileo-<galileo#>

1) change directory to iotkit-agent-master: cd iotkit-agent-master

2) run the shell script start-agent.sh: ./start-agent.sh

3) if that fails run node agent: node agent

creating a non-root user

For the non-sys admin types use:

0) create the user eccs and a home directory for it.: useradd -m -d /home/eccs eccs

1)change the password using: passwd

Updating Node.js To update node.js on the Galileo

0) download this package

1) unzip the file and scp the file to the board

2) move the package to /tmp on the board

3) Run the command opkg install /tmp/nodejs_0.10.25-r0_i586.ipk

4) To confirm correct version run node -v

Building Custom Images

Setting up the BSP Build Environment

  • You will need:
    • Linux (Tested on Debian 7.5 and Debian 7.0, other distros may also work)
    • Up to 30 gb disk space
    • The latest version of the Board Support Package sources from Intel
    • A copy of the Intel Quark BSP Build Guide, avaliable at the same location, for additional reference
  • Host machine setup:
    • Necessary Packages:
      • build-essential
      • gcc-multilib
      • vim-common
      • git
      • diffstat
      • texinfo
      • gawk
      • chrpath
      • file
    • Apart from installing those packages, no part of this process requires root access.
  • Setting up the working directory (from section 6 of the BSP build guide)
    • Extract the Board Support Package into a convenient working directory
    • Run the following commands:
  tar -xvf meta-clanton*.tar.gz
  cd meta-clanton*
  ./setup.sh
  • Patch one source file to account for a changed checksum
  sed -i 's/1cffe9f406cc54f4759fc9eeb85598fb8cae66c7/bfed708c5358a2b4ef65923fb0683cefa9184e6f/' meta-oe/meta-oe/recipes-multimedia/x264/x264_git.bb 
  • Set up the build environment variables
  source poky/oe-init-build-env yocto_build
  • Build an image (This step will take several hours and require significant disk space and ram).
  bitbake image-full-galileo
  • The completed images will be found in ./tmp/deploy/images
    • These files must be on the SD card for the Galileo to book correctly:
      • grub.efi
      • image-full-galileo-clanton.ext3
      • core-image-minimal-initramfs-clanton.cpio.gz
      • bzImage
      • boot/

Note that some of these files are symlinks; be careful to copy the file content.

Customize the Linux kernel of the image

  • be in the root build directory (meta-clanton*/)

cd poky source oe-init-build-env

  bitbake linux-yocto -c menuconfig 
  • enable the desired kernel components
  • rebuild the kernel

from the meta-clanton* directory:

source poky/oe-init-build-env yocto_build
bitbake image-full-galileo

Customize the software added to the image

  • Make sure that the package you wish to add has a recipe

List of layers and recipies each piece of software to be built for the Galileo has a recipie within a layer. Most layers containing applications are found within the meta-oe/ directory.

  • Make sure the layer containing the recipie has been enabled in yocto_build/conf/bblayers.conf

if it hasn't add the path to the list of BBLAYERS

  • run bitbake <packageName>

be sure you are in the yocto_build directory and have sourced the oe-init-build-env script in that shell

  • add the package to the image build script

edit the yocto_build/conf/local.conf file to include the line:

 IMAGE_INSTALL_append = " <packageName>" 

note that that leading space is vital (don't blame me, I didn't write this scripting system!)

  • run bitbake image-full-galileo to construct the new image.

Integrate support for FTDI USB-serial controllers

This is essential to the HERMES project. It also demonstrates how to customize the Galileo with .bbappend files.

  • download the compendium of Galileo recipies from AlexT's github page
git clone https://github.com/alext-mkrs/meta-alext-galileo
  • remove .disabled from the .bbappend file you wish to use

for us that's recipes-addfeatures/enable_ftdi_sio/linux-yocto-clanton_3.8.bbappend

  • add the path to the layer directory to the yocto_build/conf/bblayers.conf file
  • run bitbake image-full-galileo again.

IotKit Tutorial

sample code

Info Dump

IoTkit handles ethernet transactions. It connects to a host and sends a packet with [string, val] where val is the value you wish to send. You can save information locally and push it to a server later. A watch battery can be used to preserve machine state between power-on's. [validate]

There are no packages installed on Intel's Linux distro.

There's an interface for C++ that lets you access the Arduino.

Always connect the power first.

When flashing the firmware, YOU MUST HAVE THE POWER CONNECTED. Otherwise you risk bricking the board.

There are example sketches for every sensor included in Intel's sensor kit. Where? Good question.

Costs $60+ as of 2/5/14. Purchase is currently cheapest at [Micro Center] and [Amazon].