101年嵌入式Linux系統開發就業班運用即時通訊服務進行遠端設備控制Use Instant Message Services to Control RemoteDevices 成員: 林正育、劉乃文、賴彥翔 11/28/2012
Outline Project Objectives Achievement System Architecture Features of The System System Components Data Flow Examples DEMO Q&A
Can We Use A Cell Phone to Control A Devices OverThe Internet Cloud?
Objectives Use an IM (Instant Message) protocol to control devices on an embedded system. Control the embedded devices remotely through internet. Minimum system administration efforts. Flexible to change the configuration without re-compiling and re-start the daemon.
Achievement Study XMPP (Extensible Messaging and Presence Protocol) specifications (RFC’s). Select an XMPP server on internet. Understand the usage of the XMPP services. Design the architecture of the control protocol. Implement the ITRC (IT Remote Control) on ARM embedded system. Successfully test and prove the architecture.
System Architecture Linux Embedded System Cell Phone/PC DeviceSend command in Extract command from 1xmpp format xmpp and launch command Execute command and Google Itrcd print results Talk Internet (Remote Client Control Device Daemon) 2Receive the Return the resultsexecution results in xmpp format Other components: 1> itdevconfig Device 2> itdevlist 3 3> .itrclogin 4> .itrcdev
Features of The System Comply with open standard • Use IETF XMPP as the communication protocol. Effortless to maintain and operate • Leverage Google IM services. • Use Google Talk as client software. Flexible to integrate with other devices • ITRCD does not need the knowledge of devices • Design ITRCD protocol to communicate with devices Portable to different embedded systems • Develop in C the native language used in Linux.
System Components itrcd: a daemon process to provide remote shell capability for Google Talk clients. itdevconfig: manage the device list in the configuration file. itdevlist: retrieve the device information in the configuration file. .itrclogin: XMPP login information file. .itrcdev: device configuration file.
itrcd Run on the same embedded system with the devices to be controlled. Authenticate and login to Google Talk XMPP server. Run the commands sent from the Gtalk clients through XMPP Message protocol. Return the output of the commands back to Gtalk clients.
itdevadd A program can be run by a user on the embedded system. Provides text user interface for user to manage the configuration file. Users can add, delete, modify, and list the devices which will be controlled by ITRC.
itdevlist A program sit on the embedded system. Read the configuration file and print out the device list with device_id, device_name, device_cmmand for each device. Gtalk client can send this command to get the device information and use it to control the devices.
.itrclogin A hidden file on embedded system. Contain jid and passoword to login to XMPP server. The format is jid:password in one line for each user login information.
.itrcdev A hidden file on embedded system. Contain device information for the devices on the embedded system. The format is device_id:device_name:device_command in one line for each device.
ITRCD Protocolstep Gtalk Client ITRCD1 Itdevlist return device information to Gtalk client2 <device_command> help return the usage information3 “<device_command> Execute the command on the device <operation> accordingly and return the results. [parameter] ..”4 Repeat step 2 or step 3 disconnect close the stream session and terminate ITRCD
State Diagram of ITRCD ProtocolRemote Google Talk Client ITRCD Device Send “itdevlist” Return available devices and commands Send “<command> help” Launch “<command> help” Execute “<command> help” Print the usage information Return the usage information Send “<command> <op> <para> …” Launch “<command> <op> <para>…” Execute“<command> <op> <para>…” Print the results Return the results
Data Flow Example Gtalk Client: send “itdevlist” itrcd: run “itdevlist” and return device information to Gtalk client. Gtalk Client: send “<device_command> help” ITRCD: run “<device_command> help” Device Program: print the usage information. ITRCD: return the usage information to Gtalk client. Gtalk Client: send “<device_command> <operation> <parameter> ..” ITRCD: run “<device_command> <operation> <parameter> ..” Device Program: execute the command on the device accordingly and print the results. ITRCD: return the result back to Gtalk client.