Difference between revisions of "Galileo"

From Earlham CS Department
Jump to navigation Jump to search
(System Administration)
Line 207: Line 207:
  
 
=System Administration=
 
=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'''
 
''' creating a non-root user'''
  
For the non-sys admin types use: useradd -m -d /home/eccs eccs
+
For the non-sys admin types use:  
  
this creates the user eccs and a home directory for it.
+
0) create the user eccs and a home directory for it.: useradd -m -d /home/eccs eccs
  
then change the password using: passwd  
+
1)change the password using: passwd  
 
    
 
    
 
'''Updating Node.js'''
 
'''Updating Node.js'''
 
To update node.js on the Galileo  
 
To update node.js on the Galileo  
  
1) download [https://communities.intel.com/servlet/JiveServlet/download/221298-75632/nodejs_0.10.25-r0_i586.ipk.zip this package]
+
0) download [https://communities.intel.com/servlet/JiveServlet/download/221298-75632/nodejs_0.10.25-r0_i586.ipk.zip this package]
  
2) unzip the file and scp the file to the board
+
1) unzip the file and scp the file to the board
  
3) move the package to /tmp on the board
+
2) move the package to /tmp on the board
  
4) Run the command opkg install /tmp/nodejs_0.10.25-r0_i586.ipk
+
3) Run the command opkg install /tmp/nodejs_0.10.25-r0_i586.ipk
  
5) To confirm correct version run node -v
+
4) To confirm correct version run node -v
  
 
=IotKit Tutorial =
 
=IotKit Tutorial =

Revision as of 11:53, 4 June 2014

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 very much your friend, but this is what knowledge we as students have learned. It is our experience. Take it as it is. No promises. Seriously, this is the only disclaimer you get. Stay out of the fire.

Getting Started Guide

Galileo

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

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


Follow this tutorial,

In addition, this might be useful: Sparkfun guide.

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. Seriously, 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

[Installation Guide]

  • super useful guide for getting started with the Galileo


[Technical Overview of Galileo]

  • useful for getting familiar with the Galileo hardware


[Arduino Reference]

  • useful for getting familiar with the Arduino software


[Arduino Playground]

  • useful for getting familiar with the Arduino software


[Release Notes]

  • supported software/hardware and bugs


[Intel Maker forums]

  • forum for Galileo


[Arduino Getting Started]

  • Arduino-specific "Getting Started" guide

Downloads

[Software Packages]

[Drivers]


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

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].