
If the Function is a toggle, like for example "lights", the throttle will toggle between the two states with every "Longpress". If the Function is a momentary function, the Throttle will send a "start", and rocrail will later turn the function off at the time set in the loco function table. A LongPress will then send the function command to Rocrail. Up and down (or rotate the rotary switch) select which function to operate. Moving the rotary switch or selecting up or down buttons will change speed and send this command to RocRail.Ī quick, short press of the select button moves from Speed Control to Functions. A Longpress here will instantly take the selected loco to Speed=0. An indicator in the top left of the screen shows the current RocRail power status.Ī quick, short press of the select button moves from Select Loco to Speed Control. Pressing and holding for longer than two seconds will turn power back ON. LongPress for more than 1 second will turn Power OFF. Whilst on the "Select Loco" menu, you can LONGPress the select button to change the Rocrail Power State. This list only shows locos that are Active and Not hidden in the Rocrail Loco table.

It will then display a screen that allows you to select which loco to control. After this short delay it will connect to the wifi, find the Rocrail MQTt broker, and ask Rocrail for a list of Locos. When the unit is turned on, it waits 3 seconds to allow you to modify its WiFi router settings etc. To do this you need to moodify your PubSubClient.h at or around line 17 or so.to add #define MQTT_MAX_PACKET_SIZE 10000 USE Uses these Arduino Libraries, which must be installed for the program to compile:īecause Rocrail sends unusually long MQTT messages, it is important to increase the size of message that PubSubClient can accept. Tested with Arduino Board = "NodeMCU 1.0 (ESP12E Module)" and Board= '"Wemos" Wifi+Bluetooth' options.


CompilingĬompatible with ESP32 and ESP8266 hardware. Now optimised to use a rotary switch and pushbutton. This method sends each command as a separate MQTT message. Uses the new Rocrail 'lcprops' command to get the Loco list. A WiFi Rocrail Client throttle A Simple throttle for Rocrail.
