How to connect DCC++ EX to WiFi and use Engine Driver to run your trains

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ก.ย. 2020
  • This is a short tutorial on how to wirelessly connect DCC++ EX via WiFi to Engine Driver. We demonstrate using a Makerfabs (or similar) ESP8266 WiFi Shield.
    The port to connect is 2560
    DCC-EX Website: dcc-ex.com
    Arduino IDE: www.arduino.cc/en/main/software
    WiFi Shield: www.makerfabs.com/esp8266-wif...
    (do a search for this shield, it is available from many sources)
    We also show the Duinopeak board that takes an ESP-01 board. You can search for "esp-01 shield". Ali-Express and Banggood has them. You may be able to email the manufacturer at duinopeak.com
    Other shields may work, the criterion is that it has an AT Command set built-in to the firmware, has a 5V to 3.3V regulator on board, and level shifters for the Tx and Rx pins to convert the 5V Arduino pin logic voltage to the 3.3V of the ESP8266 and back. If you use just an ESP-01, 01S, ESP-12 board, you can easily use just 4 jumpers to wire it directly. We will cover that in a future video

ความคิดเห็น • 76

  • @sumnerpatterson8815
    @sumnerpatterson8815 2 วันที่ผ่านมา

    Great video and I recommend it all the time to anyone looking to build a DCC-EX CS. I'd like to see another with the first part but skip the Arduino IDE install entirely and show the software install using the EX-Installer only in that video. I have a feeling the IDE install might be turning some potential users away even though the EX-Installer is mentioned.

  • @keshkakotera8972
    @keshkakotera8972 ปีที่แล้ว +1

    As a software/hardware engineer I am impressed how turnkey this system is. Great job!

  • @philnewman1110
    @philnewman1110 8 หลายเดือนก่อน

    I am very impressed, you made that look far too easy! Well done indeed!

  • @DavidHarris74
    @DavidHarris74 3 ปีที่แล้ว +2

    Thank you so much !! My son is just getting into model railroading and we're ready to upgrade to DCC. This video has helped determine the path we take - DCC++ for the win :-)

    • @frightrisk7407
      @frightrisk7407 3 ปีที่แล้ว

      Great! You can find us on the discord channel or trainboard or the "dcc++ and arduino model railroading" room on facebook

  • @Trains-With-Shane
    @Trains-With-Shane 2 ปีที่แล้ว

    Can't wait to get this all set up! I've got almost all of the components. The only thing i'm waiting on is the WiFi shield which should be here in a few days.

  • @androsborsato
    @androsborsato 2 ปีที่แล้ว +1

    Wow! You took away all my fear! you rock!

  • @brice3011
    @brice3011 10 หลายเดือนก่อน

    VERY usefull and excellently explainedl tutorial on DCC-EX and wifi. Congratualtions!
    EDIT: @4:00 you mention the ESP8266 version 01 to be connected straight to the RX and TX of the Mega. This is a NO-GO: the Mega uses 5V, the ESP uses 3V. Connecting the Mega TX (5V) to the ESP RX (max 3V) risks damage to the ESP. That is why a shield should be used: that contains level-shifters.

    • @FredDeckerNC
      @FredDeckerNC 10 หลายเดือนก่อน

      I understand, and you are correct about the datasheet ratings, however the President of Expressif, Teo Swee Ann, confirmed that the GPIO pins were 5V tolerant. And many of us have used the ESP-01 and 01s for years with 5V on those pins without an issue. And with the Rx pin being fed data rather than full DC voltage, the average voltage the chip sees as heat is lower still. The power in, however can't go above 3.6V.
      That said, we have debated this a few times on Discord, and engineers being engineers and wanting to be "precise" like to be more cautious and tell people to go for 3.3V, which you can do with a 10k and 20k (or 1k and 2k) resistor divider on the Rx pin of the ESP8266. You can't go wrong with the conservative approach, so glad you posted this! There could be unexpected peaks and better to still with a lower voltage. We go into this more on the web page and provide a link to a cheap level shifter board if people would rather use that than resistors.

  • @chucknelson7559
    @chucknelson7559 ปีที่แล้ว

    Loved the video! Thank you! One suggestion, please set the initial volume to a middle value, not a high value....

  • @DCCEX
    @DCCEX  3 ปีที่แล้ว

    Mani, I apologize, but I lost your comment about using a WiFi Mega. It should work, but I have not gotten mine t work yet. My firmware was not an AT command set. I tried uploading other version, but have either not found one that works, or I have a bad chip. I can't get a reliable connection. Even a ping only works randomly. Set pins 5 and 6 on to connect the UART to the ESP and send an AT command. If you get an OK, it should work. Try every baud rate. I have a lot of detailed notes and can share with you.

  • @william-collection
    @william-collection 6 หลายเดือนก่อน

    For DCC-EX, multiple trunouts can be controlled

  • @tusharpc
    @tusharpc 3 ปีที่แล้ว

    fantastic! just got my motor driver board. gonna try this tomorrow, any plans to port the command system itself to esp32? so you can jus do away with the arduino? also where can i find the pin outs/ pin connections ? as i just want to use my own arduino nano, motor ic and esp8266 modules

    • @DCCEX
      @DCCEX  3 ปีที่แล้ว

      No plans for the esp32 at the moment, though one of the other developers who has worked with us in the past has his own esp32 based system he has been developing. But we do now have Teensy support!

  • @luigibassi2087
    @luigibassi2087 ปีที่แล้ว

    Vero vero god. Many thanks
    I have a diorama in marklun with dccpp. But I have many many problems with arduino and decoders esu lokpilot 5. Please can you help me?

  • @TimStacey
    @TimStacey 2 หลายเดือนก่อน

    I have all this working with a test track but how do I incorporate this onto my real track? I have a Bachmann power booster that I need to use to drive more trains at once so what connects to what? I don’t want to blow anything up! Appreciate anyone’s help with this. Thanks

  • @dannydzware2023
    @dannydzware2023 3 ปีที่แล้ว

    Hi,
    is it possible to use multiple throttles to control multiple trains with this configuration?
    Thank you so much for this video

    • @DCCEX
      @DCCEX  3 ปีที่แล้ว +1

      Yes, you can control quite a few trains. You can control however many Engine driver supports, either direction to DCC-EX or through JMRI using WiThrottle (or anything else). You can also build a throttle similar to Dave Bodnar's HC-12 throttle. The HC-12 is basically a replacement for a USB cable. This is a version of it I really like. If you go to Dave's site, there is a simpler version with a heap LCD display. th-cam.com/video/neMlNHVZWuY/w-d-xo.html

  • @bradvanderelst1262
    @bradvanderelst1262 3 ปีที่แล้ว

    Hi. I have a supported MC33926 Pololu motor shield. When I try and stack that board with makerfabs wifi shield the pins on the lower part of the wifi shield run into the output terminals of the motor shield. Is there a work around for that? Also when I put the wifi in the middle the jumper wires get in the way.

    • @DCCEX
      @DCCEX  3 ปีที่แล้ว

      I don't have that board to test. I'll ask one of the other testers. Do you have a picture? You can talk to us on the Discord channel or email support@dcc-ex.com and we can take a look at it. I know some people bend pins and on Pololu I thought you can put the same type headers that an Arduino has to get clearance. You can also jumper the pins to unused pins on the Arduino with those plastic jumpers and then it will go through the pins and up into the Pololu board. Then you can jumper the pins you used for Tx and Rx from there

  • @ironhorsemodeltrains2198
    @ironhorsemodeltrains2198 2 ปีที่แล้ว

    Quick question, do you have a tutorial showing how the esp-01 with an esp-01 adapter board connects to an elegoo mega with a deek robot motor shield, thank you.

    • @DCCEX
      @DCCEX  2 ปีที่แล้ว +1

      We don't have a video yet for that, but it is a great idea. But it is pretty simple to do. This shows how. It doesn't matter if you connect to the Arduino or the Motor Shield since the pins pass through to the shield from the Mega. dcc-ex.com/get-started/wifi-setup.html#esp-01-and-esp-01s

  • @gustafpeyron
    @gustafpeyron 2 ปีที่แล้ว

    Why in serial monitor do my WiFi checks timeout? WiFi isn't working I guess. I'm using an ESP-01S

  • @kaustubhponkshe6186
    @kaustubhponkshe6186 ปีที่แล้ว

    Can we disconnect laptop after code uploaded in atmega ? I want to control DCC locos with mobile but w/o laptop.

  • @gregdotlola
    @gregdotlola 2 ปีที่แล้ว

    How would one set this up using Elegoo Mega WiFi and eliminate the WiFi shield??

  • @Jean-Naimar
    @Jean-Naimar 3 ปีที่แล้ว

    Aliexpress has mega 2560 with onboard esp8266 for about 10 $
    so no need for shield, works fine.

    • @larrynelson1776
      @larrynelson1776 3 ปีที่แล้ว

      What switch and jumper settings did you use? I just got this in the mail and haven't set it up yet.

    • @Jean-Naimar
      @Jean-Naimar 3 ปีที่แล้ว

      @@larrynelson1776
      Micro swith array :
      1,2 ON = MCU - > ESP
      3,4 ON = USB - > MCU
      5,6,7,8 OFF
      Switch : TXD3
      Just upload sketch to Mega2560,
      ESP8266 has AT firmware by default

    • @frightrisk7407
      @frightrisk7407 3 ปีที่แล้ว

      The issue is knowing the difference between "good" boards and "bad" boards. We have had quite a few issues getting some of these boards to work. Also, having to flash new firmware on a device is something we try to avoid for "conductors". "Tinkerers" or "Engineers" may want to try it. We will be posting detailed instructions on the website soon for using the esptool python script or the expressif firmware tool with the propert AT firmware to get these working.

    • @DCCEX
      @DCCEX  3 ปีที่แล้ว

      We will be adding a section on our web page for a step by step configuration of this board.

    • @fruehauf01
      @fruehauf01 11 หลายเดือนก่อน

      so are you saying you can use this board mega 2560 with onboard esp8266 and do you happen to have a step by step

  • @anujchandkapoor
    @anujchandkapoor 2 ปีที่แล้ว

    Can you guide me if this can be used to read and write CVs and wirelessly by connecting my laptop to the access point and then launching JMRI? I am very new at this any help will be much appreciated.

    • @DCCEX
      @DCCEX  2 ปีที่แล้ว

      You can read and write CVs, but to connect to JMRI you should connect using a USB serial cable. You *can* use a WiFi connection, but that is not how we recommend connecting to JMRI. You will get no diagnostics, it is slower, and when programming, ACK detection is "blocking". That means if trains are running on main, they may lose some commands. Same with turnout control.
      Some phone throttle apps let you read and write CVs wirelessly so you do not need JMRI.
      You can also use the HC-12 boards as a wireless USB bridge. You connect one to the serial Tx/Rx pins of the Arduino and another through a USB to TTL board to the HC-12. Or you can an HC-12 with a USB to TTL converter in it. That is called a "HC-12-USB Line Computer Terminal"
      If you still want to connect JMRI directly to the CS using WiFi in AP mode, start one of the JMRI-based programs, then go to the Preferences panel. This opens automatically the first time a JMRI program is run, or you can select it from the "Edit" menu (from the Application menu on OS X).
      Connect your laptop to the AP of the CS, NOT your local home network. You can use your local network, but you asked how to use the default AP configuration.
      In JMRI, Select "DCC++" from the top selection box ("System Manufacturer").
      Select "DCC++ Ethernet" from the second selection box ("System Connection").
      Input the IP Address and Port Number of the DCC++ Command Station.
      Click "Save". You'll be asked if it's OK for the program to quit, click "Yes".
      Restart the program. You should be up and running.
      Now you can read and write individual CVs or use the page read and write feature in JMRI.

  • @gajanathakobbekaduwe7486
    @gajanathakobbekaduwe7486 3 ปีที่แล้ว

    Can a ESP8266 WiFi Serial Transceiver module (not the shield) be used with this ?

    • @DCCEX
      @DCCEX  3 ปีที่แล้ว

      Do you mean what I cover at 3:28 in the video? If so, then you just need jumpers from 3.3V power, ground, Tx, Rx and one more jumper for CH_PD to 3.3V.

  • @brucewoods9377
    @brucewoods9377 2 ปีที่แล้ว +1

    No motor jumpers required this time at all? Please clarify

    • @DCCEX
      @DCCEX  2 ปีที่แล้ว +1

      We configure an Uno or a Mega to use the correct pins to match the motor board. You do not need any jumpers to connect a motor shield like you do with DCC++ Classic. Details are here: dcc-ex.com/get-started/assembly.html.
      We can however, use jumpers on boards that are not shields, or to implement our "high accuracy" waveform on a board whose pins don't match up with Timer1 pins. That's something most people would not even need to know about , but I'll mention it. There is a section on the web page describing that too.
      The only jumpers necessary are to connect a WiFI board to a Mega. The WiFi boards typically want to connect to the first serial port which is shared with the USB port. We call that Serial0. You need to connect WiFi to Serial1, 2 or 3 on the mega with 2 jumpers

  • @friendsofmodelmaking1000
    @friendsofmodelmaking1000 3 ปีที่แล้ว

    Hello, very Nice System. How much can you drive rails ?! Best Regards

    • @frightrisk7407
      @frightrisk7407 3 ปีที่แล้ว +1

      If you are asking how much current, our advice is that if you need more than 5 Amps, you whould be using boosters and power districts. However, you are only limited by the motor controller. If you use the Arduino Motor Shield or the Pololu board, you are limited to 1.5A to 2A. If you use the IBT_2 board you can have 40A. Our settings for high current boards can be overrridden, but we set it in software for 5A for safety.

    • @friendsofmodelmaking1000
      @friendsofmodelmaking1000 3 ปีที่แล้ว

      @@frightrisk7407 Thank you so much !

  • @xpertllm
    @xpertllm 3 ปีที่แล้ว

    As per your web instruction I tried with esp01s and installed the software. Butt my programming track lights on motor shield does not on. Only main track lights on and my loco run smoothly. What is wrong with my programming track?

    • @frightrisk7407
      @frightrisk7407 3 ปีที่แล้ว +1

      We only turn on the programming track when you are programming ;) The DCC++ Classic does not allow you to control the power separately, EX does. If you go into the serial monitor and type both MAIN and PROG should come on turns both off. turns prog on separately if you want to have it on for some reason. If that doesn't work, then we would have to check your config and that the pins are all correctly seated from the Arduino to the motor shield

    • @xpertllm
      @xpertllm 3 ปีที่แล้ว

      @@frightrisk7407 I connected the same with jmri and both lines are lighted but when I connect with phone again programming track is turn off.

    • @frightrisk7407
      @frightrisk7407 3 ปีที่แล้ว

      @@xpertllm Correct. We haven't changed the behavior in JMRI yet. It sends . The developer of Engine Driver is on our team. New changes are always added to ED. Steve sends . It doesnt make sense to have a track powered up all the time when you aren't using it. (Technically, ED does not use commands. It sends withrottle commands which we directly read separately from commands)

    • @DCCEX
      @DCCEX  3 ปีที่แล้ว +1

      I need to try to remember to login to the same account when I reply. I am Fred, aka DCC-EX aka Frightrisk ;)

  • @MartynCole
    @MartynCole 2 ปีที่แล้ว

    I'm building my own wifi board using esp8266 modules. The problem is that they have been used for other things before and don't have the AT software installed. Has anyone any idea how to re-program them?

    • @DCCEX
      @DCCEX  2 ปีที่แล้ว

      We don't have a tutorial for just the ESP8266 chip, but here is how you upload the correct AT command set once you have a circuit or cable to connect it: dcc-ex.com/advanced-setup/supported-microcontrollers/wifi-mega.html#mega-wifi-configuration. So just ignore the part about the Mega+Wifi and do the same for your board. Instructions for what else you will need depend on your board. If you have the tiny ESP-01s boards, you will need to create a circuit with a breadboard, some jumpers, an FTDI board or FTDI cable, and perhaps a button or two. There are lots of instructions if you search "upload firmware to ESP8266". If you buy a few new ones, they come with the AT command set on them.

    • @MartynCole
      @MartynCole 2 ปีที่แล้ว +1

      @@DCCEX Thanks for getting back to me. I have managed to get the AT commands working this time. I hadn't set the SPI mode to DIO as said in the instructions. Many thanks, I can start on my own wireless shield now.

  • @brice3011
    @brice3011 10 หลายเดือนก่อน

    Currently version 4.1.6: where is the configuration for the WiFi access point?

    • @DCCEX
      @DCCEX  10 หลายเดือนก่อน

      There is no configuration for the WiFi access point. If you connect a WiFi device and turn the command station on, you will get an AP at address 192.168.4.1 that begins "dccex_". Connect to that. If you want other configuration, that is in your config.h file. You can edit that with help from the website, or just use the new installer (After July 2023). The installer walks you through the configuration if you want AP mode or to connect to your home network in Station mode. This explains both modes in detail and how to configure them dcc-ex.com/ex-commandstation/advanced-setup/supported-wifi/wifi-config.html

    • @vladtheimpala218
      @vladtheimpala218 8 หลายเดือนก่อน

      @@DCCEX The issues is that regardless if we make it an STA or AP mode the EX-Installer uploads the configuration as an AP mode, no matter what. I am having a hard time finding a cut and clear tutorial on how to set it up as an STA. Would be nice if the installer would actually turn it in to an STA when selecting "Connect my EX-CommandStation to my existing wirelss network."

    • @DCCEX
      @DCCEX  8 หลายเดือนก่อน

      @@vladtheimpala218 Have you used the new installer? I need to make a video on that. It is completely different than the old one and allows all sorts of configuration options. See here to make sure you have the latest version. For help with it or with using the Arduino IDE, please come to the Discord channel and post a question as a support ticket or just a comment in a channel like #installer

  • @xpertllm
    @xpertllm 3 ปีที่แล้ว

    I am from Pakistan and it cost me a lot buying shield and shipping to Pakistan but i can buy a simple esp8266 module from my local shop. Can you make a video of such module. Who to wire and jumper setting to connect 8266 module with mega.

    • @frightrisk7407
      @frightrisk7407 3 ปีที่แล้ว +1

      We can, thank you. In the meantime, instructions are on the website. You don't normally need to flash them unless ou want to upgrade the firmware that comes with them. dcc-ex.com/get-started/wifi-setup.html

    • @xpertllm
      @xpertllm 3 ปีที่แล้ว

      @@frightrisk7407 I used esp 01s for WIFI and i powered 3.3 v to esp01s from motor shield and its work fine . Is it ok?

    • @xpertllm
      @xpertllm 3 ปีที่แล้ว

      why we need to supply 3.3v to CH_PD.? It work fine even we do not supply volt to CH_PD

  • @michaelmappin4425
    @michaelmappin4425 2 ปีที่แล้ว

    I'm not getting it. I don't understand where I'm hung up. I got my mega board and Arduino and can run my train just fine when connected to my laptop. My wifi shield finally got here yesterday. I connected it to the other 2 boards and hooked up the jumpers. I can't figure out what to do to make engine driver connect to wifi.

    • @DCCEX
      @DCCEX  2 ปีที่แล้ว +1

      Did you use the installer or the Arduino IDE? Better to use the IDE if you have troubles. But before you try anything, look at the log when you connect a computer running the Arduino serial monitor. It should show you the attempts to get a response on all 3 serial ports of the Mega. If you see 3 "no AT response" messages, you have a connection problem or bad board. If you see one of the attempts connect, you will see 192.168.4.1 in your log. Look for that. If you see it, then you turn off auto-connect for your home network on your phone. Then connect to the DCC-EX Access Point you should see there. If you have the latest version of Engine driver, when you go to it, it will find DCC-EX and you put in the password. The detailed instruction is here: dcc-ex.com/advanced-setup/wifi-config.html#default-operation-ap-mode-no-configuration-necessary.
      If you don't see one of the serial ports respond with a lot more commands and the IP Address, then try another serial port or switch the wires. One of the clone Megas has the silk screened letters backwards on one of the ports and Tx is Rx and visa versa. If you still have trouble, send us an email or post on Discord with a picture of your boards so we can see the jumpers and a copy of the boot log.

    • @michaelmappin4425
      @michaelmappin4425 2 ปีที่แล้ว

      @@DCCEX I used the installer. I entered my home network name and password. I get the impression the Wifi is working but I can't seem to connect to it or see it on my home network. I looked at the config.example.h file and I can't see any references to wifi network name or password. There is no other config file in my CommandStationEX folder. I don't know how to get to the log file you mentioned. I'm not really experienced in networking but I do have my computer, phones and Roku devices correctly joined to the network. I've been reading the pages you sent me all day long and I'm still having trouble.

    • @michaelmappin4425
      @michaelmappin4425 2 ปีที่แล้ว

      @@DCCEX I got it. Thank you. I was missing one step and once I found it, all was smooth.

    • @DCCEX
      @DCCEX  2 ปีที่แล้ว

      @@michaelmappin4425 Oh Great! I was just getting ready to type some more instructions. What was the step that got you going? I can update the help to make it easier to find.

    • @michaelmappin4425
      @michaelmappin4425 2 ปีที่แล้ว +1

      @@DCCEX I just wasn't thinking in terms of it being a network I had to connect to. It's clearly in the video but for some reason my brain just kept skipping past that. Once I connected using the password from the MAC address, everything was smooth sailing. Thank you again for everything.

  • @MrSoldier333
    @MrSoldier333 3 ปีที่แล้ว

    is this code already online?

    • @DCCEX
      @DCCEX  3 ปีที่แล้ว

      Yes. Everything is up to date

    • @MrSoldier333
      @MrSoldier333 3 ปีที่แล้ว

      @@DCCEX get an error message: ATMEGA2560/Timer.h: No such file or directory
      . i am not a professional. Best regards from germany

    • @DCCEX
      @DCCEX  3 ปีที่แล้ว +1

      @@MrSoldier333 When you unzipped the program, do you see a folder named ATMEGA2560? And inside it do you see a file called Timer.h? Maybe all the files in the zip file did not get unzipped?

    • @lukehelm2198
      @lukehelm2198 3 ปีที่แล้ว

      @@DCCEX Same issue. After unzip additional files seem to be missing or in unexpected locations.

    • @DCCEX
      @DCCEX  3 ปีที่แล้ว

      @@lukehelm2198 Everything should be correct now in the repository. We will have a release in a few weeks, so the zip will be there too. Writing instructions for the WEB and updating the installer now. If you unzip everything to the correct folder (for the Arduino IDE is must be in a folder that has the same name as the .ino file) which is CommandStation-EX. You will need to rename config.example. h to config .sys. If you are using the defaults (arduino motor shield and optionsally the ESP8266 board) you don't need to change anything. Then go to the IDE "library manager" and install the DIO2 library by Thierry Paris. So your path would be something like /documents//Arduino/CommandStation-EX/CommandStation-EX.ino. Select your board, the port, and click upload.

  • @mattw9667
    @mattw9667 ปีที่แล้ว

    You're going to fry your mega! You need to bend the gnd and vcon pins out of the way on your motor shield before placing it on top of the mega.