Roomware HTTPD Communicator (XML, JSON, CSV)

27 views
Skip to first unread message

Sexybiggetje

unread,
Jul 24, 2009, 11:01:39 AM7/24/09
to The Roomware Project
Hi folks,

I just uploaded the source files for my HTTPD Communicator. It's
basically the httpxml communicator with handlers for different
protocols.
At the moment I implemented JSON (with mime text/plain as json-plain
and mime application/json as json), XML (using the code from httpxml)
and CSV (just for showing you can implement a format in a few
seconds).

If you configured the roomware server according to the config file in
the archive, you should be able to access:

http://localhost:4040/json
http://localhost:4040/json-plain
http://localhost:4040/xml
http://localhost:4040/csv

The reason for implementing it this way, is because JSON causes less
overhead and is easy to parse in AJAX applications. Having the code
for the webservice twice would be plain ugly.

Quick steps to build:

1) Follow the steps in the wiki to build roomware from source.
2) Extract the communicator (the folder structure is already inside
the tgz)
3) Adjust your config to match with the provided config (similar
config to httpxml, just different namespace)
4) Adjust your build.xml to include the new target "httpd". (just copy/
paste)
5) ant, ant install, bin/run

The current namespace is set to a personal namespace,
nl.sexybiggetje.roomware.*, because i don't have write access to make
it an "official" module. Changing the namespace is quickly done by me
or one of the current developers.

See attachment: httpd-communicator.tgz

Tijs Teulings

unread,
Jul 24, 2009, 12:32:21 PM7/24/09
to room...@googlegroups.com
Hi sexybiggetje(!),

Could you submit your code as an issue to http://code.google.com/p/roomware/ ? You can just mark it as a code review. After Tom has a look perhaps it would be a good idea to give you commit rights if you want, then we can make it part of the main branch and add it to the download package. JSON support is definitely a welcome addition!

Best,
Tijs
--
Tijs Teulings
Automatique
tel: +31645004824
http://www.automatique.nl
kvk: 34229089

more: http://tijs.org

Sexybiggetje

unread,
Jul 24, 2009, 12:54:48 PM7/24/09
to The Roomware Project
Added as issue 10.

Im not really 100% familiar with Java, but I think this modification
doesn't contain much hacks or workarounds.
Next step is trying to create an adaptor for Mir:ror devices by
Violet :).

On 24 jul, 18:32, Tijs Teulings <tteuli...@gmail.com> wrote:
> Hi sexybiggetje(!),
> Could you submit your code as an issue tohttp://code.google.com/p/roomware/?You can just mark it as a code
> review. After Tom has a look perhaps it
> would be a good idea to give you commit rights if you want, then we can make
> it part of the main branch and add it to the download package. JSON support
> is definitely a welcome addition!
>
> Best,
> Tijs
>
> tel: +31645004824http://www.automatique.nl

Tijs Teulings

unread,
Jul 24, 2009, 3:20:23 PM7/24/09
to room...@googlegroups.com

On Fri, Jul 24, 2009 at 6:54 PM, Sexybiggetje <sexybi...@gmail.com> wrote:

Added as issue 10.

cool thanks
 

Im not really 100% familiar with Java, but I think this modification
doesn't contain much hacks or workarounds.
Next step is trying to create an adaptor for Mir:ror devices by
Violet :).

that's basically an rfid reader right? might work already with the rfid module...

Sexybiggetje

unread,
Jul 24, 2009, 4:37:00 PM7/24/09
to The Roomware Project
Well, im having the following problem with it: it's usb. The only java
usb implementation I could find was javax.usb, which only works on
Linux. I'm running mac.
Im not sure what the other rfid readers use to connect, perhaps I
could look into that. However each usb device implements its own
protocol, usb is a carrier specification, not really a protocol
specification. In the case of mir:ror, its pretty easy to parse tho.
I was maybe thinking of a helper application, but to use that on my
system (OS X), it can be best written in Objective-C using Apple's
IOKit. Thats where multiplatformness sinks.

