Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University Lab6-1 - Sensor Network 2016/6/7/ 2 1.

Slides:



Advertisements
Similar presentations
VMWare Workstation Installation. Starting Vmware Workstation Go to the start menu and start the VMware Workstation program. *Note: The following instructions.
Advertisements

Lab 9 Department of Computer Science and Information Engineering National Taiwan University Lab9 - Sensor Network 2014/11/25/ 21 1.
Lab 4 Department of Computer Science and Information Engineering National Taiwan University Lab4 - Bootloader 2014/10/14/ 13 1.
Computer System Laboratory
Dynamic Web site With PHP and MySQL. MySQL The combination of MySQL database and PHP scripting language is optimum for building dynamic websites. MySQL.
Getting to Know the Digital Hub Can you sketch/draw the digital hub system – subsystems? Can you Identify Point of failures?
How to Install Windows 7.
VMWare Workstation Installation. Starting Vmware Workstation Go to the start menu and start the VMware Workstation program. *Note: The following instructions.
PacNOG 6: Nadi, Fiji Installing Ubuntu Server 9.04 Hervey Allen Network Startup Resource Center.
COMPUTER SYSTEM LABORATORY Lab8 - Debugging II. Lab 8 Experimental Goal Learn how to debug Linux in source-level by Domingo and diagnose target boards.
A crash course in njit’s Afs
Virtualization and Open source Software Mr. Lau Ka Lun – Lai King Catholic Secondary School Date: 9 th, 21 st, 22 nd March, 2011.
VMWare Workstation Installation. Starting Vmware Workstation Go to the start menu and start the VMware Workstation program. *Note: The following instructions.
One to One instructions Installing and configuring samba on Ubuntu Linux to enable Linux to share files and documents with Windows XP.
V Avon High School Tech Crew Agenda Old Business –Delete Files New Business –Week 10 Topics: Coming up: –Yearbook Picture: Feb 7 12:20PM.
Lab 3 Department of Computer Science and Information Engineering National Taiwan University Lab3 - Cross Tools 2014/10/7/ 20 1.
Computer System Laboratory
Tutorial 11 Installing, Updating, and Configuring Software
COMPUTER SYSTEM LABORATORY Lab10 - Sensor II. Lab 10 Experimental Goal Learn how to write programs on the PTK development board (STM32F207). 2013/11/19/
NUMOSS NURUL ‘IZZATI BINTI OTHMAN A
bWAPP – Bee Bug – Installation
Lab How to Use WANem Last Update Copyright 2011 Kenneth M. Chipps Ph.D. 1.
Objectives Define IP Address To be able to assign an IP address with its Subnet Mask and Default Gateway to a PC that operates using Windows 7 or Fedora.
Lab 11 Department of Computer Science and Information Engineering National Taiwan University Lab11 - Porting 2014/12/9/ 26 1.
Setting Up a Local WordPress Development Environment By Gregory Young Alternative Hosting
LING 408/508: Programming for Linguists Lecture 3 August 31 st.
MS Windows XP Embedded 李志清. Live in a Embedded Computing World.
1 Chapter Overview Using the New Connection Wizard to configure network and Internet connections Using the New Connection Wizard to configure outbound.
Lab 1 Department of Computer Science and Information Engineering National Taiwan University Lab1 - Sensor 2014/9/23/ 13 1.
Linux in a Virtual Environment Nagarajan Prabakar School of Computing and Information Sciences Florida International University.
1 FreeBSD Installation ISOC/AfNOG Michuki Mwangi (Original materials by Hervey Allen – NSRC)
Conventions Department of Computer Science and Information Engineering National Taiwan University Conventions 2014/9/16/ 3 1.
Internet Technology Laboratory Department of Computer and Communication Kun Shan University  官方網站:
Poor Man’s VIRL How to run VIRL as Bare Metal on resource-constrained PC (works on as well) Dec 30, 2015 Kaoru Yamashita.
VMWare Workstation Installation. Starting Vmware Workstation Go to the start menu and start the VMware Workstation program. *Note: The following instructions.
Lab 1 Department of Computer Science and Information Engineering National Taiwan University Lab1 - Environment Setup 2015/9/15/ 30 1.
Lab 8 Department of Computer Science and Information Engineering National Taiwan University Lab8 - Root Filesystem 2015/11/10/ 22 1.
HOW TO INSTALL WINDOWS 7? This step-by-step guide demonstrates how to install Windows 7 Ultimate. The guide is similar for other versions of Windows 7.
Lab 7 Department of Computer Science and Information Engineering National Taiwan University Lab7 – uCOS Application 2015/11/10/ 10 1.
Lab 5 Department of Computer Science and Information Engineering National Taiwan University Lab5 - OS Kernel 2014/10/21/ 16 1.
Raspberry Pi Project Control Your Home Lights with a Raspberry Pi.
9 Copyright © 2004, Oracle. All rights reserved. Getting Started with Oracle Migration Workbench.
WordPress and Etherpad with BlueMix and Docker. Our aim is to run on BlueMix containers (now in beta) these two famous services In the BlueMix dashboard,
| © 2007 LenovoLenovo Confidential Use WinDBG Tool to Analyze BSOD —— Lenovo Service Support Training.
LINUX Network Concepts M.S.Dibay Moghaddam Second Linux Festival Amir Kabir University of Technology Computer & IT Department.
Sandbox Setup 2-Node Cluster. ©2015 Couchbase Inc. 2 What are the Pre-requisites for the Setup  Have at least an Intel i3 or AMD equivalent processor.
Installing iHRIS on VMWare
beas group AG Beas sql guide Martin Heigl CTO
bitcurator-access-webtools Quick Start Guide
Computer System Laboratory
Computer System Laboratory
Implementation of Embedded OS
Network Configuration
01_NF_Ch11 - Configuring and Testing Your Network
Seamless Guest OS's and more!
Chapter 2: Configure a Network Operating System
Computer System Laboratory
Implementation of Embedded OS
Computer System Laboratory
Creating a Windows Server 2012 R2 Datacenter Virtual machine
Creating a Windows Server 2016 Datacenter Virtual machine
Create A Virtual Machine
INSTALLING AND SETTING UP APACHE2 IN A LINUX ENVIRONMENT
Chapter 2: Configure a Network Operating System
NETWORK SECURITY LAB Lab 8. Firewall and VPN.
Remote Computing Services Cloud connection Distributed system
bitcurator-access-webtools Quick Start Guide
Computer System Laboratory
Windows Operating System
How to install and manage exchange server 2010 OP Saklani.
Presentation transcript:

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University Lab6-1 - Sensor Network 2016/6/7/ 2 1

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University  Learn how to establish a simple sensor network (SIOTAS) on STM32F /6/7/ 2 2

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University  Host System  Windows XP  Build System  IAR Embedded Workbench + Ubuntu 8.04  Target System  PTK development board (STM32F207)  Software  SQL Agent  Prepared Database  mCloud Portal  MySQL Connector ODBC  mCloud AppClient  PTK Examples Version 2  You can find all software on HERE.HERE 2016/6/7/ 2 3

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University  We would like to build a sensor network for the elders.  A gateway device is used to collect data from node devices by using Zigbee.  All the sensing data will be sent to a server and recorded in database.  We can use a browser to monitor the history of data and graphs. 2016/6/7/ 2 4 Server Side Client Side Sensor Devices gateway device node device

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University  We use STM32F207 as the base of each device.  Gateway Device  Collect all the data from other sensors, and send them to the server.  Lighting Device  Detect the current value of temperature and luminance flux, and turn on the light when it is dark.  Bathroom Device  Detect the movement of users and record user in/out events.  Entrance Device  Detect the door whether it is open, and record events of user entrance.  User can go indoor/outdoor by using RFID.  Activity Device  Detect the heart beat rate and calories consumption. 2016/6/7/ 2 5

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University  We would establish LAMP environment.  LAMP means Linux, Apache, MySQL, and PHP.  Create a website for monitoring and analyzing.  Design a database for data captured by sensors. 2016/6/7/ 2 6

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University  data_block  This is used to record continuous data.  Data will store into a file and record the filename in database.  data_feed  This is used to record intermittent data.  The data will be stored into value defined by the schema.  For detailed description, please refer to the document. 2016/6/7/ 2 7

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University  Please download “VirtualBox” from or course website.  Install VirtualBox.  Using default settings is fine.  Note that the network will be disconnected temporarily during the installation.  The related networking drivers should be installed. 2016/6/7/ 2 8

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University  Step 1: click “ 新增 (N)” in “Oracle VM VirtualBox 管理員 ”.  Step 2: create a Linux Ubuntu (32 bit) virtual machine (VM).  The size of memory needs at least 512 MB.  The size of disk needs at least 20 GB.  Step 3: add an additional network adapter to the VM.  “ 設定值 (S)”  “ 網路 ”  “ 介面卡 2”  “ 啟用網路卡 (E)”  “ 附加到 (A)” = “ 「僅限主機」介面卡 ” 2016/6/7/ 2 9

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University  Step 4: download Ubuntu 8.04 from course website.  Step 5: start your virtual machine and choose the Ubuntu image file for booting from CD/DVD.  “ 裝置 ”  “CD/DVD 裝置 ”  “ 選擇虛擬 CD/DVD 磁碟檔案 ”  Step 6: install Ubuntu  English version is more stable.  Change time zone to “Asia”  “Taipei”.  When finishing installation, press “ENTER” to reboot.  Please remember the account to login Linux.  Tips:  To uncaptured the keyboard and the mouse from virtual machine to Windows XP, please press the host key, right ctrl key by default. 2016/6/7/ 2 10

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University  Step 1: open a terminal in Ubuntu  “Applications”  “Accessories”  “Terminal”  You can execute commands with root privilege by typing “ sudo ”.  E.g., % sudo mkdir /etc/test  Step 2: install guest additions in Ubuntu  “ 裝置 ”  “ 插入 Guest Additions CD 映像 …”  Execute the script in Ubuntu  % sudo /media/cdrom/VBoxLinuxAdditions.run  Step 3: restart Ubuntu  % sudo reboot  Tips:  After complete installation of guest additions, you can also share clipboard between Windows XP and Ubuntu.  In VirtualBox:  “ 機器 ”  “ 設定值 ”  “ 一般 ”  “ 進階 ”  Change the setting of “ 共用剪貼簿 ” from “ 停用 ” to “ 雙向 ”. 2016/6/7/ 2 11

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University  Step 1: bridge the two network LAN, “VirtualBox Host-Only Network” and “ 區域網路 ” which connects PXA270, together.  Step 2: set IP address of the bridge on Windows XP to configure LAN environment.  IP address =  Netmask =  Step 3: set IP address on Ubuntu.  % sudo nano /etc/network/interfaces auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp auto eth1 iface eth1 inet static address netmask  % sudo /etc/init.d/networking restart 2016/6/7/ 2 12

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University  Unfortunately, Ubuntu 8.04 is now out of support and no longer receiving updates and security patches. There are repositories available at  Step 1: update apt repositories.  % sudo sed -i -e 's/tw.archive.ubuntu.com\|security.ubuntu.com/old- releases.ubuntu.com/g' /etc/apt/sources.list  Be careful of the area which was set during the installation. If you chose the area other than Taiwan, you have to modify the command to the correct one.  You can type “ man sed ” to see more information.  Step 2: upgrade the sources list.  % sudo apt-get update 2016/6/7/ 2 13

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University  Step 1: install several packages.  % sudo apt-get install unzip  % sudo apt-get install apache2  % sudo apt-get install mysql-server  You must use the predefined password “ microtime ” for root in the installation process.  % sudo apt-get install php5  % sudo apt-get install phpmyadmin  Make sure you choose apache2 by SPACE key in the installation process.  % sudo apt-get install libmysqlclient15-dev  Step 2: modify the configuration of MySQL.  % sudo nano /etc/mysql/my.cnf  bind-address =  [mysqld]  plugin_dir = /usr/lib/mysql/plugin  Restart MySQL service: sudo /etc/init.d/mysql restart 2016/6/7/ 2 14

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University  Step 3: download sql-agent.tar.gz.sql-agent.tar.gz  Step 4: install MySQL plugin lib_mysqludf_sys.so.  % sudo mkdir /usr/lib/mysql/plugin  % sudo mkdir /home/test0001  % sudo tar zxvf sql-agent.tar.gz -C /home/test0001  % sudo cp /usr/lib/libmysqlclient.so.15 /home/test0001/libmysqlclient.so.18  % cd /home/test0001/lib_mysqludf_sys  % sudo./install.sh  Step 5: add some tasks to rc.local.  % sudo nano /etc/rc.local cd /home/test0001./runme.sh  Step 6: reboot and check.  % sudo reboot  % ps -A 2016/6/7/ 2 15

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University  Step 1: connect MySQL by a browser.   Step 2: import the prepared database.  “ 載入 ”  “ 選擇檔案 ”  mCloud-SIOTAS.sql  “ 執行 ” mCloud-SIOTAS.sql  Step 3: create a new user.  “ 權限 ”  “ 新增使用者 ”  使用者名稱 = imami  主機 = 任何主機  密碼 = imami  database for user = None  整體權限 = 全選 2016/6/7/ 2 16

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University  Install the website.  Step 1: download mCloud-Portal.zip.mCloud-Portal.zip  % sudo unzip mCloud-Portal.zip -d /var/www  % sudo chown -R www-data.www-data /var/www/mcloud  Step 2: check the website.   Password is microtime 2016/6/7/ 2 17

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University  Install MySQL Connector.  Step 1: download mysql-connector-odbc win32.msi.mysql-connector-odbc win32.msi  “ 控制台 ”  “ 系統管理工具 ”  “ 資料來源 (ODBC)”  “ 系統資料來源名稱 ”  “ 新增 ”  “MySQL ODBC 5.1 Driver”  “ 完成 ”  Data Source Name = MySQL-mCloud  Description = MySQL ODBC 5.1 driver  TCP/IP Server =  Port = 3306  User = imami  Password = imami  Database = imami  Step 2: Test the connection.  Click “Test”. 2016/6/7/ 2 18

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University  Install mCloud-AppClient.  Step 1: download and install mCloud-SIOTAS-setup exe.mCloud-SIOTAS-setup exe  Step 2: download and decompress mCloud-SIOTAS-GW66-AppClient.zipmCloud-SIOTAS-GW66-AppClient.zip  Drag and drop “mCloud-SIOTAS-GW66-AppClient.exe” to path “C:/Program Files/Microtime/mCloud”.  Override the file.  Step 3: execute mCloud-AppClient.exe. 2016/6/7/ 2 19 IP address should be “ ”

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University  Step 0: download PTK_Example.PTK_Example  Step 1: turn off the power.  Step 2: install Zigbee module (PTK-RF-ZB-ZB01).  Step 3: install LED module (PTK-MEMS-RTC). 2016/6/7/ 2 20

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University  Step 4: open the gateway project.  PTK_Example_v2/ePBB/Applications/Projects/PTK-STM32F207/EWARM- V6/Case_Study/MT_Case_SIOTAS-PTK/node_gateway/demo.eww  Step 5: modify configuration in app_cfg.h. APP_TCPIP_CFG_IF_IP_ADDR_STR = " " APP_TCPIP_CFG_IF_MASK_STR = " " APP_TCPIP_CFG_IF_GATEWAY_STR = " “  Step 6: modify constant values in app.c. static const MT_MCLOUD_SIGNAL_T gSignalConfig[] = { { MK_MID_SID(0x0001, 0x0000), // MID_SID "Light", // Name MCLOUD_DATA_UINT16, // DataType 0, // Type COM_TYPE_ZB, // ComType "Lighting_0001", // Paring "", // ShareLib … 2016/6/7/ 2 21 The 4 digits number is the last 4 digits of MAC address of Zigbee of the node.

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University  Step 1: turn off the power.  Step 2: install Zigbee module (PTK-RF-ZB-ZB01).  Step 3: install LED module (PTK-MEMS-RTC).  Step 4: open the lighting project and download.  PTK_Example_v2/ePBB/Applications/Projects/PTK-STM32F207/EWARM- V6/Case_Study/MT_Case_SIOTAS-PTK/node_lighting/demo.eww 2016/6/7/ 2 22

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University Bathroom Device Settings  Step 1: turn off the power.  Step 2: install Zigbee module (PTK-RF-ZB-ZB01).  Step 3: install passive infrared sensor module (PTK-MEMS-PIR).  Step 4: open the bathroom project and download.  PTK_Example_v2/ePBB/Applications/Projects/PTK-STM32F207/EWARM- V6/Case_Study/MT_Case_SIOTAS-PTK/node_bathroom/demo.eww 2016/6/7/ 2 23

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University Entrance Device Settings  Step 1: turn off the power.  Step 2: install Zigbee module (PTK-RF-ZB-ZB01).  Step 3: install RFID module (PTK-RFID-EWTJ680).  Step 4: install reed switch module (PTK-MEMS-REEDSW).  Step 5: open the entrance project and download.  PTK_Example_v2/ePBB/Applications/Projects/PTK-STM32F207/EWARM- V6/Case_Study/MT_Case_SIOTAS-PTK/node_entrance/demo.eww 2016/6/7/ 2 24

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University  Step 1: turn on power.  Step 2: pressing Reset and KEY0.  Step 3: release Reset.  Step 4: release KEY0 after 2 seconds when hearing beep sound. 2016/6/7/ 2 25

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University  We’re using two pieces of PTK for this laboratory, one as gateway and the other as device.  We don’t use the upper layer of PTK and we shall remove it from PTK for this laboratory.  Run the Ubuntu VM, and thus the sql-agent and listem_cmd up.  Connect gateway to host system via Ethernet.  Insert ZigBee module to gateway and client, and RTC module to client.  Turn gateway and client on; download project to board respectively.  Run mCloud-SIOTAS-GW66-AppClient  in DB Machine, Discover->Edit->Ok and Refresh until we have a DB machine named mCloud which is alive.  Visit and we want a machine named mCloud which is alive here, too.  Then go to Online Monitoring->Control Panel.  Reset the gateway and then client when you are to redo these two steps; you need to have ‘1’ shown on 7-segment of the gateway after turning on the client before you can do monitoring. 2016/6/7/ 2 26

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University  Try to connect them all together and get a simple sensor network.  The goals are that:  You can monitor the light and temperature on the website.  You can use bathroom device and entrance device in advance.  Tips:  Opening phymyadmin and mCloud within host system is preferred.  If stuck, try rebooting the Ubuntu VM or resetting the gateway and then device; it may help.  For more information, please refer to documents on the course website. 2016/6/7/ 2 27

Lab 6-1 Department of Computer Science and Information Engineering National Taiwan University  Show that you can connect a gateway device and a lighting device, record the data into database, and also see the values on a browser. 2016/6/7/ 2 28