After a few weeks experimenting, I have managed to get my mini controller working! My layout is a very small (41"x9") N-Gauge Inglenook Sidings plank layout. DCC++ is installed on an Arduino Nano, which has an ESP8266-01 connected to it to provide the WiFi comms. This ESP also automatically runs a railbus to and fro, pausing at either end for a minute before making the return journey. The Handheld controller contains an ESP8266-07, and a 0.96" OLED display. As I am not likely to need to manually control more than one loco at a time I am using a standard pot for the speed control. There are nine push buttons, not all of which are used yet. The code is based on Dave Bodnar's controller (Thanks Dave!). The 4 buttons labelled A-D set the points for each of the four possible routes that the shunter can make from left to right of the layout. The pause & start buttons control the railbus automatic sequence, and the Uncouple button operates the electro-magnet for the uncoupling of wagons. I am using a websockets library in the ESPs, this means I can easily make use of duplex (bi-drectional) comms to the controller. The controller monitors the data packets from the DCC++ Basestation, and for example constantly shows the points (turnouts) settings in a pictorial format on the OLED display. I've disabled the store/read functions in EEPROM - Apparently that works differently in the ESP, so until I've found how it works, I've hard coded the Loco address in. The code is not pretty - it is still very much work in progress..... Attached is the code so far and the schematic of the controller. I haven't shown the necessary pullups/downs that the ESP-07 needs to operate or flash etc.
Jim Thank you .... a beautiful job of construction, coding and documentation .... much appreciated. Not to burden you further but I would love to see pics or video of the layout. Steve F
Hi, thanks for your comments Steve. I am hoping to get some photos of the layout and perhaps a vid of it on here in the next day or two.... Jim
As promised here's a couple more photos and a (slightly blurred) video of the controller in action... Jim
Jim If I was impressed before, I am even more impressed seeing it in action ....... very well done indeed!
I was checking out youtube videos this morning, and then ran across your post. So I gotta ask -- is this you? If not, it's quite a coincidence. The yard is identical except you have one extra leg, and the trains look like the same brand.
Hi, No - it's not me; the layout I've used is based on a Peco set track design, which itself is an extension of the 'inglenook sidings' classic design, which I think your 'discovered' video is based on. http://www.osbornsmodels.com/ekmps/...t-cromer-wroxham--7699-p[ekm]345x500[ekm].jpg Jim Edit: Meant to say, that video as you say is spookily like my setup, - but I've not seen it before.....
I found some other videos by the same guy, and it looks like he did add that extra leg later on... So are you using an arduino as the loco decoder or does it use a commercial unit? I spent the holiday getting the DCCppESP32 base station running, now I just need to find some code to load into the loco's computer.
My Locos both have commercial decoders (Laisdcc) The DCC++ BaseStation is an Arduino Nano (with an ESP8266-01 for Wifi comms), the points (turnouts) decoder is an Arduino Nano, and the handheld WiFi Throttle is an ESP8266-07.
Nice setup, I can't wait to also get something operational. I just ordered some parts last night to try and set up an attiny85 with an I2C board that controls 16 servos, hoping to use that for turnouts. I'm also using a raspberry pi to manage dhcp and create a self-contained network. So much more work to do still, but I'm having fun along the way.
Because my house router is at the opposite end of my house, I found that the wifi signal strength to the ESP's were a bit flakey. I now have the layout set up as a local network, so the ESP8266-01 on the Basestation is the AP, and the Throttle(s) are clients, but with the IP's hard coded in. This has the advantage that I can take my layout offsite and I don't have to change any of the wifi settings. Also having the IP's hard coded makes the connection time very fast (- it doesn't have to wait for any DHCP) jim