[CCP14 Home: (Frames | No Frames)]
CCP14 Mirrors: [UK] | [CA] | [US] | [AU]

(This Webpage Page in No Frames Mode)

CCP14

Methods, Problems and Solutions

WAP (Wireless Application Protocol) for Crystallographic and Scientific Applications

Tutorial example of setting up a WAP viewable crystallographic/scientific equipment status service

The CCP14 Homepage is at http://www.ccp14.ac.uk

[To Problems and Solutions]

[Disclaimer] | [Summary: WAP is Crap - but is pseudo usable] | [Why Bother then with WAP] | [Setting up the Webserver to handle WAP wml pages] | [Crystallographic WAP Example - WAP viewable Synchrotron Beam Status (Text and Graphical)] | [WAP Resources, Emulators, WML Editors and WBMP converters]

Disclaimer

Note: The following are mainly personal opinions and should not be considered a substitute for thinking for yourself. The example given is rather kludge ridden and should not be seen as a substitute for doing something better.

Warning: Many pundits are predicting that WAP will be a stop gap solution and will be replaced in the medium term by a superior protocol that does not have the bad design problems of the WAP protocols.


Summary: "WAP is Crap" - but is pseudo usable

WAP (Wireless Application Protocol) is a way of providing content and two-way interaction from the Internet and World Wide Web onto the screen of a mobile phone. As of Early 2000, it is one of the "in" fads. The concensus by those claiming to be in the know is that from a technical and engineering standpoint, "WAP is a CRAP". WAP is a badly written protocol that pretty much breaks every relevant standard in almost every possible manner; and in almost the worst possible way. Though the WAP hype merchants would like to claim the opposite. Links to relevant articles and ranting follows:


Why Bother then with WAP

With WAP (Wireless Application Protocol), you can obtain information on the status of Crystallographic and Scientific hardware or software remote from a network or special report terminal or screen. It is also possible to have user/password authentication and interaction with software/hardware via a WAP complient mobile phone.

For large research or user facility running all hours, this could be quite helpful to visitors and contact people who might be temporily remote from the experimental area due to meals or rest. It might be also useful when wanting to know the status of diffraction equipment in long data collections and check if any error conditions have been observed (Liquid Nitrogen is Low, sample changer jammed, etc). Any program or hardware that outputs a log file of what it is doing can be trivially put on a WAP (and/or Web) server (e.g., For UNIX, just using "grep/grep -v", "top" or "tail").

Once demonstrated (and you have a fair idea of what to do), it is not that difficult to set up a WAP viewable service. PC/Windows/Linux/FreeBSD (Little Endian computers) are probably the easiest for setting up the web-server and various related WAP utilities due to many programs being written for these systems. The following example was done on an SGI (Big Endian) which was non-trivial due to finding a solid and convenient WBMP conversion program (the unique and kludge ridden image format that WAP users for displaying graphics).


e.g, SRS Beam Status via WAP at Daresbury Laboratory

(You will need a WAP enabled mobile phone or a WAP Emulator to view the following pages)

Scientific Applications of WAP


Setting up the Webserver to handle WAP wml pages

The following example uses the freely available Apache webserver for UNIX and Windows. But this can be applied to any decent webserver. Any webserver can serve WAP wml pages and custom made applications. There is no need to spend money on a specialised "WAP Server" which many phone hardware and software vendors are trying to push in a "psuedo-mystical" manner as the only way to get WAP enabled.

In /usr/local/apache/conf/httpd.conf add the following MIME Types for WAP:

AddType text/vnd.wap.wml .wml
AddType image/vnd.wap.wbmp .wbmp
AddType application/vnd.wap.wmlc .wmlc
AddType text/vnd.wap.wmlscript .wmls
AddType application/vnd.wap.wmlscriptc .wmlsc

Be wary that these could have already been defined in your /usr/local/apache/conf/mime.types file depending on which version of Apache you are using (thus there is no need to duplicate these)

