
If you LongPress the select button, the speed will immediately be dropped to 0. Short press of the select switch then changes to Functions control. If you change the speed, Rocrail will change the Loco Speed. The Throttle should pick up any speed changes made by Rocrail. (very) Long press of the select switch toggles the Rocrail power on/off.Ī small display at the bottom of the screen shows how many locos are available. Short press of the select switch then changes to speed control. Up and Down buttons (or the Rotary switch) can be used to select which loco to control. But the ESP ADC are not particularly accurate, and I have seen changes depending on if the device is transmitting, so do not rely on the ADC for anything critical.
Rocrail connect to genli setup serial#
A calibration adjustment sequence has been added to the Serial input used for modifying the WiFi parameters that allows the calibration factors to me adjusted to try and get good accuracy. The Battery monitor needs a resistor voltage divider from battery +v to be added to the boards: For the ESP32 boards, use 220k/68k and use Pin 35 as the analog input. (All connections needed for the OLED, Rotary Switch and 4 way or 5 way switches are listed in the Secrets.h file).

Rocrail connect to genli setup code#
The code also works nicely with the WiFi Bluetooth Battery Esp32 0.96 Inch OLED board, but you will have to add connections to an external rotary switch. Do not blame me, the switch is hardwired to reset!. Pressing "Left" at any time on this hardware will reboot the code. With this board, Press "right" (Away from the OLED) to scroll through the menu levels, Pressing the button "in" is used for the short and long presses. The code is designed by default to use the NodeMCU / Wemos OLED + 18650 battery +4 way switch board. If you have set names for the functions, the throttle will display these names.Ī quick, short press of the select button then moves from Functions back to Select Loco. 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.
