command line options when starting crossbar

44 views
Skip to first unread message

Alan Yorinks

unread,
Mar 17, 2015, 3:05:57 PM3/17/15
to cross...@googlegroups.com
Is it possible to pass in a user command line option when starting crossbar, such as crossbar start MYOPTION and have the ability to read MYOPTION during runtime?
If so, can someone point me to the documentation?

I have an application that communicates with Arduino's over serial. I can hardcode the serial port (/dev/ttyACM0) and that works fine for my configuration, but is there a mechanism whereby a user can provide their specific port designator before starting up crossbar?

Tobias Oberstein

unread,
Mar 17, 2015, 7:24:34 PM3/17/15
to cross...@googlegroups.com
Hi Alan,
Not from environment variables.

What you can do is provide custom configuration to app components
started from Crossbar.io via node configuration

https://github.com/crossbario/crossbarexamples/blob/master/pg/publisher/.crossbar/config.json#L66

This is for Python components (running in a worker of type "router" or
"container"). A similar thing exist for workers of type "guest". In this
case, custom configuration parts are serialized to JSON and provided to
the worker on stdin.

Cheers,
/Tobias

>
> --
> You received this message because you are subscribed to the Google
> Groups "Crossbar" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to crossbario+...@googlegroups.com
> <mailto:crossbario+...@googlegroups.com>.
> To post to this group, send email to cross...@googlegroups.com
> <mailto:cross...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/crossbario/7ce97cfd-53b9-43d4-8b56-c84e289a857c%40googlegroups.com
> <https://groups.google.com/d/msgid/crossbario/7ce97cfd-53b9-43d4-8b56-c84e289a857c%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

Alan Yorinks

unread,
Mar 18, 2015, 9:01:12 AM3/18/15
to cross...@googlegroups.com
Tobias,
   Thanks for the quick answer. What I may need to do in the future is provide a script that will allow the user to enter command line options, and then have the script modify config.json "extras" before starting crossbar. My application is probably outside of the realm of intended use for crossbar, so I apologize for these "weird" questions.

Alan
Reply all
Reply to author
Forward
0 new messages