index.wrl is the preferred default page so add this into the /usr/local/apache/conf/httpd.conf file under the DirectoryIndex option. (It should be noted you can use the browser header to decide whether to present an HTML or WML page as per is sometimes done with Netscape or Internet Explorer specific content. Refer to the Mod_rewrite module in Apache for this type of thing. There are webpages that can give "WAP User Agent Lists and their Accept Headers".

DirectoryIndex index.html index.htm default.htm Default.htm mirror.htm xfit.htm tutorial.htm index.wml

Restart the Apache web server using /usr/local/apache/bin/apachectl restart. Done!

Another note: If can be convenient for users of the service to have the WAP area on a virtual domain. (e.g., wap.domain.ac.uk, wap.dl.ac.uk) Typing in "~" and "/" via the mobile phone interface can be tedious. Though WAP pages can be "bookmarked" once they are viewed in the Mobile phone by users for easy access. You can also have interlinked pages as per normal web-style browsing; but WML pages are of a slightly different format to HTML, and WAP complient devices are not as forgiving of errors as the major web-browsers.

Once a virtual name has been assigned in the DNS (usally a job for the local network/internet support people), it is easy to add these into Apache webserver and other webserver software.

e.g., for wap.dl.ac.uk (text interface) and wap2.dl.ac.uk (graphical interface) using the freely available Apache 1.3.12 for UNIX and Windows:

NameVirtualHost 193.62.124.194


<VirtualHost 193.62.124.194>
ServerAdmin ccp14@ccp14.ac.uk
DocumentRoot /web_disc/ccp14/web_area/wap
ServerName wap.dl.ac.uk
ErrorLog logs/wap_error_log
CustomLog logs/wap_access_log combined
</VirtualHost>


<VirtualHost 193.62.124.194>
ServerAdmin ccp14@ccp14.ac.uk
DocumentRoot /web_disc/ccp14/web_area/wap2
ServerName wap2.dl.ac.uk
ErrorLog logs/wap_error_log
CustomLog logs/wap_access_log combined
</VirtualHost>


Crystallographic WAP Example - WAP viewable Synchrotron Beam Status (Text and Graphical)

  • Text only version of SRS Status Beam status via WAP: http://wap.dl.ac.uk (needs a WAP page viewer)
  • Graphics and text version of SRS Status Beam status via WAP: http://wap2.dl.ac.uk (needs a WAP page viewer)

As mentioned above, any program or hardware that outputs a log file of what it is doing can be trivially put on a WAP (and/or Web) server (e.g., For UNIX, just using "grep", "top" or "tail").

However, the following example uses the slightly non-trivial case of when the information you need is accessible on another public HTML webpage. The following was setup on an SGI O2 Webserver and was non-trivial due to it's "big-endian" nature (relevant for WBMP image conversion). PC based systems running Windows, Linux or FreeBSD should be much easier with a much wider variety of "canned" programs being available. However, a new BMP to WBMP image conversion program written especially because of these problems is SABWBMP for Windows and UNIX (Big_Endian/Little_Endian Computers): (http://www.DroidWarez.com/sabwbmp/)


Text Only Synchrotron Status WAP Page

  • Creating "Text only" WAP viewable status page (using freely available software):
    • Note: A WML page is just the equivalent of an HTML page. Unfortunately the designers of WAP did not make the protocol compatiable with reading standard HTML pages

    • Grab the webpage containing the System information using "snarf"
    • Convert page to ASCII TXT using "html2txt"
    • Download a free WML creation package and use this as a guide for creating a template WML page with all the formatting correct. (DotWAP is very good)
    • Create a head.txt and tail.txt of the constant parts of the WML page using the above information.

    • Reformat the TXT to a WML page using standard UNIX tools or the most excellent "replace" (a search and replace txt program for UNIX - the sane person's "SED")
    • Use the UNIX "cat" program to stitch the WML file together.
    • Copy to the relevant web accessible area on the webserver HTML area
    • Test with some different emulators: (Wapalizer Javascript) | (WINWAP for Windows)
    • Put in a UNIX script and add into cron/crontab to run each minute

    • The resulting index.wml file looks like the following:
      <?xml version="1.0"?>
      <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
      
      <wml>
      <card id="loc" title="SRS Status">
      <p>
           T1 23:25:16 18 May 2000  
      <br/>Crnt: 18.1 mA  <br/>Life: 17.5 Hrs  
      <br/>Erg: 2.0 GeV 
      <br/>Wigglers:<br/> 
      9: OFF    6: 1.0 T 
      16: OFF    14: 2.0 T 
      <br/>Summary:  
      <br/>    
      Single Bunch User Beam 
      
      </p>
      <p><a href="http://wap2.dl.ac.uk">Click for Graphical SRS Status</a></p>
      </card> 
      </wml>
      


Graphics and Text Synchrotron Status WAP Page

  • Creating "Graphics and Text" WAP viewable status page (using freely available software):
    • Note: A WBMP image file is just a WAP protocol specific black/white image format. Thus this is the equivalent of a GIF image file on the HTTP protocol/World Wide Web

    • Use dynamic WML status text from previous example (no need to duplicate this if doing it already).
    • Download a free WML creation package and use this as a guide for creating a template WML page with all the formatting correct. (DotWAP is very good)
    • Create a head.txt and tail.txt of the constant parts of the WML page using the above information.

    • Grab the web JPG file containing the System information using "snarf"
    • Convert and resize the JPG to a 256 colour BMP file using "djpeg" (Part of the Independent JPEG Group's free JPEG software) As a Nokia 7110 screen height and width is 96 x 65 pixels, having a screen height of 86 was used via convert's "-scale" option.
    • Convert the 256 colour BMP file to a WBMP file using SABWBMP for Windows and UNIX ( It is also possible to use "convert" (Part of ImageMagick for UNIX and Windows))

    • Copy WML and WBMP file to the relevant web accessible area on the webserver HTML area
    • Test with some different emulators: (Wapalizer Javascript (does not display graphics properly due to dodgy WBMP spec?)) | (WINWAP for Windows)
    • Put in a UNIX script and add into cron/crontab to run each minute

    • The resulting index.wml file looks like the following:
      <?xml version="1.0"?>
      <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
      
      <wml>
      <card id="loc" title="Graphical SRS Status">
      
      <p>
      <img src="status.wbmp" alt="Beam Status Loading"/><br/>
      </p>
      <p>
      
           T1 04:44:33 19 May 2000  
      <br/>Crnt: 18.3 mA  <br/>Life: 30.3 Hrs  
      <br/>Erg: 2.0 GeV 
      <br/>Wigglers:<br/> 
      9: OFF    6: 1.0 T 
      16: OFF    14: 2.0 T 
      <br/>Summary:  
      <br/>    
      Single Bunch User Beam 
      
      
      </p>
      
      <p><a href="http://wap.dl.ac.uk">Click for Text only SRS Status</a></p>
      
      </card> 
      </wml>
      


WAP Resources, Emulators, WML Editors and WBMP converters, etc

Articles and things


WAP FAQ, and WAP web simulator to test pages


WAP Emulators


WAP WML Toolkits

  • wml-tools for Linux/UNIX (e.g., wbmp2xpm, wmlhtml, wml decompilers, wbmp2xpm): http://pwot.co.uk/wml/
  • Amaro's Lab - Project "TRANSWAP" ("TRANSWAP is an (web) application that makes from your existing web page a WAP compatible one, just by adding a couple of special tags"): http://amaro.g-art.nl/info.html


WAP WML Page Editors


WAP happy Image Manipulation


Other WAP links and things


HTML to TXT Converters and Information


ASCII Text Search and Replace Software


[To Problems and Solutions]

[CCP14 Home: (Frames | No Frames)]
CCP14 Mirrors: [UK] | [CA] | [US] | [AU]

(This Webpage Page in No Frames Mode)

If you have any queries or comments, please feel free to contact the CCP14