Lanbahn-Spark
Lanbahn software for controlling model railroad accessory decoders with Spark.io cores
- see http://www.lanbahn.net/spark
|
|
Installation:
1) copy all files in a directory 2) install nodejs 3) install the node modules "dateformat", "request" and "eventsource" 4) change settings (your access_token, your spark-server url) in sparkconfig.js 5) start program with: node lanbahn2spark.js
Pre-Requisites
1) lanbahn hardware with Spark Core (see http://www.lanbahn.net/spark ) 2) Spark Core supplied with your wifi keys (with android SW on spark.io site) 3) "firmware_A121.bin" installed on Spark Core 4) adapt the config file lb2spark.json which defines the mappings between Lanbahn commands and command for the sparksand, if you want to have a fast response to commands:
- a spark-server in your local network (see documentation on http://docs.spark.io/ ) and the keys of this server on your cores.
How it works
After starting the software with "node lanbahn2spark.js" a UDP multicast client is listening to UDP messages on the LANBAHN port 27027 and LANBAHN multicast group. When the client receives a "SET" messages with an address that can be matched to one of the connected spark cores, the spark core will be sent a http request with the appropriate command to change it outputs.