Title: sox_tools Summary: sox_tools Date: 2010-03-17 12:35 Category: middlewaresensing Tags: pubsub, sensor data, sensors over xmpp, sox tools

I adapted our command line tools into a single tool, sox_tools (sensor over XMPP tools).

Download (libs and libraries)

Download (source) NOTE compile loudmouth with openSSL instead of gnuTLS, gnuTLS is hanging in block reply

In your home you must create the configuration file .sox_tools.cfg also you can add more than one user

#################### CONFIG #############
[XMPP]
PORT=5223
HOST=genbox
PUBSUB_SERVER_NAME=pubsub.genbox

[DEFAULT_USER]
JID=username@genbox
PASSWORD=userpassword

[sapo]
JID=sapo@genbox
PASSWORD=sapo123
#################### USAGE ######################

Available commands:
    –user           Select user from config

    listen          Listens for pubsub events
    publish         Publish to a pubsub node
    last_item       Get last item from a pubsub node

    create          Creates a pubsub node
    subscribe       Subscribe to a pubsub node
    unsubscribe     Unsubscribe from a pubsub node

    add_member      Add a member to a pubsub node

    subscriptions   List pubsub subscriptions
    affiliations    Lists pubsub affiliations

    delete          Deletes a pubsub node
############### EXAMPLES ########################

# creating a event node with open access model
sox_tools create test-node open

# subscribe to event node
sox_tools subscribe test-node

# subscribe to event node using other user sapo
sox_tools –user sapo subscribe test-node

# deleting a event node
sox_tools delete test-node

# retrieve user subsciptions
sox_tools subscriptions

# retrieve user affiliations
sox_tools affiliations

# unsubscribe from event node
sox_tools unsubscribe test-node oozGM08Gz7G12W4PYi91o5ENEM53RH3GNEy0J64k

# publish sensor data
sox_tools publish laptop 3 55

# request last item published on a event node
sox_tools –user datarecorder last_item laptop
# output ########################################
Initialized XMPP connection  
Last item published on node 'laptop'

<item id="SQjQugKl5wOW79X">
    <System>
        <DeviceInstallation id="-1" regid="-1" type="" description="" timestamp="2010-03-17T12:27:35">
            <TransducerInstallation name="" id="-1" regid="-1" canActuate="false">
                <TransducerValue typedValue="55" rawValue="" timestamp="2010-03-17T12:27:35" variableId="3">
                </TransducerValue>
            </TransducerInstallation>
        </DeviceInstallation>
    </System>
</item>
#################################################