CGI-based applications for distributed embedded systems for monitoring temperature and humidity



Similar documents
SNMP-1000 Intelligent SNMP/HTTP System Manager Features Introduction Web-enabled, No Driver Needed Powerful yet Easy to Use

Computer and Set of Robots

Interfacing an HTML Form to the ez80f91 MCU

Using SNMP for Remote Measurement and Automation

WinCon Programmable Automation. Controller

SIP Protocol as a Communication Bus to Control Embedded Devices

A network monitoring tool for student training

StarterKit Embedded Control SC13 + DK51. From the electronic to the automation

Operator Touch Panel PC OTP/57V esom2586 / x86

Stellaris Based Integrating Web Servers in Embedded Applications

Designed for the needs of automation, telecommunications, remote supervision, and monitoring

Ultra Thin Client TC-401 TC-402. Users s Guide

1 Data information is sent onto the network cable using which of the following? A Communication protocol B Data packet

AUTOMATIC BILLING SYSTEM FOR CISCO ANALOG TELEPHONE ADAPTOR ATA 186/188

Virtual KNX/EIB devices in IP networks

Microcontrollers in Practice

LPC2300/LPC2400 TCP/IP Overview. TCP/IP and LPC2300/LPC2400 Family October 2007

Follow these steps to prepare the module and evaluation board for testing.

Implementation of Wireless Gateway for Smart Home

QuickSpecs. Overview. Compaq Remote Insight Lights-Out Edition

Network: several computers who can communicate. bus. Main example: Ethernet (1980 today: coaxial cable, twisted pair, 10Mb 1000Gb).

TDP43ME NetPS. Network Printer Server. Control Center. for Ethernet Module

First Workshop on Open Source and Internet Technology for Scientific Environment: with case studies from Environmental Monitoring

IP SENSOR 9216 USER MANUAL IP SENSOR 9216 USER MANUAL

Technical Support Information Belkin internal use only

Detailed Table of Contents

Ways to Use USB in Embedded Systems

Course Description and Outline. IT Essential II: Network Operating Systems V2.0

Network-Oriented Software Development. Course: CSc4360/CSc6360 Instructor: Dr. Beyah Sessions: M-W, 3:00 4:40pm Lecture 2

Software installation and configuration IEC-line series

Layered Architectures and Applications

Data Transfer between Serial Link and TCP/IP Link Using ez80f91 MCU

Web Browsing Examples. How Web Browsing and HTTP Works

AP-GSS3000 TM 512Ch GSM SIM Server

Computer Networks/DV2 Lab

FLYPORT Wi-Fi G

System-on-a-Chip with Security Modules for Network Home Electric Appliances

Wireless Microcontrollers for Environment Management, Asset Tracking and Consumer. October 2009

AP-GSS1500 TM 256Ch GSM SIM Server High Performance GSM SIM Server Solution

WISE-4000 Series. WISE IoT Wireless I/O Modules

BIT COMMANDER. Serial RS232 / RS485 to Ethernet Converter

WP WinPAC-8x49 Series (WP-8149/8449/8849) is the new generation WinCE based InduSoft PAC (Programmable Automation Controller).

A Real Time, Object Oriented Fieldbus Management System

Digitale Signalverarbeitung mit FPGA (DSF) Soft Core Prozessor NIOS II Stand Mai Jens Onno Krah

H0/H2/H4 -ECOM100 DHCP & HTML Configuration. H0/H2/H4--ECOM100 DHCP Disabling DHCP and Assigning a Static IP Address Using HTML Configuration

PICNet 1. PICNet 1 PIC18 Network & SD/MMC Development Board. Features. Applications. Description

Alcalde # 1822 Col. Miraflores C.P Guadalajara, Jal. Mexico MX 01 (33) y USA 001 (619) (San Diego, CA.

WIZ-Embedded WebServer User s Manual (Ver. 1.0)

7a. System-on-chip design and prototyping platforms

Procedure: You can find the problem sheet on Drive D: of the lab PCs. Part 1: Router & Switch

Cape Girardeau Career Center CISCO Networking Academy Bill Link, Instructor. 2.,,,, and are key services that ISPs can provide to all customers.

Special FEATURE. By Heinrich Munz

CS 3530 Operating Systems. L02 OS Intro Part 1 Dr. Ken Hoganson

Networked Embedded Greenhouse Monitoring and Control

3.1 RS-232/422/485 Pinout:PORT1-4(RJ-45) RJ-45 RS-232 RS-422 RS-485 PIN1 TXD PIN2 RXD PIN3 GND PIN4 PIN5 T PIN6 T PIN7 R+ PIN8 R-

SNMP Web card. User s Manual. Management Software for Uninterruptible Power Supply Systems

User s Manual TCP/IP TO RS-232/422/485 CONVERTER. 1.1 Introduction. 1.2 Main features. Dynamic DNS

