Home
People
Publications
Events
Teaching
Projects
Resources
Contact
Community
Blog






Work in Progress
Completed Work

:: Research Group Embedded Interaction :: Media Informatics :: Ludwig-Maximilians-University Munich


Accessing Displays (through a Webserver)

 

2005-09-21 Fixed: Can now write text long enough to fill the whole display
For direct access only: Added basic scrolling facility taken from Jan Humble from RCA
2005-06-10 Fixed: Row number when sending text was ignored
2005-06-01 For direct access only: added a few methods that support scrolling on the display;
added support for word wrapping in text
2005-05-31 Added a test application that directly accesses the display (instead of HTTP access)
2005-04-07 You can now specify the ID of the particle to which the commands are sent (by adding s.th. like id=2.229.007.007.0.0.0.0 to the command string)
2005-04-01 Added ability to send and store images for later display (storebitmap=<URL> and loadbitmap=<number>)
2005-03-11 Added first 'stable' version

 

Open Issues / Drawbacks:

  • Text: can only send about 35 characters in one string to the display
  • Images: If one packet gets lost when sending an image, the image appears scrambled
  • Virtual Coordinates: Currently only text can be set at (nearly) arbitrary coordinates, including negative starting points
  • DisplayServer currently does not support all possible mthods (scrolling, word wraping)


Description

In anology to our SerialServer project, we are developing an HTML interface between any kind of program able to access a web page and some of our hardware. Therefore we built a small web server that interprets simple requests, converts them to defined commands and sends them to an LCD display using Particle technology.

We are using the display add-on board described on the Particles display add-on board page to access a small graphical display.

Windows Binary:

  • For HTTP access, download DisplayServer.exe
  • For direct access, download source code below

Windows Source Code:

Particle Source Code:

 

You can start the server without specifying any parameters:

prompt> DisplayServer

By default, you should be able to acces the server at http://localhost:80. If port 80 is not accessible, the program automatically searches for the next higher available one.

 

Accessed Display

Right now we only support a Barton LCD I2C display that we mounted on a Particle. It has these characteristics:

width 96 pixels
height 40 pixels
color depth 1 (black/white)
text height 8 pixels
text (letter) width 6 pixels, (5 plus 1 space)

 

Available Commands

For the following examples, we assume you have the server running at localhost. Otherwise you can simply replace localhost by the IP (you can also specify a port number).
 

Simple Example

A normal request would look like this:

    http://localhost/lcd0?clear&message=some text&color=1

This clears the display and writes a black text ("some text") at the top left corner.
More examples can be found further down in this document.

 

Commands

Requests will have to adhere to this format:

    http://<hostip>:<port>/lcd0?<command>&<command>&...

The relative path given must be lcd0 (basically a version number) followed by a ? (question mark). Then one or more commands can be given, separated by & (ampersand).

The following commands can be used to access the display. This includes writing text, drawing lines and displaying bitmaps.
It is advisable to give one command by each request only. The order in which multiple commands in one request will be executed is arbitrary (right now it is: clear, line, message, bitmap, invert).
 
Command Description Related Commands
     
id=partid partid is the 8 byte ID of the particle that should listen to the commands; e.g. 2.229.007.007.0.0.0.0; this ID will be used as long as no other ID is specified
right now, it cannot be guaranteed that only the particle with that ID responds to the commands, but only this one will work correctly
all commands
clear[=col] clears the display; col=0 means all pixels off  
invert inverts all pixels  
message=text prints given text; most special characters won't work; spaces (or %20) are allowed posx, posy, color, orientation
color=col [1] the color used for commands like line/text; col=1 means pixels will be switched on (black), col=0 means pixel will be switched off (white)  
posx=nr [0] top left position (x coordinate) where text and bitmaps will start message, bitmap
posy=nr [0] top left position (y coordinate) where text and bitmaps will start message, bitmap
line draws a line from (startx, starty) to (endx, endy) startx, starty, endx, endy, color
startx=nr [0] specifies x coordinate of the starting point of a line line, starty, endx, endy
starty=nr [0] specifies y coordinate of the starting point of a line line, startx, endx, endy
endx=nr [10] specifies x coordinate of the end point of a line line, startx, starty, endy
endy=nr [10] specifies y coordinate of the end point of a line line, startx, starty, endx
orientation=nr [0] specifies the orientation of text or images; nr must be one of {-270, -180, -90, 0, 90, 180, 270} otherwise 0 is assumed message
bitmap=url url is a URL to an image that will be placed at (posx, posy) taking orientation into account; currently, we support only 1-bit BMP files; the dimensions of the bitmap should not exceed 96x40 pixels posx, posy, orientation
storebitmap=url url is a URL to an image that will be stored in the internal flash memory; currently, we support only 1-bit BMP files; the dimensions of the bitmap should not exceed 96x40 pixels loadbitmap
loadbitmap=nr after having called storebitmap one or several times, the image that has been specified in the nrth call is retrieved from the internal flash memory and shown storebitmap

The commands in the next table are used to retrieve data from the display board. Currently, this includes the built-in two-axis acceleration sensors.
 
describe retrive information about the display's capabilities and features in the format given by format format
sensors retrieve available sensor values in the format given by format format
format=type [xml] specifies the format of the text retrieved by descibe and sensors commands; type is one of {xml, html, txt} or {0, 1, 2} describe, sensors

 

Examples

Here are a few example requests showing the basic functionality.

    http://localhost/lcd0?clear
Clears the display, i.e. all pixels are black (switched off).

 

    http://localhost/lcd0?message=top left
Print "top left" at the top left corner of the display.

    http://localhost/lcd0?message=centered&posx=24&posy=16
Prints "centered" in the middle of the screen.

    http://localhost/lcd0?orientation=180&message=top left 180 deg
Print "top left", rotated by 180 degrees at the top left corner of the display. The top left corner now refers to the rotated display, i.e., when rotating the display by 180 degrees, the text will be displayed at the top left corner.

    http://localhost/lcd0?line&startx=0&starty=0&endx=95&endy=39
Draws a black line from the top left to bottom right corner.

    http://localhost/lcd0?invert
Inverts the whole display, i.e., all black pixels become white and v.v.

    http://localhost/lcd0?line&startx=95&starty=0&endx=0&endy=39&color=0
Draws a white line from the top right to the bottom left corner.

    http://localhost/lcd0?invert
Inverts the whole display, i.e., all black pixels become white and v.v.

    http://localhost/lcd0?bitmap=http://www.cip.ifi.lmu.de/~holleis/ei_small.bmp&orientation=180
Writes the 1-bit bitmap found at the given URL to the top left corner (since posx and posy are not specified). The image will be rotated by 180 degrees.

    http://localhost/lcd0?message=side&orientation=270&color=1&invert
Inverts the whole display, i.e., all black pixels become white and v.v.

 

Contact

For enquires please contact Paul Holleis (paul @ hcilab.org, http://www.hcilab.org/paul)