User Tools

Site Tools


Setting up a WiRocS node using Rocrail Rocnet Programming

Go to Rocrail and select "Programming / Rocnet / Setup" and then press “Query”. This will bring up a page that shows all the nodes connected to the MQTT broker. (Note this does not update actively so may show nodes that are currently off or not powered up).

If you press "Show", the built-in LED on the highlighted node will flash to help identify / find the node. (As shown here, Node "Shed1" / ID 10" will flash)

The decoder we were looking at via the Arduino Serial monitor is ID 28, and has the nickname “NoDAC”. The Roc Node address was set initially from the defaults in the EEprom. From V12, this sets the Node to ID 50 as default, you should immediately set the Node Address to something else via the Rocrail “Rocnet” ID interface, and also the node “nickname or “UID-Name” as Rocrail calls it. You cannot have more than one Node switched on with the same Rocnet ID, or bad things will happen. The "Shed1" and Swing" nodes have been set in this example with RocID's of 10 and 12, but their WiFi sub ip's are 19 and 20.

If we now highlight node ID 28, and Click “Pi02 Port Setup”, it will show us how the various ports are set up:

Port 6 is an input, but all others are outputs. If any of the Pi02 ports were set with “Blink”, they will blink/flash with a delay set by the Delay setting. “Invert” would invert the port phase. Note Rocrail does not know that some ports are “FIXED”, but if you try to modify them they will revert to their “FIXED” settings.

Pressing “Pi03 Channel Setup” shows further information about our 8 io pins:

Here we see that Pin 1 and 8 are defined as a servos.. Pin 1 is actually the “FIXED” Motor drive servo, and is a special case where Left Right, Left steps Right steps etc are defined by CV values so these values cannot be changed here. Pin 5 has Blink set, so will be a PWM output, switching between the Left and Right PWM settings of 160 and 600. Pin 8 is a “normal” Servo output and will switch between positions 236 and 457. Note that in Rocrail, Min and Max positions for a servo are 150 and 600.


Because this example is a “loco” at address 7 we can look at the throttle: I have set this one in the Rocrail “Locomotives table” with some default sound effect names.

Clicking on “programming” will open the CV programming interface. To make this work, you need to select “POM” and the loco to be programmed in the top left box, and Rocrail will interrogate the set loco address and get the main CV settings:


Programming the ESP 32 is almost identical to the ESP8266, except that there are 16 Io potentially available. Not all are fully selectable for all functionality, and there are some limitations on how these ports can be used, but the code should limit any attempts to set the nodes to unavailable functionalites. See ESP32

users/dagnall53/setting_up_wirocs_using_rocview.txt · Last modified: 2019/03/17 19:34 by dagnall53