Industrial Communication Whitepaper. Principles of EtherNet/IP Communication

TCP/IP Converter DDS EX-9132 Operation Manual for 8051 Series

Synapse s SNAP Network Operating System

Transport and Network Layer

DL TC72 Communication Protocols: HDLC, SDLC, X.25, Frame Relay, ATM

ELEC 377. Operating Systems. Week 1 Class 3

Andreas Läng. Hilscher Gesellschaft für Systemautomation mbh Intelligent solutions for industrial communication.

Basic Network Configuration

Rcore Embedded Software Platform

Design Issues in a Bare PC Web Server

SX-3000EDM Integration Guide

760 Veterans Circle, Warminster, PA Technical Proposal. Submitted by: ACT/Technico 760 Veterans Circle Warminster, PA

IPv6 Challenges for Embedded Systems István Gyürki

Lesson 10:DESIGN PROCESS EXAMPLES Automatic Chocolate vending machine, smart card and digital camera

From Fieldbus to toreal Time Ethernet

Communication standards and Carel solutions

Load Balance Router R258V

Agenda. Distributed System Structures. Why Distributed Systems? Motivation

Essential Curriculum Computer Networking 1. PC Systems Fundamentals 35 hours teaching time

Chakchai So-In, Ph.D.

Smart Home System Using Android Application

PN5212/PN5320/PN7212/PN7320

8/16-Port IP KVM Switch IKVM-8010 / IKVM Quick Installation Guide

Chapter 3 Operating-System Structures

Getting Started Guide with WIZ550web

Chapter 5. Data Communication And Internet Technology

Fachbereich Informatik und Elektrotechnik SunSPOT. Ubiquitous Computing. Ubiquitous Computing, Helmut Dispert

System Requirements - CommNet Server

