Wednesday, May 30, 2007

Status Report for 05/16/2007 -- 05/30/2007

Progress

Detail design for IUMSC 12 sensors Atom Feed

1. Register IUMSC 12 sensors

Before reading all the sensor values from the real proxy box in the IUMSC lab, send requests to register all the sensors with CIMA service endpoint (http://129.79.85.21:7710). Sensor names and meanings are shown below.

  • LabCWOutTemp Lab Chill water OUT
  • LabCWInTemp Lab Chill water IN
  • CampCWInTemp Campus Chill water IN
  • LN2Levl Liquid Nitrogen level indicator
  • Bay1Temp Bay1 Temperature
  • Bay1Humid Bay1 Humidity
  • DETemp Diffractometer Enclosure Temperature
  • DEHumid Diffractometer Enclosure Humidity
  • CrystalTemp Crystal Temperature
  • FrameBuffer_D_Usage Disk Usage Disk D
  • FrameBuffer_E_Usage Disk Usage Disk E
  • FrameBuffer_F_Usage Disk Usage Disk F

Note: The sensor value used before was from test-proxy box (CIMA service endpoint (http://129.79.85.20:7710)) with only two probes (Bay1Temp & LabCWOutTemp) connected to it.

2. Write data to the feed

Part1: Read the parcel into DOM

Get a Parser and parse the parcel

Part2: Update/Append feed

If no feed exists, create the "feed" part of the feed including the following elements: Author, Id, Title and Link and Updated;

Otherwise add an Entry to the feed

If no entry in the feed, create basic elements for the entry including the following elements : Author, Title, Id and Updated

Otherwise get the existing entry handle(there should be only one entry) in the feed

Get the current content in the Content

Set the receiving data to the Content

3. Read feed

Open http://www.netvibes.com/, add the URL of IUMSC Atom Feed(http://hagar.cs.indiana.edu:8181//IUMSCAtomFeed.xml) to netvibes

4. IUMSC Atom Feed in netvibes

The screen shot below shows the Atom Feed in netvibes.


Discussion & Questions

1. The data from 12 sensors come in at different times, that is to say, sometimes nothing comes during 10 to 15 seconds while sometimes data from some sensors come almost at the same time. This might cause that some data might be left out

-- I need to provide file locking function by using the FileLock class before updating, then unlock. Or make the routine that writes the feed "synchronized" or put the feed updating statements in a synchronized block(not as desirable as a synchronized routine).

2. In netvibes, after refreshing the current webpage, new data don’t come, only the old data were shown.

-- I kept clicking the fresh button in the feed area, but it did not work

Future work

1. Get sensor values based on the user’s requirement;

2. Show only values not in normal range;

3. Adjust feed format;

4. The issues described in Discussion section

Thursday, May 17, 2007

Status Report for 04/25/2007 -- 05/16/2007

Progress

Detail design for Bay1Temp Atom Feed (method1 shown in the last report is used here)

1. Create an atom feed document

  • New a feed

Feed theFeed = new Feed();

  • Add "xmlns" attribute to the feed

theFeed.addAttribute(new Attribute("xmlns","http://www.w3.org/2005/Atom"));

  • Add Author

theFeed.addAuthor(new Author("Yu(Carol) Deng"));

  • Set a universally unique Id for the feed

theFeed.setId(new Id("urn:uuid:" + new UID().toString()));

  • Add Title

Title feedTitle = new Title("text"); // Set title type for the feed

feedTitle.setText("Bay1Temp Atom Feed"); // Set title content

theFeed.setTitle(feedTitle); // Set the title

  • Add Link

Link feedLink = new Link(); // New a Link in the feed

feedLink.setRel(new Attribute("rel", "self")); // Set "rel" attribute of the link

feedLink.setType(new Attribute("type", "application/atom+xml")); //Set "type" attribute of the link

feedLink.setHref(new Attribute("href", FeedHref)); //Set "href" attribute of the link

theFeed.addLink(feedLink); //Add the link

  • Set Updated to the entry

theFeed.setUpdated(new Updated(new Date()));

2. Add an entry document to the feed

  • New an Entry

parcelEntry = new Entry();

  • Add Author

parcelEntry.addAuthor(new Author("Yu(Carol) Deng"));

  • Add Title

Title parcelTitle = new Title("text"); // Set title type for the feed

parcelTitle.setText("SensorName, TimeStamp, DoubleData"); // Set title content

parcelEntry.setTitle(parcelTitle); // Set the title

  • Set a universally unique Id for the entry

parcelEntry.setId(new Id("urn:uuid:" + new UID().toString()));

  • Set Updated to the entry

Calendar cal = new GregorianCalendar();

parcelEntry.setUpdated(new Updated(cal.getTime()));

  • Set the current data to the Content

parcelEntry.setContent(nodeSensorName + nodeTimeStamp + nodeDoubleData);

  • Add the Entry to the feed

currentFeed.addEntry(parcelEntry);

3. Atom Feed for Bay1Temp

?>
- <feed xmlns="http://www.w3.org/2005/Atom">
<id>urn:uuid:-7012692:11296d2cefc:-8000id>
<updated>2007-05-17T01:15:29.205-05:00updated>
<title type="text">Bay1Temp Atom Feedtitle>
- <author>
<name>Yu(Carol) Dengname>
author>
<link rel="self" type="application/atom+xml" href="http://hagar.cs.indiana.edu:8181/foo.xml" />
- <entry>
<id>urn:uuid:-7012692:11296d2cefc:-7fffid>
<updated>2007-05-16T17:37:17.66-05:00updated>
<title type="text">SensorName, TimeStamp, DoubleDatatitle>
- <author>
<name>Yu(Carol) Dengname>
author>
<content type="html">Bay1Temp 2007-05-17 05:14:48Z 25.5
Bay1Temp 2007-05-17 05:15:08Z 25.5
Bay1Temp 2007-05-17 05:15:28Z 25.5
content>
entry>
feed>

4. Bay1Temp Atom Feed in iGoogle

Add the url of Bay1Temp Atom Feed to iGoogle, the screen shot below shows the Atom Feed in iGoogle.

Discussion & Questions

1. In iGoogle, it shows 3 links for Bay1Temp in the feed area

-- I tried to clean some cookies or cache, but they are still there.

2. In iGoogle, after refreshing the current webpage, click the content of feed which had content, is not available for the data.

-- I kept clicking the "+" button in the feed area, data is still not available.

Future work

1. Get all sensors from a lab going to individual feeds;

2. The issues described in Discussion section