/IP stack, and interface components. This generally precludes the use of popular low-cost microcontrollers that have only 1 to 4 KB of ROM and less than 100 bytes of on-chip RAM.
The company emWare, a developer of embedded devices, took a hard look at the problem, discarding the traditional assumptions about the client/server mechanism. The resulting Embedded Micro Interface Technology (EMIT) can potentially make Web-based device control practical and inexpensive.
Role Reversal
Instead of the device incorporating all the necessary hardware and software resources, EMIT pushes as many tasks as possible onto a Windows- or Unix-based host machine -- a skinny server/fat client des
ign. The device gains access to the resource-intensive tasks on the client through a lightweight distributed-computing architecture implemented by emWare.
Thus, EMIT's device-resident Web server requires only 30 bytes of RAM and 750 bytes of ROM to operate, which lets it run on a host of low-cost embedded microcontrollers all the way up to the largest microprocessors. Because of the server's tiny memory footprint, EMIT can use on-board EPROM to manage additional device data (e.g., logging information) or store JavaScript class files and HTML documents.
On the client side, the host system uses a library of preprogrammed functions. These functions minimize the device's use of resources by assembling the device's graphical interface in the browser and helping manage communications with device-specific functions. For example, the embedded device stores compressed information as special tags in HTML files, and the desktop computer handles all the data expansion of the tags.
EMIT's Architecture
EMIT provides the following services: file storage and retrieval, device subroutine invocation, security, device variable access, and device events. The first three services are normal Web-server features. For example, you implement device security through the use of well-established Web protocols.
The last two services EMIT handles. Variables are data objects on the device. Access to them is accomplished through a secondary socket-server process. Java applets launched on the client can create a connection to the variable server and read and write variables through this service. Events are messages the device passes to the client. The receipt of an event message can trigger an executable function on the host workstation. These functions can then log data to a database, send e-mail, or communicate with other devices.
You create the client's Java-based user interface (UI) through an HTML file that invokes a container applet. The file specifies which generic interface components are part of th
e Web page, what they look like, where they go, and to which embedded variables or functions they are connected. The data on the device controls the interface and its operation but is not burdened with the cost of storing these large interface components.
EMIT provides five modular software components, as shown in the figure
"EMIT's Architecture."
Starting on the client side, they are:
- The emObjects are a function library composed of JPEG/GIF graphics or Java applets. The Java container applets implement the client's UI. Such objects include standard Abstract Windowing Toolkit (AWT) components, as well as device-specific components such as an LED bar graph, a seven-segment display, and an analog meter. There are even transparent buttons that can overlay an actual image of the device. Certain emObjects also execute in response to events the device returns.
- The emManager coordinates the client's locally stored GUI components with items on the device, thus providing
a coherent view of the device's operation in the browser. The emManager also handles the privilege and validity checks of all requests. A polling mechanism (used for the simplest devices) or a token-passing mechanism maintains the status of device variables. A socket-server process makes this data available to Java applets.
When the status of the device changes, it returns an HTML page that contains microtags (described below) to the client. The emManager substitutes each microtag with its corresponding emObject, and the browser creates the interface from this combination of HTML and emObjects. Because emObjects can be Java applets, you can use the interface to issue commands back to the device.
- The emMicro is the device's small, special-purpose Web server. It works in conjunction with the emManager to provide file, variable, and function access on the device. You access all device resources via tables. For each service the device supports, there is a table of name/attribute information. (Typical
device services are functions, variables, events, static documents, and dynamic documents.) Commands the client sends are processed by a command interpreter that looks up function addresses or variables through these tables. Sample commands are
GetVariable
,
GetStaticDocument
,
SetByteVar
, and
InvokeFunction
.
- Microtags are small (1 byte or more) packets of highly condensed information that define device controls (e.g., switches, buttons, and LEDs). Microtags are embedded in the HTML page that represents the device interface. It's relatively easy for manufacturers to create custom microtags to match the capabilities of any particular device.
- The emNet is an efficient, adaptable serial protocol that lets developers use a lightweight communications protocol for building small applications. The emNet is a message-based master/slave protocol that uses a combination of packets and stream data. All data is sent as binary values with prefix-encoded commands. The emManager
and emMicro operate on top of any network transport that can deliver emNet's small packets.
Applications for EMIT
Companies are currently developing a number of applications that exploit EMIT. For example, agricultural equipment manufacturers are adding EMIT-enabled devices to monitor all kinds of farming equipment, such as tractors, combines, and irrigation systems. Weiser Lock is adding EMIT to its electronic door lock to monitor the lock via an exact replication of a lock's touchpad, as shown
in the screen
. Not only does EMIT let you change a lock's status, such as unlock at 8:00 in the morning and lock at 5:00 in the afternoon, it also provides the ability to view historical data, such as how often a lock was enabled and disabled.
EMIT can provide a means for medical professionals to monitor all types of medical equipment remotely, such as fetal and heart monitors, and intravenous infusion systems. This technology can significantly reduce medical costs,
while at the same time providing a more efficient way to manage such systems. Further examples of EMIT-enabled devices are available at
http://www.emware.com
.