Posts Tagged ‘sox tools’

Statuses

sox_tools

In Uncategorized on March 17, 2010 by salvadormrf Tagged: , , ,

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-0317T12:27:35“>
____<TransducerInstallation name=“” id=”-1” regid=”-1” canActuate=”false”>
_____<TransducerValue typedValue=“55” rawValue=”” timestamp=”2010-0317T12:27:35” variableId=”3″>
_____</TransducerValue>
____</TransducerInstallation>
___</DeviceInstallation>
__</System>
_</item>
_####################################################################################