Direct WIFI controlled Model Railroad Accessory Decoders
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
firmware
hardware
LB2SPARK.md
LICENSE
README.md
lanbahn2spark.js
lanbahnEvents.js
lanbahn_module.js
lb2spark.json
sparkconfig.js

README.md

Lanbahn-Spark

Lanbahn software for controlling model railroad accessory decoders with Spark.io cores

- see http://www.lanbahn.net/spark

lanbahn-sigplus-rev.0.2 lonstoke_west_signal

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 sparks

and, if you want to have a fast response to commands:

  1. 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.