New updates
Services
#datarecorder
– subscribes to event nodes
– store sensor data in database
#actionchecker
– load action plugins
– subscribes to event nodes
– check if has policies
– match policies filters
– launch action
#scheduller
– check for new recordings or new policies
– send subscribe or unsubscribe orders to actionchecker and datarecorder services
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>
_####################################################################################
New Web Interface
I replaced our layout for openfire layout using openfire css.
Web App
Interface
– to simplify forms, i splited in more forms (new location, new category)
– removed buildings and rooms
– removed mixed type of transducers
– adapted flexigrid css to main css
– network node name is the same as network name
– added form to create new node
– define access mode in nodes (open and whitelist. Authorize access mode is not supported by sox lib, for now i will not touch in this part)
– possibility do list user node affiliations
Data
– added support for line, pie, bar and radar charts
– chart configuration panel
– export data as csv or json
Policies
– added policies creation form
DataRecorder Process
SOX LIB
-Added new function “msg_add_property_to_transducerValue” to add the property variable in transducer value.
Example <TransducerValue typedValue=”33″ rawValue=”33″ variableId=”12″ />
-Added support to call a callback function when connection goes down (by default sox lib uses her internal callback function to print the cause of problem and exiting after). As service we want the maximum availability, so this external callback function will reconnect until reaches connection. (start_xmpp_client_with_close_handler)
-Added support for variableId and inserting on database
-Reconnect when XMPP connection drops
-Created a Linux service (for gentoo in this case)
-Added Socket Datagram communication, being possible to send commands to this services, (subscribe and unsubscribe). When this nodes are subscribed and they have variable ID they are recorded in Database.
Socket Message protocols:
#subscribe#node1#node2#node3#….#nodeN
#unsubscribe#node1#node2#node3#….#nodeN
NEXT
– use configuration instead of passing arguments to process at startup
WEB APP
– removed buildings and places ( less is more 🙂 )
– added location for each sensor
– added network connections in Google maps
– added more options to chart configuration panel
Progress
Jernej added his layout to the web application
Added custom Google Maps markers icons
Added group support, adding and removing user/devices
Added variables support in registering sensors
Added rule/action form
Moved charts from controller to view
Added initial configuration panel for charts
Most of the time was spent around the dynamic forms (validation, history,…)
Also converted tables to flexigrid tables and added a icons on tables.
Some screenshots…
Google Maps, JQuery, Json
I have been adding google maps support to the web application, i found it more easy than i thought =).
Google maps integration working features: search and name suggestion, drag marker, click to add marker and display devices on map.
Also using JQuery to load dynamic content, i made the drop down lists (location, building and place) be connected, and also finished the add more functionalities.
JQuery is nice for handling events, load content without refreshing, and much more. JSON short for java script object notation, is a lightweight data format to interchange between applications
New screenshots.
Chart, live data examples
Some screenshots of “open flash charts 2”, using recorded data.
To put this example working:
Arduino with an photosensor, sending data via serial.
Using a modified version o sox_publish, to receive from serial and send to specified settings
Using database client from sox tools, i set to subscribe to luminosity node and record on database.
It works, but the Web application stills lots of work to do, chart options, pagination, and much more.
WEB Agent Base
Here is some screen shots of WebAgent backbone, its ugly i know, needs lots of beautifier stuff.
Implemented use cases so far:
– create account
– login
– add devices
– add transducers
– add groups
– view groups info (basic details, devices and users)
– view device info (basic details and transducers)
– view transducer info (basic details and recordings)
Rapid GUI Form Prototyping
– This prototypes are great for knowing what have to be implemented and useful in programing phase.
– I found this Code Igniter Form Generator, ill take a look 🙂
By the way the program i’m using is Balsamic Mockups online demo.