Galileo Tutorial Connectivity Basics Senzations 14 Biograd na Moru 1. September 2013 1 IoT with Galileo Connectivity WHAT WILL YOU MAKE? Alex Gluhak Intel Labs Europe
Outline Learning goals Available connectivity HW on the Galileo Connecting to your Galileo via Ethernet cable Setting up Wifi Enabling SFTP and upload files via an SFTP client Setting up Bluetooth 2 IoT with Galileo Connectivity WHAT WILL YOU MAKE?
Ethernet - hardware SoC Block Diagram SoC has 2 * 10/100 Mbps Ethernet controllers Galileo exposes 1 Ethernet port No Ethernet shield needed Use existing Arduino sketches Ethernet port 2 SoC Ethernet Controllers 2 SoC PCIe lanes Galileo Top View 3 IoT with Galileo Connectivity WHAT WILL YOU MAKE?
WiFi - hardware SoC has 2 PCI Express* ports Galileo exposes 1 on the bottom of the board through a Mini PCIe slot Plug in card N-135 (Wifi+Bluetooth) or (N-6025) (Wifi only) Also screw in mpcie bracket adapter to hold mpcie card in place Plug in your Antenna(s) You need to use the Linux Image for SD for Wifi to work Mini PCIe Expansion Slot mpcie Bracket Adapter Antennas Galileo Bottom View 4 IoT with Galileo Connectivity WHAT WILL YOU MAKE?
Wifi module used in tutorial Intel N135 Single-stream Single-band, 2.4Ghz, up 150Mbit/s Wifi 802.11b/g/n Bluetooth 4.0 Supports Wi-Fi Direct 2 antennas for diversity 5 IoT with Galileo Connectivity WHAT WILL YOU MAKE?
Ethernet - Software Galileo Ethernet libraries are used by default for the Ethernet port You DONT need to use the Linux Image for SD for Ethernet to work (Flash or Mass storage works) Reference - http://arduino.cc/en/reference/ethernet 6 IoT with Galileo Connectivity WHAT WILL YOU MAKE?
Wifi - Software Galileo Wifi libraries are used by default for the Wifi card You DO need to use the Linux Image for SD for Wifi to work Reference - http://arduino.cc/en/reference/wifi 7 IoT with Galileo Connectivity WHAT WILL YOU MAKE?
Connecting to your Galileo via Ethernet Step 1: Plug Ethernet cable (Cross-connect auto detected) Step 2: Create small Arduino sketch to start the telnet daemon configure the eth0 interface.and upload it onto the Galileo Step 3: Wait until PC acquires link local address Step 4: Connect via ssh/telenet client 8 IoT with Galileo Connectivity WHAT WILL YOU MAKE?
Create Ethernet configuration script Step 1: In Ardiuno IDE create new sketch file File->New Step 2: Add two lines to the setup () system() can do any Linux shell invocations Step 3: Save file File->SaveAs Step 4: Upload sketch File->Upload 9 IoT with Galileo Connectivity WHAT WILL YOU MAKE?
Connect via ssh/telnet client Assign an address in the same subnetwork to your laptop On Linux/Mac: ssh root@169.254.1.1 On Windows: use PuTTY See right side for telnet For ssh use port 22 10 IoT with Galileo Connectivity WHAT WILL YOU MAKE?
Connecting the Wifi module Turn off power Screw on PCI-E mini extension card adapter Attach antenna to MAIN 1 connector Slot into PCI-E mini connector at the back of the Galileo Power on 11 IoT with Galileo Connectivity WHAT WILL YOU MAKE?
ESSID: Kongresna sala Password: senzations2014 12 IoT with Galileo Connectivity WHAT WILL YOU MAKE?
Verify network settings Type ifconfig into command line IP address e.g. 169.254.1.1 MAC address e.g. 98:4F:EE:00:10:47 Interface id e.g. eth0 13 IoT with Galileo Connectivity WHAT WILL YOU MAKE?
Setting up Wifi Step 1: Check for wifi interface adapters Type iwconfig into shell Interface id e.g. wlan0 14 IoT with Galileo Connectivity WHAT WILL YOU MAKE?
Setting up the Wifi access (1/3) STEP 1: Configure WPA access point and password using the wpa_passphrase script using ESSID and password root@clanton:~# wpa_passphrase ESSID password STEP 2: Bring up the interface 15 IoT with Galileo Connectivity WHAT WILL YOU MAKE?
Setting up the Wifi access (2/3) STEP 3: SSH into to Galileo via Wifi interface root@clanton:~# ifconfig // get wlan ip address STEP 4: Bring down the eth0 interface root@clanton:~# ifconfig eth0 down 16 IoT with Galileo Connectivity WHAT WILL YOU MAKE?
Setting up the Wifi access (3/3) STEP 5:Test connection root@clanton:~# ping 8.8.8.8 // test internet connectivity root@clanton:~# ping www.google.com // test DNS STEP 6 (Optional): Configure automated startup Add auto wlan0 into /etc/network/interfaces file 17 IoT with Galileo Connectivity WHAT WILL YOU MAKE?
Discovering other access points Use default wireless Linux tools, eg. iwlist wlan0 scanning 18 IoT with Galileo Connectivity WHAT WILL YOU MAKE?
SFTP configuration for file transfer Configure proper sftp daemon on default image should work for you STEP1 : Open config file vi /etc/ssh/sshd_config STEP2: Change line entry in the file change Subsystem sftp to Subsystem sftp internal-sftp STEP3: reboot type reboot 19 IoT with Galileo Connectivity WHAT WILL YOU MAKE?
Transfer files to/from Galileo STEP1: Connect using SFTP client Linux/Mac: sftp root@[ipaddress] Windows: e.g. WINSCP 20 IoT with Galileo Connectivity WHAT WILL YOU MAKE?
Exercise Copy some file over that we need from tutorial 21 IoT with Galileo Connectivity WHAT WILL YOU MAKE?
Bluetooth Linux tools Bluetooth only works for Linux, it is not currently compatible with Arduino libraries. hciconfig hci0 up This will get the device up and running. hciconfig Will show you the status of the device. hcitool scan Will scan for Bluetooth devices. Check this one for more: https://communities.intel.com/docs/doc-22862 http://www.hofrock.com/setting-up-bluetooth/ 22 IoT with Galileo Connectivity WHAT WILL YOU MAKE?
Bluetooth connection Discover Bluetooth devices hcitool scan Edit /etc/bluetooth/rfcomm.conf Add the BT device address to pair to Make the BT discoverable and ready for connection hciconfig hci0 piscan hciconfig hci0 name "galileo hciconfig hci0 sspmode 1 bluetoothd Configure connection to your phone Exercise Write a Sketches that periodically scans for nearby BT devices and return the results over serial 23 IoT with Galileo Connectivity WHAT WILL YOU MAKE?