Processing XMPP Library


TAK-Server is based on XMPP protocoll so the easeast way to get started with Processing is to use jabberlib, a XMPP library for Processing.

Installation


Install Processing and the libraries OSCP5 and jabberlib. Your folder structure must be like that:

Processing
      your sketch folders
            libraries
                 jabberlib
                       examples
                       library
                             jabberlib.jar
                             smack.jar  
                             smackx-debug.jar  
                             smackx.jar
                       reference
                       src
                 oscP5
                       examples
                       library
                             oscP5.jar
                       reference
                       src

You can find a in deep description for installing Processing libraries here.

Hello World


Processing can be used as a bridge from TAK-Server to whatever software you are running. Communication between TAK-Server and Processing runs on XMPP and we use OpenSoundControl (OSC) for connecting to other clients like SuperCollider.

A basic example for getting startet is jabberlibTIK2OSC. You have to adapt the following values to make it running on your machine:

myRemoteLocation = new NetAddress("127.0.0.1",12001);

The first parameter indicates the computer where your OSC client is running, “127.0.0.1” means that you communicate to your own computer (=localhost). The second number indicates the port number so make sure you use the same number in your OSC client.

jabber.login("tester@walls.okno.be","tester");

These is your login for the OKNO XMPP server running at port 5222 at walls.okno.be. For test purposes you can use the tester account but it's recommened to create your own account by using any Instant Messanger (IM) like Adium, Psi or Pidgin. In one of those programs, make a new account, of type XMPP/Jabber and register to walls.okno.be.

Press the play button to launch the sketch, if all goes right, you'll see an empty black window and white text flowing in the console. Now you can start your OSC client and connect to the TAK-Server through Processing.

Debug


To enable debugging of traffic between your client and the XMPP server the library includes smacks-debug.jar. To debug your example, export your sketch as Application and change the last line of the startup script to something like that:

java -Djava.library.path="$APPDIR" -cp "$APPDIR/lib/jabberlibTIK2OSC.jar:$APPDIR/lib/core.jar" -Dsmack.debugEnabled=true jabberlibTIK2OSC

This will give you a nice interface and show the XML messages you're sending and receiving.

Further Information


A custom version of this Processing app for Sound Clients is described here: sound:teknix

 
windclocks/jabberlib.txt · Last modified: 2011/04/18 17:24 by geraldo
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki