User Tools

Site Tools


ESP8266 Rocnet Nodes

RocClient Experiments
Rocrail Client experiments using the Wemos Oled Battery board.img_2164.jpg

Hardware for RocClient (Tool and Throttle)

To start, download the code for the RocClientTool RocClientthrottle
You will also need a "WeMos ESP8266 Battery OLED Board", and a battery for it, plus a KY-040 rotary encoder if you want to try the rotary encoder version.

I would recommend first checking that your rotary encoder is OPEN CIRCUIT on both encoder switches when in a "detent" position. This is important as one switch will be across the Serial in line and can prevent programming if it is "naturally" closed at rest.

In the Arduino sketch "secrets.h" you will need to add your router, name and password, plus the location of your MQTT broker. \\(Your rocrail setup will need these also included in the rocrail properties, "service" / "MQTT service" boxes. The MQTT Port should be set to 1883.

Program the Wemos board and it should log in, locate the Rocrail service MQTT broker and then ask you to "press" to update the list of switches available.

There is a video here that shows the operation.

Since doing the video I have corrected the bug that increments the number of switches found, and have added the ability to use a rotary switch to duplicate the "up/down" setting of the 5 way switch. The rotary switch is a more intuitive interface, but does need a box.
Connections for the rotary switch are simple, but use one of the serial interfaces, so make sure that in its "detent" position, the switches are OPEN. otherwise you will not be able to program the board with the switch fitted.
(Both my examples were ok, but it may be that others are not, in which case the rotary switch will need to be disconneced before the unit can be programmed).

Also, do not leave the board connected to the pc when you move the rotary switch. \\As it shorts one of the serial interface contacts, it can cause the PC to switch off a com port thinking there is a problem.– you have been warned, this design is experimental!).

I have designed a couple of simple boxes you can 3D print and use.
The contacts for the rotary switch (D4, D9 and Gnd) can be seen in the photo below.


users/dagnall53/rocclienthardware.txt · Last modified: 2018/11/12 08:56 (external edit)