Generic Communication Structure for Particle

In this page, we describe how to use our generic communication structure using peer-to-peer (P2P) technology. It allows users to discover and access widely distributed Particles from various types of client entities in remote networks, such as PC, PDA, cellular and even other Particles. The following describes system components and functionalities of the system.

System Components:
JXTA Related Components:
System Functionalities:
Environment

P2PBridge for Particle

You can download the source code with/without compiled classes. If you want to start quickly, it is recommended to download with the compiled classes. The source code consists of source code for P2PBridge, JXTA JAVA J2SE 2.3.2 libraries and  Equip4j Components for Particles.
  1. You need following environment to get start.
  1. Download "Source code with compiled classes".
  2. Extract the archive wherever you want.
  3. Go to "[Installed Directory]/Equator/equip4j/infrastructure/install".
  4. Execute "runEquipDataSpace.bat" to run Equip server.
  5. Execute "runExporterGUI.bat" to export all components to the server (A warning message for Bluetooth related component might be shown, but you can ignore it).
  6. Execute "runComponentBrowser.bat" to run component browser.
  7. Create one instance of P2PBridge component and two instance of ParticleFactory component as the following screen shot. Please refer this page to know how to use EQUIP Component Browser.
CreateComponentDone
  1. After creating the ParticleP2PBridge, the following window is appeared to configure JXTA related parameters (only at first time). In basic settings, input proper peer name and its password as you like (ex. "P2PBridge").
JxtaConfig
  1. In advanced settings, select trace level. "fatal" shows only critical errors (Recommended). Other settings should be as default.
JxtaConfig2
  1. In Rendezvous/Relay settings, select "Use a relay" if your PC is connected behind a firewall (Recommended).
JxtaConfig3
  1. Press "OK" to start ParticleP2PBridge.
  2. One ParticleFactory (upper) is used for listening/sending UDP broadcast packet from/to XBridges. Therefore, confirm that the listenport is configured as "5555" and sendport is configured as "5556" as default. Another ParticleFactory (lower) is used for listening/sending UDP broadcast packet from/to Particle dedicated applications, such as Particle Analyzer. Therefore, set the listenport as "5556" and the sendport as "5555". If you do not need to receive/send UDP broadcast packet for the Particle dedicated applications, the latter configuration can be ignored.
setParameterDone
  1. Create link between ParticleP2PBridge and two ParticleFactories as follows.
setLinkDone
  1. Start both ParticleFactories by setting "true" in startflag. Status becomes "OK", when ParticleFactory becomes to work.
getStart
    1. Confirm that "Java2 JDK 1.4.2" is properly installed to your PC.
    2. Confirm that "ANT" is properly installed to your PC.
    3. Download source file with/without compiled classes.
    4. Extract files to wherever you want.
    5. Go to " [extract directory]/Equator/equip4j/infrastructure".
    6. If you download with compiled classes, perform "ant clean" beforehand.
    7. Perform "ant" to build.
    8. "install" directory is created and it holds all runtime batch files and classes.
This software is based on Equip4j Components for Particles.

ParticleBrowser for J2ME

You can download the source code with/without compiled classes. If you want to start quickly, it is recommended to download with the compiled classes. The source code consists of source code of ParticleBrowser and modified me4se.
  1. Please confirm that "Java2 JDK 1.4.2" is properly installed to your PC.
  2. Please confirm that "Wireless Toolkit 2.2" is properly installed to your PC.
  3. Please confirm that "ProGuard" is properly installed to your PC.
  4. Please confirm that "ANT" is properly installed to your PC.
  5. Download source file with/without compiled classes.
  6. Extract files to wherever you want.
  7. Go to " [extract directory]/particle-jxme/".
  8. Modify "ecliseme-build.properties" according to your environment. Use \\ as a separator of directory.
  1. Perform "ant" to build.
  2. "deployed" directory is created and it holds compiled jar file. A jad file for ParticleBrowser is copied to the directory.
33#"\Programme\J9\PPRO10\bin\j9.exe" "-jcl:ppro10" "-cp" "/My Documents/Java/lib/me4se.jar;/My Documents/Java/particle-jxme.jar" org.me4se.MIDletRunner -jad "My Documents/Java/particle-jxme.jad"

It is possible to run ParticleBrowser on PC by executing runParticleBrowser.bat in <extract directory of ParticleBrowser>/particle-jxme/
Proxy for JXME is necessary for ParcileBrowser to participate with JXTA P2P substrate. It  is originally included in JXTA source code repository (See JXME page in detail). For easy set up, we  include minimal set of compiled classes and batch files in ParticleBrowser archive.
  1. On your PC (It is recommended using another PC to run Proxy than using same PC on which ParticleP2PBridge is running), execute <extract directory of ParticleBrowser>/particle-jxme/rendezvous/runRundezvous.bat to start Proxy.
  2. After executing the batch file, JXTA configuration screen is appeared as described above (only at first time).
  3. In Basic setting, input proper a peer name and password as you like (ex. "Proxy") as mentioned above.
  4. In advanced settings, it requires to check "Act as a JXME proxy" and "Enable Incoming Connections" for HTTP settings. Trace level is recommended to choose as "fatal" to reduce unnecessary logging messages.
