Xbee Network Programmer

The Xbee Programmer allows you to program your Protothrottle Receivers. These are based on the Raspberry Pi with a USB connection to an Xbee. The Rpi is configured as a standalone wifi access point with it’s own web server. Use your computer or tablet to connect to the programmer through a browser and from there you can query the xbee network and program all of your Receivers.


Buy Now

Setup and Connecting

The programmer doesn’t really need any setup, just power it up and let it sit while it initializes. Once it’s up and running, connecting to it depends on the device. The Programmer is a web server with a built in Wifi access point, so the basics are the same for all devices. Find the wifi network ‘rpinetwork’ and connect. It will ask you for a password, it is ‘mypassphrase’ without the quotes.

To the left is an image of a Windows 10 machine showing the connection button. Once connected, use a browser such as Netscape or Chrome to connect to the programmer.
This is the URL – http://rpinetwork/

One thing to note with some phones and tablets- when they connect to the programmer they will tell you there is no internet and may attempt to switch you to another wifi network.

This is the main screen. This shows a network with the Protothrottle, a locomotive receiver and the AirwireTranslator. In this instance, I have set the name of the Protothrottle to ‘Protothrottle’. From the factory, the Xbee in the PT does not have a Node ID, so this will be blank with your PT (however, you can set it with this app if you wish)

Note the rpinetwork in the browser URL bar and the big scan button. When you click scan, an Xbee Network Query is sent from the programmer and all Xbees in range will respond. The programmer takes those and populates this screen. You may have to click the scan button more than once and wait a bit of time in between as the Xbees sometimes are a bit slow to get all of the network IDs back to the programmer.

In this image, we have clicked on the Loco 2020 button to ‘zoom’ into the receiver configuration. Here is a description of each of the parameters:

  • Protothrottle ID – The address of the PT, from the factory it is set to ‘A’. Generally you won’t have to change this.
  • Base ID – In the PT world, this is the address of the base station. This needs to match in the PT setting (0 is the default)
  • Loco Address – This is the address of this Locomotive. This is the number you use in the PT. Note that this IS NOT the DCC address when using the PT Receiver. The DCC address of the receiver MUST be the decoder default, which is 3.
  • Consist – There are two parameters here, first is the OFF/REV/FWD button. This controls the direction this locomotive faces in the consist. The next value is the address of the lead locomotive. The lead loco is always set to OFF, and all slaves are set to the lead address. When you enable the consist for the first time you will have to refresh this screen to see the ‘notch table’ button at the bottom.
  • CVProg – these parameters let you send a CV message to the decoder hooked to the receiver. This allows you to tweak values in the decoder without having to use an external sort of DCC programmer.
  • Servo Mode – this is where you can set the servo 0 output for steam, coupler, ESC or PHYSICS mode. In the steam mode, the servo follows the throttle from low to high and servo 1 goes to the low limit or high limit based on the direction bar. In Coupler Mode, servos 1 and 2 assume that they are connected to a front and back coupler and a function code from the PT sets them to the low limit or high limit. In ESC mode, the output of servo 0 follows the throttle and the direction bar for a ‘center off’ ESC. PHYSICS mode is the same as ESC mode, however it allows you to add an acceleration, deceleration and braking value. (see screen below)
  • Servo Parameters – These values let you reverse a servo, set it’s high and low limits and also assign it a function code if you wish.
  • Watch Dog – Enables a Fail-Safe where the locomotive is brought to a stop if communications with the PT is lost. This is for both the DCC and ESC modes. In both modes, there is a deceleration not a hard stop. In the ESC mode, this is about 1 second. In DCC mode, it depends on the deceleration setting in your DCC decoder. The value is in seconds, zero means disabled.
  • OutputX and Y – These control the physical digital outputs on the receiver board. The first number is the function code that will trigger the output. The second value is the ON state. If set to a 1, when the function button is set to ON, the pin on the receiver goes high. If this is a zero, then the pin goes low when the function code is ON. Most relays want a ‘sink’ for the ON (energized) state, so this would be set to zero in that case.

PHYSICS parameters. These affect the ESC output and only if PHYSICS mode is selected. These parameters allow you to use an Electronic Speed Controller and simulate acceleration, deceleration and braking. With the exception of the brake function code, each of the parameters are in milliseconds.

For example, if you have the acceleration set to 40 and move the Protothrottle throttle lever to notch 3, (which is an actual throttle value of 39 out of 128), then every 40 milliseconds the actual output throttle value will increment by one until it reaches 39.

For the braking function, the Brake Function parameter gives the function code that you assign to the the PT brake. In the options menu of the PT, the variable brake must be set to on and the mode set to ‘pulse’ with a value of 0.2s. As you move the brake lever to more brake, the brake value in the receiver increments and that is then applied to the throttle value at the brake rate (in milliseconds) in the opposite direction.

If the consist function is enabled, a button will be displayed at the bottom of the configuration screen above – ‘Notch Table’. This allows you to more closely match notch settings with speeds. The notch values are the throttle values between 0 and 128. They are pre-set to the Protothrottle default values. When a throttle value comes in, it is checked against each notch. If the value is higher than the low setting and lower than the high setting, the receiver will set the dcc throttle value to the output value. By setting the output value you can have your consisted locomotive go slower or faster than the master in order to adjust for variations in makes, motors and different decoders.

The last screen for consisting is the function mask screen. If you won’t want all of your slave locomotives to respond to function codes, for example the bell and horn, you can mask them off here. Each code from zero through fifteen can be enabled or disabled. A checkmark enables, blank disables.

Upgrading the Programmer

Download the image and burn it onto an 32G SSD card. You can get it here