2011
SYSTEM ARCHITECTURE DESIGN
TEAM MEMBERS:
AMIR ROOZBEH(amirrsk@kth.se, 15 ECTS)
EKAMBAR SELVAKUMAR(ekambar@kth.se, 30 ECTS) ERICSON FERDINAND PASARIBU(pasaribu@kth.se, 24 ECTS) JUNG CHANGSU(changsu@kth.se, 30 ECTS)
MAHSA TABATABAEI ( mahsat@kth.se, 15 ECTS)
RENE PAVEZ FLORES(rene.pavezflores@gmail.com, 18 ECTS)
PROJECT OWNERS
:
HERVE NTAREME,BJORN PEHRSON
2
Contents
Revision history ... 3
1. Introduction... 4
2. System architecture design ... 4
2.1 System requirement overview ... 4
2.2 Possible solutions ... 4
2.3 Chosen solution ... 6
3. System components and architecture ... 7
3.1 Description of components ... 7
3.2 Software architecture ... 8
3
Revision history
Revision number
Release date Remarks
1.0 September 23, 2011 Initial version
2.0 November 18, 2011 Changes to reflect the team’s decision to use client-server system architecture to implement CRM solution
4
1. Introduction
This document describes the architecture design of the Condroid Remote Management System. The document describes possible solutions to implement the system and the chosen solution to implement the system and the rationale of choosing it. The document also gives the detailed description of the implementation.
2. System architecture design
2.1 System requirement overview
The Condroid Remote Management System (CRM) [1] is a system that provides functionality to manage remotely located devices by the mean of mobile phone through GSM networks. There are several possible solutions to implement the system. In the next sections it will be described the possible solutions that has been considered by the project team to implement the system and the chosen solution to implement the system.
2.2 Possible solutions
1. PC board with GSM modem + Android application for user interface
In this solution, client-server architecture will be used to implement the system. A PC board will be used as the server in the system and will be directly connected to the remote device. The server will act as SMS gateway, receiving and processing SMS message from user and configure the device according to the content of message. To provide remote access through GSM networks, a GSM modem will be attached to the PC board.
An Android application will be developed to provide a more user friendly interface to end-user. The application takes input from the user and encodes it into SMS message and sends it to the server.
The advantages of this solution:
Potentially a lower cost compared to the other solutions
A PC board can have multiple physical interface (e.g.: RS232, USB, PCI, Ethernet, etc), making it has more flexibility to connect to external device
The operating system for the system can be freely chosen, provides more flexibility The disadvantages of this solution:
Higher power consumption compared to the other solutions
The PC board itself does not provide functionality to connect to the GSM networks, hence a GSM modem is needed
5
2. Android smart phone + Android Debug Bridge (ADB) [2]
In this solution and Android smart phone will be used as the computer in the system. Android Debug Bridge functionality will be used as method to communicate with external device. Since the smart phone supports connection to GSM networks, no extra device is required to implement remote access functionality. An Android smart phone only has USB port to interface with external device. This is problematic since most of the target devices to be managed by the system (e.g.: optical amplifier, water quality sensors, and WiFi repeater) use RS232 interface to communicate with external device. A USB-to-RS232 converter connector cannot be used in this solution because the Android OS does not have the device driver for the connector.
The 2011 Summer CSD Condroid project [3] came up with a solution to use IOIO board [4] to solve this problem. A IOIO board provides API’s so that Android OS can communicate with the IOIO board. The board itself has UART ports than can be used to interface with RS232 interface, so an application on Android OS can communicate with external device through the board.
The drawback of this solution is that the IOIO board needs to be powered, which make power consumption of the system increases. The board itself cannot be connected to RS232 connector directly. The board’s UART interface is TTL interface [5]. A TTL-to-RS232 converter is used to connect the board to RS232 interface.
The advantages of this solution:
Lower power consumption compared to a PC board Direct support for connectivity to the GSM network The ADB is supported by all version of Android OS The disadvantages of this solution:
A smart phone has only one USB port
IOIO board and TTL-to-RS232 converter are required
Since ADB is a debugging tool in Android OS, Google does not guarantee that it will continue to exist in the future version of Android OS
3. Android smart phone + Android Open Accessory Development Kit (ADK) [6]
This solution has the same basic idea with the Android smart phone + ADB solution, to use an Android smart phone as the computer in the system. Android Open Accessory Development Kit (ADK) is a functionality in Android OS that allows external USB hardware to interconnect with an Android-powered device. This functionality is introduced in the Android 3.1 platform (also back ported to Android 2.3.4). Because of the same reason with the Android smart phone +
6
ADB solution, an external device that acts as the USB-to-RS232 converter is required. In this solution, an ADK compatible board is used.
The advantages of this solution:
Lower power consumption compared to a PC board Direct support for connectivity to the GSM network
Does not require the user to enable USB debugging feature in Android OS, which makes it more secure compared to the approach of using ADB
The disadvantages of this solution:
The smart phone has only one USB port
ADK compatible board and TTL-to-RS232 converter are required ADK is supported only in Android OS 2.3.4 and later releases.
2.3 Chosen solution
After considering available options, it is decided that the option number 1 (PC board with GSM modem + Android application for user interface) will be used as the solution to implement Condroid Remote Management System. This solution is chosen based on these considerations:
1. The financial cost required to build the system is much lower compared to the other options [7].
2. If the PC board is chosen carefully, power consumption of the server side of the system is still considerably low. Alix system board [8] has around 5 W power consumption. Power consumption of a GSM modem is also typically low. For example, a Huawei E1550 modem consumes less than 2.5 W [9].
The power consumption of an Android smartphone in idle condition is around 0.6 W in 3G networks and 0.7 W in 2G networks [10]. But in solution number 2 and 3, IOIO board or ADK main board and TTL-to-RS232 converter also consume power. It is estimated that the total power consumption of a system implemented using solution number 2 or number 3 will be more than 4 W.
7
3. System components and architecture
3.1 Description of components
The solution for the Condroid Remote Management System is represented in the following diagram. GS M n etw orks G SM n etw orks
Remote Management System server RS232 Device GSM modem PC board Android application End User
Figure 1: Condroid Remote Management System’s diagram
End-user will access the system remotely through GSM networks. End-user will have user interface to the system through an application on Android smartphone. The application takes input from the user, encodes it to SMS message and sends it to server. The server will receive the message, process the content and configure the target device according to the message’s content.
Device(s) connected to the system can send command response or information to the server. The server then processes the input from the device(s) and when necessary, will send notification to the end-user through GMS networks.
This is the list of hardware components that will be used in the system: 1. Alix system board (alix2d3 model) [11]
This PC board acts as an SMS gateway machine in the system. 2. Gammu SMS gateway software [12]
This SMS gateway software will be used to retrieve SMS message from GSMS modem. 3. GSM modem
GSM modem will provide connectivity to GSM networks so that the server can receive and send SMS message. GSM modem that can be used in the system is a device that is
8
supported by Gammu. The list of supported device can be found at [GW]ammu project’s website [13]. In this project, Huawei E1550 HSDPA USB modem will be used for server software development.
4. RS232 connector cable
This cable is used to connect the system with the RS232 interface of the external device.
3.2 Software architecture 3.2.1 Server software
The architecture of CRM server software is depicted in the diagram below. CRM server gammu gammu-smsd mysql condroid-serv cron condroid-mysqlcron read/write call call read/write read/ write
Figure 2: Condroid Remote Management System server software
The CRM server software consists of the following components: 1. gammu
gammu is an open source SMS gateway software. This software will be used to manage the USB modem to implement the functionality of receiving and sending SMS message. 2. gammu-smsd
gammu-smsd is a daemon program that utilize gammu functionalities. gammu-smsd periodically scans GSM modem for received message and stores them in defined storage. MySQL will be used as storage in this project implementation. gammu-smsd also periodically checks the storage for outgoing message queue and sends it out if there is any message in the queue. gammu-smsd is configured to call an external application [condroid-serv] that processes received message.
3. condroid-serv
condroid-serv is a program that will process received SMS message. The program analyzes the content of message from user and configure target device according to the
9
message content. condroid-serv also sends reply message to user when necessary. In this program, security measure (user authentication, user whitelist and blacklist, etc.) is also implemented.
condroid-serv is called by gammu-smsd when there is received SMS message. condroid-serv then retrieve the received message from mysql database and process it. To send reply message to user, condroid-serv writes the reply message to outgoing message queue in database storage.
4. mysql database
mysql database is used as back-end storage for received SMS message and to hold the queue for outgoing messages. User’s credential information that is used for authentication is also held in the database.
5. cron
cron is a Linux system process that will execute a program at a preset time. In CRM server, cron is used to call condroid-mysqlcron program regularly.
6. condroid-mysqlcron
condroid-mysqlcron is the program that perform scheduled maintenance of records in the mysql database. The program will remove old records to avoid the database size grows too large. The program also removes the credential of user who has been idle in the system for certain time. This is used to implement automatic log out for idle user.
10 3.2.2 Client software
The client software runs on Android smartphone and takes input from user, encodes it into SMS message and delivered it to the server. It consists of a few functional modules as described below.
Figure 3: Condroid Remote Management System client software
The client software consists of the following components: 1. Authentication processing module
This module exchanges authentication messages with a user pin code before accessing remote devices. Only an authenticated user can proceed to next step.
2. Custom command module
A user’s input commands are sent by this custom command module. A user can type any kinds of messages in this module.
3. GUI command module
This module supplies more user-friendly GUI for sending commands. A user can send commands to the remote system without typing by using GUI.
4. Administration module
In this module, an administrator user can add or remove phone numbers that are allowed to access the remote system.
11 5. SMS parsing module
This module checks the validation check of received messages and makes its own header fields before sending SMS. In addition, it analyzes the content of SMS for processing response messages from the remote devices.
6. Database management module
The client software uses database system for managing remote sites information, commands and command history. This module can make a user handle many kinds of commands and remote sites easily using database system.
12
4. Reference
[1] Condroid Remote Management System Requirement Specification, ver. 2.0, The 2011 Fall CSD Remote Management System project team, Stockholm, 2011, pp. 4
[2] Google (2011, November 17). Android Debug Bridge [Online]. Available: http://developer.android.com/guide/developing/tools/adb.html
[3] The 2011 Summer Condroid project team (2011, November 17). Condroid [Online]. Available: http://csd.xen.ssvl.kth.se/csdlive/content/android
[4] Sparkfun Electronics (2011, November 17). IOIO Board for Android [Online]. Available: http://www.sparkfun.com/products/10748
[5] Wiesemann & Theis GmbH (2011, November 17). TTL interface [Online]. Available: http://www.wut.de/e-1wwww-11-apus-000.php
[6] Google (2011, November 17). Android Open Accessory Development Kit [Online]. Available: http://developer.android.com/guide/topics/usb/adk.html
[7] Business analysis
[8] PC Engines (2011, November 17). Alix System Boards [Online]. Available: http://pcengines.ch/alix.htm
[9] Product description: Huawei E1550 HSDPA USB stick, V100R001, Huawei Technologies Co. Ltd., 2009, pp. 9
[10] Rice, A. and Hay, S., “Decomposing power measurements for mobile devices,” in [IEEE International Conference on Pervasive Computing and Communications (PerCom) 2010], [2010] © [IEEE]. doi: [10.1109/PERCOM.2010.5466991]
[11] PC Engines (2011, November 18). alix2d3 System Model [Online]. Available: http://pcengines.ch/alix2d3.htm
[12] [GW]ammu project (2011, November 18). Gammu [Online]. Available: http://wammu.eu/gammu/
[13] [GW]ammu project (2011, November 18). Gammu Phone Database [Online]. Available: http://wammu.eu/gammu/phones/