ProxyConfig
  1. In Rendezvous/Relays setting, it is recommended to choose "use Relay" as mentioned above.
  2. Press "OK" to start Proxy.
JXME applications has several limitation compared with normal JXTA application. In particularly, it can only use "Name" attribute to discover advertisement of Particles. To cope with this limitation, ParticleP2PBridge makes several peerGroup to categorize advertisements according to their attributes. Therefore, JXME application can discover desired advertisement by joining corresponding group. For instance, if a JXME application wants to discover Particles with LocationID=A, the application discovers a group that represents LocationID of A and then joins the group and performs discovery in the group. In current implementation, ParticleP2PBrige makes following groups.
groupStructure
The next figure illustrates a diagram of ParticleBrowser.
Diagram
The following process describes how to discover the groups and Paritcles and access discovered Particle.
  1. Execute ParticleP2PBridges and Proxy, and check IP address of the Proxy.
  2. On PDA, perform ping to the IP address by NetTools to confirm the reachability to Proxy.
  3. Start ParticleBrowser by clicking the shortcut icon on PDA.
  4. Confirm that the IP address in "Relay host" is correctly configured and then press "OK" button.
ParticleBrowserConfig
  1. Press "Connect" button to connect Proxy.
ConnectProxy
  1. When the application success to connect Proxy, it automatically joins with "netPeerGroup", which is the default group of JXTA. Then, press "Menu" to open menu.
netPeerGroup
  1. In this menu, select "Group List" to discover the dedicated group of this system, called "ParitlceLocationGroup".
MainMenu
  1. Press "Menu" to open group list menu.
groupList
  1. Select "Search" to discover "ParitlceLocationGroup".
groupListMenu
  1. Press "OK" to perform group discovery, now.
GroupSearch
  1. If "ParticleLocationGroup" is discovered, it appears on the screen. Press "Join" button to join with the group.
ParticleLocationGroupFound
  1. This screen represents that the application now joins with "ParticleLocationGroup". Press "Menu" to perform further group discovery.
ParticleLocationGroupJoin
  1. Select "Group List".
ParticleLocationGroupMenu
  1. Press "Menu".
ParticleLocationGroupList
  1. Select "Search".
ParticleLocationGroupSearch
  1. When subsidiary groups are discovered, they appear on the screen. Select "ParticleGroup" for example and press "Join" to join the group.
ParticleGroupFound
  1. This screen shows that the application now joins with "ParticleGroup" that holds  advertisements of all Particles in JXTA P2P substrate. Press "Menu" to discover Particles in this group.
particleGroupJoin
  1. Select "ParticleList".
particleList
  1. This screen will show discovered Particle list in "ParticleGroup". Press "Menu".
particleList2
  1. Select "Search".
ParticleLocationGroupSearch
  1. Press "OK" to perform discovery.
particleSearch
  1. Discovered Particles are listed on the screen. Choose appropriate Particle and press "Select".
particleFound
  1. Press "Connect" to perform Remote Access to the selected Particle.
particleSelected
  1. When the connection is establishmed, all data from the selected Particle are forwarded from the corresponding ParticleP2PBridge to this application via Proxy. If you want to stop receiving the data, press "Menu".
particleConnected
  1. Select "Disconnect" to stop receiving data. In addition, you can try to access other Particles by selecting "Partice List" in this menu.
particleDisconnected
We modified me4se/src/javax/microedition/midlet/ApplicationManager.java to adjust the screen height of Windows PocketPC.@
In line 482:
//screenHeight = dim.height - 25;
screenHeight = dim.height - 51;

Some defects still exist as follows.

P2PBridgeWrapper

It is a wrapper program binds ParticleP2PBridge and ParticleFactory components directly to perform P2PBridge without Equip framework. Currently, Inter Sensor Network Communication is disabled, which means it does not transmit packets arrived from other P2PBridges to the local network.
The program is contained in the package of P2PBridge.
If you download the source code only package, you need to complie it. Go to "[Installed Directory]/P2PBridgeWrapper" and execute "compileP2PBridge.bat". It requires compiled binaries of Equiator to build.
Go to "[Installed Directory]/P2PBridgeWrapper" and execute "runP2PBridge.bat".

Appendix

If a ClPacket is sent from Particle dedicated applications, ParticleP2PBridge try to discover XBridge that has the Location ID of the ClPacket and forward the ClPacket to it. In particularly, if Location ID has all zero value, it means broadcast to all XBrige, ParticleP2PBrige forwards the ClPacket to all XBridge that has been discovered in P2P substrate.
On the other hand, Location ID of a ClPacket sent from Particle represents source XBrige of the ClPacket, not destination.
In addition to the Location ID, we apply following existing ACL tuples as destination identifier. ParticleP2PBridge try to discover Particles and Particle dedicated applicatins of the Particle ID that the ACL tuple holds. If the Paritcle ID has all one value (255.255.255.255.255.255.255.255), it means broadcast to all Particles, not to Particle dedicated applications.
For more generic purpose, following ACL tuples should be newly defined.