Lesson 06: Basics of Software Development (W02D2

File Transfer And Access (FTP, TFTP, NFS) Chapter 25 By: Sang Oh Spencer Kam Atsuya Takagi

Development of an Internet based Embedded System for Smart House Controlling and Monitoring

Embedded Electric Power Network Monitoring System

Implementation of Embedded Web server using TEA algorithm

Overview. Securing TCP/IP. Introduction to TCP/IP (cont d) Introduction to TCP/IP

- Basic Router Security -

NetProbe Lite. Web Based 8 Channel Sensor Collector. User Manual. Version 1.2

Transcription:

CGI-based applications for distributed embedded systems for monitoring temperature and humidity Grisha Spasov, Nikolay Kakanakov Abstract: The paper discusses the using of Common Gateway Interface in developing web-based distributed embedded systems. It shows the tree-layer model in developing client- applications. An example using a BECK microcontroller SC12 in application for monitoring temperature and relative humidity in rooms with controlled microclimate is shown. SC12 is a system-on-chip with embedded RTOS, TCP/IP stack and CGI software. Key words: Distributed Embedded Systems, Common Gateway Interface, CGI, Distributed Automation and Control, temperature and humidity measurements INTRODUCTION Developing distributed automation systems based on Internet and Web technologies is a relative new trend in computer technologies. It gives a common and well-known interface to the client (web browser) and a standard way for communication between devices. All this is a result of invasion of computer network technologies and standards in the field of automation and Networked Control Systems (NCS) [1]. These technologies are used in business information systems, also known as Data processing. Typical examples of distributed automation standards, based on network technologies, are Industrial Ethernet, Ethernet/IP, Ethernet/IDA, PROInet V 2.0 [2, 3]. Common Gateway Interface (CGI) is a way of creating HTML pages with dynamic contents. It forces the to execute some code and returns the result instead of the resource in URL. So using CGI, the client can monitor the internal states of the controlled device or/and send it commands. This paper discusses the using of CGI in these two ways of communication. In such NCS every device is a that can show and change its internal state on a client s request. Real World Signaling A/D Temp sensor Humidity sensor Motion control Image sensor On/Off PWM D/A I/O Support Core Logic PIO(0-14) TMRIN(0-1) TMROU(0-1) PCS(0-3,5-6) I 2 C RS232 (RS485) IPC@CHIP SC12 I80C186 DMA-DRQ(0-1) Watch DOG Timer Ethernet MAC (IEEE 802.3) Ethernet Parallel Bus Expansion Flash ROM 512 KB SRAM 512 KB Application JVM TCP/IP Stack RTOS PPP WWW /. / Web Browser Figure 1. Microcontroller for embedded Internet. - I.6-1 -

Web-based, Internet-integrated embedded systems The BECK s microcontroller IPC@CHIP SC12 is a new generation system-on-chip that has its own embedded hardware and software means for integrating into computer networks, based on TCP/IP communication [4]. The IPC@CHIP is a combination of hardware and software. The software is preinstalled and consists of a Real Time Operating System (RTOS) with file system, complete TCP/IP stack, PPP Server and client, web, FTP, Telnet Server and Hardware interface layer. With this strategy, much of the required functionality is part of the operating system. Only the essential application specific functionality is implemented as a 16 Bit DOS application that is transferred to the file system per FTP. The hardware consists of a 16 bit 186 CPU, RAM, Flash, Ethernet, Watchdog and powerfail detection. The CPU has functions such as timers, I/O lines, serial ports etc integrated. This hardware is available in a small package with a reduced pin count. DOS-like user applications, realized as task on RTOS API functions RTOS, TCP/IP, Hardware, DOS int 21h, Web CGI, Serial (SLIP, PPP), Ethernet, I 2 C TFTP DHCP client Ethernet driver FTP Sockets Application interface TCP/IP Stack ARP, ICMP, TCP, UDP PPP client HTTP Web Telnet PPP UDP config DOS EXE Loader Int 21h Int 16h Int 10h.. Command shell Real Time Operating System (RTOS) with DOS based file system Figure 2. Software platform of IPC@CHIP. The TCP/IP Stack is a high performance stack with little compromises. It offers TCP, UDP, ARP, ICMP, Socket interface, 64 Sockets and 3 device interfaces (Ethernet, PPP and PPP client). With the PPP client, your application can initiate a connection to the Internet. Over this PPP connection, the TCP/IP protocols and services as available over the Ethernet, now become available over long distance connections. The software for IPC@CHIP is based on API functions from its RTOS and BIOS. For debugging, compiling and code generation developer can use every tool that can generate 16-bit applications for Intel 80186. The system allows developing in C, C++, Pascal, Assembler and even Java. For using Java applications on IPC@CHIP a special simple real-time java virtual machine (JVM) is needed. Such JVM is presented by RTJ Computing [ http://www.rtjcom.com ]. Three-layer client- model in developing distributed embedded systems. The client- model is the base model in developing internet-based information systems. In this model client processes request data from the or there are two modules: client the one that requests service, and the one that executes the service. Communication between the client and the is based on the exchange of HTML (Hyper Text Markup Language) documents. Transportation of these documents is based on the protocol HTTP (Hyper Text Transfer Protocol). - I.6-2 -

Internet SERVER OS Web: IIS Windows Apacha Linux/Unix JWS SUN Client Browser: IE Netscape Opera http/html Dinamic Pages ASP (IIS) CGI (Apacha) Java (JWS) Data from Sensor Figure 3. Three-layer model for client- applications. In most of the cases, especially in the data processing systems, the three layer model is used. The first layer is the client that functions by the well-known browsers Internet explorer, Netscape, Opera, etc. The second layer is the Web that works with dynamic HTML pages IIS (Windows), Apache (Unix/Linux), JWS (SUN). The third layer is a database system, or in embedded systems a module that realizes the automation and/or control of a device. The main advantage of this model is the dynamic generation of the information. On the client s request, the Web starts a process that generates dynamically HTML page, based on the data from the third layer. IPC@CHIP RTOS CGI Web Server Client browser User Applications Running on SMS Sender Temperature & Humidity Sensing Figure 4. Functional blocks and relations Figure 4 shows the three layer model in the distributed system for monitoring of temperature and humidity, based on IPC@Chip [5]. The functions of the system are separated between the four main blocks which corresponds with the three-layer on the following way: The internet browser assures that the system has a familiar user interface. The visualization of the monitored parameters is placed here. The integrated Web in conjunction with the CGI deals with the control of the remote processes and transfer of dynamic HTML pages to the client. The realtime operating system (RTOS) of the IPC@Chip manages with the Web s - I.6-3 -

tasks, TCP/IP communication, local peripherals, user tasks and interconnection between them. User s applications and tasks, running on the controller, are used for automation purposes. In our case, this is the sensor driving and management of the SMS communication. The software of this system consists of several blocks. One block is for temperature and humidity measurement, one for communication with the GSM gateway and sending SMS and one is for generating dynamic HTML documents with the data from the sensor. The communication with the GSM gateway is based on the AT commands (Attentions commands) that are sent trough the serial interface of the microcontroller. The block for this communication is started as a task on the RTOS and converts the data to a SMS PDU (Protocol Data Unit) format to be readable by the GSM. The measurement block consists of two identical parts, one for temperature measurement and one for humidity measurement. The microcontroller sends a command to the sensor to get data. Then it normalizes this data and stores it in the operating memory. The two identical parts are executed sequentially and are repeated together. Between every two iterations of this cycle the task sleeps for about one minute to free the processor for tasks with low priority (like FTP, Web, Telnet). The communication between the controller and the sensor is trough two-line interface (data and synchronization). A C-library based on the software interrupts of the RTOS is made for this communication. This library has the following functions: shttransstart() starts a transmission; shtreset() for restarting of the sensor; shtinit() initializes the sensor interface; shtsend() sends a command; shtrecv() receives data from sensor. The last software block gets the data from the measurement block and generates dynamically HTML document containing this data. This block communicates with the client trough web interface. The client sends a HTTP request to the web and the sends a HTML document as a reply. CGI is the thing that connects the web with the internal data on the controller. CGI is a standard interface between an external application (gateway) and information (HTTP) [7]. When the client writes a URL address in the browser window, the browser connects with the HTTP using the domain part of the URL and sends a request. The finds the requested resource using the PATH part of the URL and transfers the file (resource) to the client. If the resource is an HTML document the browser visualize it, if not the browser searches the appropriate program to open it. When using CGI, the again finds the resource file, but it now executes it instead of sending it. After this the sends to the client the results of the execution. In this way the client can force the to execute some code and use the results. Using CGI, the client can send data to the trough environment variables with the HTTP methods Get and Post. This is a very common way for creating HTML documents depending on the internal state of the and data send by the client. In the IPC@Chip CGI has slightly different organization. The requested files are not executed on the request but are running as RTOS tasks on the controller. On request the RTOS switches to the corresponding CGI task and the task returns the results in the operating memory. The CGI reply consists of HTTP result code, return data type, data length and real data. In the presented example, there is one CGI task running on the IPC@Chip. It generates a short HTML document containing the temperature and humidity values from the last measurement. This task do not use data received from the client. It uses data from - I.6-4 -

the measurement block. This transfer of data is carried out with a block of shared memory. The measurement block writes data in this memory and the CGI task reads and use this data. There will be a problem if the two tasks address this block of memory at the same time. To avoid this problem and synchronize the work of the two tasks a semaphore is used. When one of the tasks gain access to this memory it reserves a semaphore and after it finishes its work it release the semaphore (figure 5). When one of the tasks tries to reserve already reserved semaphore the RTOS makes this task wait. Figure 5. Using semaphores in sending measurement data to CGI task Semaphores are a way of synchronization between processes that relies on the operating system. The RTOS of the IPC@Chip has API functions for creating, reserving and releasing of semaphores. It can supply up to 60 semaphores at the same time. For controlling the parallel execution of this task a small program is written. This program read initialization data from files on the controller memory, installs and uninstalls the CGI processes, declares a semaphore from RTOS and frees it, releases the unused memory and stops the unneeded tasks. The other purpose of this program is to allow adding a serity to the project using identification and authorization. - I.6-5 -

CONCLUSIONS AND FUTURE WORK The represented system successfully integrates the functionality of the sensor, GSM gateway and embedded web and RTOS. The client- model guarantees the openness of the project and ability to expand. Expanding can flow in the following ways: adding microcontrollers the only limitation here is the number of nodes in a LAN; adding more clients stations this stations can be with different platforms. The only limitation is that their operating systems has a TCP/IP protocol stacks; ability to develop hierarchical systems; ability to upload different user application on the controller (easy upgrade) To add more functionality to this project, a forth layer can be add. This layer is a that controls all microcontrollers in a local network. In this layer is integrated the security of the sensor network and it synchronizes the work of the nodes in the network. The communication between controller nodes and this serer is supposed to be based on XML(eXtended Mark-up Language). Another way of expanding the functionality of the system is integrating a JVM (Java Virtual Machine) in the controller that will be used instead of the CGI. This will allow the developers to create more flexible applications. REFERENCES [1] Djiev, S. Communication Networks in controlling systems Automation and Informatics,No.2,pp 13-17, 2003. [2] Buesgen, R. and Felf, J. Real time on the Ethernet: how PROInet v2.0 improves on v1.0, Control Engineering Europe, October, pp. 27-27, 2002. [3] www.ida-group.org/ IDA Specification ver 1.1. [4] www.beck-ipc,com/ipc/ IPC@Chip s Home page Product info, datasheets, examples. [5] Spasov G., Kakanakov N., Distributed Embedded System for monitoring of temperature and humidity, Elektrotehnika & Elektronika, 2004, [in press]. [6] Tanenbaum A., Steen M., Distributed Systems Principles and Paradigms, Prentice Hall, 2002. [7] www.cgi101.com/class/ - CGI Tutorial. ABOUT THE AUTHORS Grisha Spasov, PhD, Department of Computer Systems, Technical University Sofia, branch Plovdiv, Phone: +359 32 659576, Е-mail: gvs@tu-plovdiv.bg Nikolay Kakanakov, master engineer, Department of Computer Systems, Technical University Sofia, branch Plovdiv, Phone: +359 88 7265505, Е-mail: kakanak@tuplovdiv.bg - I.6-6 -