So I got this other idea going on. Discovery of Bonjour/Zeroconf
devices. Using Apple's implementation (com.apple.dnssd), roomware
could support this on Windows and on Mac. Almost any device does
service announcements (SMB shares, AFP shares, Printer announcements,
etc..).

I'd be more happy getting my mir:ror to work, because I have some
ideas for that, but the second is a nice alternative that could be
usable to someone.

On 24 jul, 21:20, Tijs Teulings <tteuli...@gmail.com> wrote:

Tijs Teulings

unread,
Jul 25, 2009, 4:06:36 AM7/25/09
to room...@googlegroups.com
We currently do the RFID by basically using the Roomware server as an easy to use bridge between whatever's reading the USB output for your reader to the web (or localhost). For instance for my touchatag reader (an acr122 type reader) i use the software (written in C) that was released by mediamatic for their RFID workshops:


Of course thats a bit messy and at some point we would want to integrate the functionality of the C code into modules for each of the classes of readers. If you could help there that would be awesome of course.

As far as zeroconf/bonjour is concerned that is certainly an idea we've been thinking about. I think Tom might have even started working on that already but he can comment on that better. 

Tijs

Sexybiggetje

unread,
Jul 25, 2009, 6:43:35 AM7/25/09
to The Roomware Project
The problem with mir:ror is that its not open software, and the client
communicates with their server. Everything is basically done
serverside, so response is laggy.
There is a project on sourceforge which tries to do everything
"mirware" does on the client, however this software isn't compilable.
Perhaps getting in touch with the author of that piece could clear
things up though. Otherwise I could ofcourse just write an usb helper,
which you launch in the background for the appropiate device.

On Jul 25, 10:06 am, Tijs Teulings <tteuli...@gmail.com> wrote:
> We currently do the RFID by basically using the Roomware server as an easy
> to use bridge between whatever's reading the USB output for your reader to
> the web (or localhost). For instance for my touchatag reader (an acr122 type
> reader) i use the software (written in C) that was released by mediamatic
> for their RFID workshops:http://www.mediamatic.net/page/52471/en
>
> Of course thats a bit messy and at some point we would want to integrate the
> functionality of the C code into modules for each of the classes of readers.
> If you could help there that would be awesome of course.
>
> As far as zeroconf/bonjour is concerned that is certainly an idea we've been
> thinking about. I think Tom might have even started working on that already
> but he can comment on that better.
>
> Tijs
>

Tijs Teulings

unread,
Jul 25, 2009, 6:54:47 AM7/25/09
to room...@googlegroups.com
ah ok, for the touchatag you only need the offical client if you want to use their widget structure. I guess the mir:ror does fancier stuff using the server.

Gert-Jan de Boer

unread,
Jul 25, 2009, 7:00:42 AM7/25/09
to The Roomware Project
Can't you just use wireshark to debug the mir:ror?

Then you just put the hostname of the mir:ror server to localhost in
the hostfile.

It's an bit of an hack, but it should redirect traffic directed @
mir:ror server to your local box.

On 25 jul, 12:54, Tijs Teulings <tteuli...@gmail.com> wrote:
> ah ok, for the touchatag you only need the offical client if you want to use
> their widget structure. I guess the mir:ror does fancier stuff using the
> server.
>

Sexybiggetje

unread,
Jul 25, 2009, 7:09:15 AM7/25/09
to The Roomware Project
Thats a big hack lol. But still, the software is a bit of a burden on
your system and it would still sit inbetween the process. For instance
it announces if a tag was discovered or failed to lookup with text to
speech. You would need to mute your sound then (which makes your MPD
Controller pretty nonfunctional :P).

Nice idea, not going to happen :D.

A helper app could work in C++ or Objective-C. But the reason java
doesn't do usb much is that every platform uses a completely different
API to access the devices. On linux you could use /proc, on mac you
need IOKit on Windows you need to call a driver for the usb device or
find some generic service (which isn't there by default) to
communicate with the device.
There are C++ libraries that do this, but no java libraries for this.
Reply all
Reply to author
Forward
0 new messages