BETA Lanbahn program (nodejs) for controlling SPROG IIv3 or SPROG 3, using UDP commands for LOCO control (model railroad).
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This is BETA software currently!

Lanbahn software for controlling Locos with SPROG

- see


1) copy all files in a directory
2) install nodejs 
      ( for example installation on raspberryPI:  
        sudo dpkg -i node_latest_armhf.deb   )
3) install the node modules "dateformat" and "serialport"
      ( for example installation on raspberryPI: 
        sudo npm install dateformat serialport  )
4) change settings (sprog serial port) in sprogDevice.js
5) start program with: node lanbahn2sprog.js


1) SPROG, see
2) a throttle to send the lanbahn UDP commands
(like LanbahnThrottle for Android, see

How it works

After starting the software with "node lanbahn2sprog.js" a UDP multicast client is listening to UDP messages on the LANBAHN port 27027 and LANBAHN multicast group. When the client receives a "LOCO" message with a valid loco address and valid data like "LOCO 211 50 1 1 0 0 0 0" (=Loco address 211, speed 50, forward, F0 on, other functions off), the program will start generating DCC packets and send them to SPROG via USB .

Understands only "LOCO" and "POWER" commands so far and only sends DCC packets with 128 speed steps and Functions F0 ... F12.

Notes for pi-SPROG-one:

The baudrate has changed to 115200 (defined in sprogDevice.js)

the serialport is now /dev/ttyS0

if using the RaspberryPi 3, carefully read the notes in the manual (i.e. disable bluebooth)