Hi Dave,
Am 02.11.2014 05:27, schrieb Dave Barndt:
> Hi,
>
> First off, let me say that after reading through the various sites'
> docs, WAMP, Autobahn, and Crossbar all seem terrific. I am excited about
> the possibility of using them!
Great! Also good to hear that you are not confused by this stuff
spreading over some sites;) Seems this can be somewhat frustrating for
users .. but we want e.g. WAMP be a "neutral" place (not tied to
Autobahn or Crossbar.io).
>
> I'm writing because I would very much appreciate a little guidance with
> understanding what my implementation options are given my project's
> requirements. I apologize in advance for my ignorance or gaps in my
> understanding. There's so much to try to wrap my head around!
Nothing to excuse for! Don't hesitate to ask any amount of Qs ..
>
> So here's my project in a nutshell. I have some number of identical
> embedded devices on a network. There will be some backend system that
> they all connect to (and they also may potentially connect to each
> other, if it makes sense). Each embedded device will serve a local
> "console" website (HTML/JS/static files), but for "serving" dynamic data
Why does each and every device serve static content? Just trying to
understand your goals ..
> for the website, and in fact "serving" any data from the device in
> general (ex. to a browser, or to the backend system), I would like to
> use Websockets. Additionally, I'm hoping users will be able to create
> their own clients to interact with the device. I would also like the
If your devices expose their functionality via WAMP, then users will be
able to talk to devices using any WAMP support language .. which is a
growing list that already contains many popular ones.
> embedded devices to be able to "register" on the network when they come
> online (ex. perhaps they could potentially have a config setting
> pointing to the (backend) system to register with).
Yep, they could have a local config with minimum:
- WAMP router URL ("wss://...")
- WAMP realm ("realm1")
plus possibly authentication information.
>
> Anyway, with that quick description, here are a few questions I have:
>
> 1) I think I want to at least put Autobahn/Python on each embedded
> device. Would it be able to serve (the same data to) both WAMP-enabled
> clients and simple "vanilla" Websocket clients?
Using AutobahnPython, you can create a server that listens on 1 port,
but serves both vanilla WebSocket as well as WAMP .. on that 1 port.
In fact, you can have even more stuff being served on that port.
E.g. server2.py here:
https://github.com/tavendo/AutobahnPython/tree/master/examples/twisted/websocket/multiproto
Crossbar.io uses this technique to serve a whole bunch of services:
http://crossbar.io/docs/Web-Transports-and-Services/
> 2) I assume my own browser client (for the local website) should be
> WAMP-enabled (via Autobahn/JS)?
Yep, if you want to speak WAMP from the browser, AutobahnJS is your
first stop.
There is a 2nd JS WAMP implementation for browsers: wampy.js
http://wamp.ws/implementations/#libraries
which you can also use. They have a comparison table with AutobahnJS.
> 3) Does it make any sense at all to put a router like Crossbar on each
> device? If so, the same question from 1) applies. Or does it make more
> sense to have the router on the backend system?
I'd start simple, and have a WAMP router on the backend system where all
devices connect to.
If using Python, you only need AutobahnPython. If you use Python 3.4+
with asyncio (incl. with Python 3), you get away with very little
installation.
Reasons to have a router on a device:
- even the locally running app parts are build as WAMP components to
talk to each other (on the device).
- the device is some kind of gateway (with both LAN and WAN ports) and
local WAMP traffic should be routed locally
Please note that scenarios like the latter, where a WAMP component
connects to a (local) router, and that router in turn connects to an
upstream router to essentially form a router network is a feature we not
yet have in Crossbar.io - needs router-to-router connections.
> 4) I'm thinking when a device 'registers" on the network, it would
> register the RPCs and channels it wants to offer with the router. Is it
> possible somehow to query to get a digest/directory of all RPCs
> registered with a Dealer? Same question for all channels available to
> be subscribed to?
Listing and reflecting upon registered procedures, as well as listing
subscribers: this is being defined in WAMP "Advanced PRofile". Not yet
finalized in the spec, and only partially implemented (and undocumented)
in Crossbar.io
Same for reflecting on "all topic available to subscribe to".
Note my different use of "listing" and "reflecting".
E.g. Crossbar.io implements the approach described at the end of
https://github.com/tavendo/WAMP/issues/61
You can "wamp.reflection.describe" on both a procedure or topic which
you have previously stored info for via "wamp.reflection.declare".
>
> I hope I haven't written too much for one topic/question, but any
> answers you can give will save me hours or even days of trial and error
> as I continue to learn. Thank you again for a great set of tools to
> help move the "IoT" forward!
Cool! Welcome to the WAMP ecosystem!
Cheers,
/Tobias
>
> Dave B.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Autobahn" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
autobahnws+...@googlegroups.com
> <mailto:
autobahnws+...@googlegroups.com>.
> To post to this group, send email to
autob...@googlegroups.com
> <mailto:
autob...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/autobahnws/36e160fd-c05b-4203-a1f9-3aea554e8453%40googlegroups.com
> <
https://groups.google.com/d/msgid/autobahnws/36e160fd-c05b-4203-a1f9-3aea554e8453%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit
https://groups.google.com/d/optout.