A Tested and Proven Configuration:
- DCC++EX 3.0.6+
- Wemos ATMega2560 + ESP8266 WiFI - *Combo Board
- Deek Robot L298P Standard Motor Shield
- 16Vdc Laptop power supply to the Motor Shield with 14.5Vdc to the tracks for HO Gauge
- 9Vdc power supply to the ATmega boards female 2.1mm power barrel
- Android Smartphone w Engine Driver v2.29.126+
Few Multiple Easy Steps
- Download the ESP Files
- Flash the ESP8266 chip
- Edit & Load the DCC++EX 3.0.6+ to the Mega2560 chip
- Set up Engine Driver Throttle
1) Downloaded the Flash Download Tool 3.8.5 nodencu-flasher & download the ESP8266_NONOS_AT_Bin_v1.7.4 Bin files found here;
2) To Flash with ESP8266_NONOS_AT_Bin_v1.7.4 set the ESP section of the board with the USB unplugged. (no power)
- set dip switches 1,2,3,4,8 off .. 5,6,7 on
- (set TX/RX Slide Pin to RxD3 & TxD3)
- Plugged in Mega+WiFI board to comm port X, press the Mode button,
Run the 3.8.5 Flasher Tool {relax give it time to completely open}
- press [Developer Mode] button
- Press [ESP8266 Download Tool] button
Set up file location in the Tool version 3.8.5
- Pay close attention setting up the Exact *.bin Files & locations 0x......
And then set the Exact radial dial & baud rate settings;
- (26M, 40MHz, DIO, 16Mbit-C1, com: xx, 115200 baud).
First press the Erase button and let the ESP erase the chip memory.
Then press the Start button and the bin files will flash load onto the ESP-WiFi chip
After flashing, the ESP8266 Log will show it uploaded them all successfully and it closes the port.
- You disconnect the USB cable.
3) Set up the Arduino ATmega2560 side of the board with DCC++EX version 3.0.5+
- dip switches 1,2,5,6,7,8 off .. 3,4 on
- (Leave the TX/RX slide Pin on RxD3 TxD3)
- re-connected the USB cable
Download and install DCC++EX from either the Automated exInstaller or the Latest DCC++ EX Release >= 3.0.5
Once you have DCC-EX installed on the Mega you need to Open the CommandStation-EX Folder make a Copy of the config.example.h file and rename the copy to config.h
Decide which Mode of WiFi Communication you wish to run, Either Access Point AP Mode, Or Station STA Mode.
AP mode is Local Intranet, No Internet access. Station Mode is your local WiFi Router With Internet access. Note: See WiFi Configuration for more details.
Setting up in Access Point AP Mode
- No additional changes require, Leave SSID & Passwd alone
- Your ESP-Wifi chip will assign a SSID as DCCEX_xxxxxx and PASS_xxxxxx, Where xxxxxx is the ESP8266 MAC ID number.
Setting up WiFi in Station STA Mode with Router
- Open the CommandStation-EX.ino in the Arduino IDE Interactive Development Editor then
- Edited & change the new config.h file to your local or home Router's SSID & Password.
- #define WIFI_SSID "Your network name" to your "Local SSID"
- #define WIFI_PASSWORD "Your network passwd" to your "Local PW"
Compile and Re-upload DCC-EX to the
- ATMega2560 board (com: xx, baud 115200),
- Verify your com port and baud rate in Windows device manager
After the Arduino IDE uploads DCC-EX 3.0.6 sketch
- Disconnect USB cable
- Reset dip switches 1,2,3,4 on .. 5,6,7,8 off
- (Leave the TX/RX slide Pin on RxD3 TxD3)
Power up the Arduino ATMega2560 + ESP8266 WiFi board by Either a USB cable, Or
Note: {For Standalone Operations (no USB) you can use a 7-12vdc power supply in the Arduino 2.1mm female barrel.}
- When powered on through a USB cable, check the Arduino IDE Tools > Serial Monitor.
- It should show the ATMega2560 & ESP8266 WiFI communicating and assigning a xxx.xxx.x.xxx IP Address and Port 2560 to the new DCC++EX Command Station.
- ++ Wifi Setup CONNECTED ++
4) Set your Smartphone WiFi to the same local SSID & PASSwd you entered into the DCC++EX config.h file
- Start your Smart Phone (Andriod) Engine Driver App Or (Apple iOs) WiTHrottlle App and enter the IP address XXX.XXX.X.XXX assigned in the Arduino Serial Monitor above and Port 2560.
If the Engine driver fails to connect the first time with the Command Station just press the Mega's red Reset button and try the IP/Port connection again.
You should have a direct Throttle connection to the DCC++EX 3.0.6+ Standalone WiFI Command Station Via your home router.
.. Note:: This is an Operations only config, the Engine Driver Power button only powers on the Main track, Not the Prog track. Function Keys are only local Default Function Settings, and are Not transferred from the JMRI Server Roster.
Enjoy your New DCC++EX MEGA + WiFI On-Board Command Station!
- The RobotDyn Mega2560+ESP8266 WiFI combo-board May also be setup & configured this same way. We have not as yet tested it.