DC++ Base Station standalone

Qunametin Jan 23, 2018

  1. Qunametin

    Qunametin New Member

    4
    6
    2
    Hi,
    Is there a way to use DC++ Base Station as a stand alone controller for a simple back and forth layout?
    I want it to boot quickly (as arduino does) and have it run without computer.

    Thanks,
    Quinametin
     
    Scott Eric Catalano likes this.
  2. Gary Menzel

    Gary Menzel New Member

    7
    7
    2
    I am in the process of doing something very similar to that (although possibly more ambitious). If you want it to run without a computer, then you need to either edit the code for the Base Station or consider using the "library" version of the code as has been released in the following post:

    http://www.trainboard.com/highball/index.php?threads/new-library-dccpp.113093/

    You'll also need to consider track occupancy detection (so you know when it reaches either end of your point-to-point layout). I am still thinking about all these things.

    In my case, I'll be having two lines (an up and a down) with a double-crossover at each end (so a train will only ever travel in one direction on each of the two lines - which is common with a point-to-point in real life). If I can get all that working (the occupancy detection, using that library above, automation of the switches etc.) then it would be feasible to get it to all run just inside the Arduino. However, I am still planning to run it from a laptop as I want a nice display that shows where the trains are. I'd probably suggest the Mega 2560 - so you have more memory for the code.

    If you are just planning to have a single track and one train - then you might be able to just use an infrared detector to know when the train is at either end. In my case, I am planning to run multiple engines, so I need to detect the current draw on various sections of the track and then control the switches accordingly to allow the engines to travel via unoccupied track.
     
    Scott Eric Catalano likes this.
  3. 4-4-0

    4-4-0 TrainBoard Member

    122
    74
    14
  4. Jimbo20

    Jimbo20 TrainBoard Member

    274
    177
    11
    I have done this, although it it does have more features. I have an Arduino Nano as the Base station with an esp8266-01 module which sends the basestation serial commands that automatically operates the back and forth railbus. There are hall effect magnetic sensors in the track that detects when the railbus is near each end. The code also automatically operates the points (turnouts) so that the railbus switches between the 2 platforms at each return journey.

    The esp8266-01 can also receive commands from my wifi throttle so I can manually operate the shunter (switcher).




    Jim
     
    Last edited: Jan 23, 2018
  5. Qunametin

    Qunametin New Member

    4
    6
    2
    Gary, Jim thanks a lot for help! I'm starting to build my prototype :)
     
    Scott Eric Catalano and Jimbo20 like this.
  6. Shdwdrgn

    Shdwdrgn TrainBoard Member

    250
    182
    11
    I always have to wonder when I see messages like this... do you know that the ESP8266 is a full-blown computer all by itself? And that the ESP is actually much more powerful than the arduino? Yeah the ESP8266-01 is severely limited on pins, but you can pick up an ESP32 for about $6 and have all the I/O you'll need. Not trying to nag, it just seems to me like a waste to set up two computers to talk to each other when you can have a single computer handling all the work.
     
  7. Jimbo20

    Jimbo20 TrainBoard Member

    274
    177
    11
    Hi,
    Yes I do realise the esp8266 is more powerful than the arduino, I've had several spare Nanos and ESP8266s kicking around for a couple of years now. I didn't need to buy anything to build my DCC++ system - I even had a Motor driver board - though it didn't have current sensing or the correct input logic - so I added my own resistors (for current sensing) and transistors (to invert the signals) and it works fine.

    I like to make use of what I already have. I can't see any great advantage in my changing to an ESP32 for this project . My next project though - who knows ;)

    Jim
     
  8. Shdwdrgn

    Shdwdrgn TrainBoard Member

    250
    182
    11
    Sounds logical enough. I have a few nanos kicking around myself and did initially set up an ESP8266-01 to add wifi -- because that was all the information I could find about using the devices at the time. It took awhile to realize that the ESP could be programmed independently. That's been several years ago now and there is tons of info on using the ESP series for different projects, yet I still see new articles published where the author seems to have no idea they are using two computer to perform a single task. Arduino is the name everyone recognizes, but the ESP chips are the powerhouse that actually makes many of these projects practical.
     
  9. Jimbo20

    Jimbo20 TrainBoard Member

    274
    177
    11
    The ESP8266-01 I have indeed programmed for my system; I consider it is the main intelligence of my layout. As well as providing the Wifi comms, it operates the Railbus completely autonomously. It does this by monitoring the 12 sensor signals from the BaseStation (<Q1> & <q1> etc), so it knows where the railbus is.

    It provides the commands to send the Railbus back and forth, varying the speed through different sections of track, pausing at each end, and alternating which platform it arrives at by operating the points (turnouts) as necessary. It even does all this without the need of the Handheld throttle ever being turned on.

    It does however also intercept the commands from the handheld throttle, so for example, I can send my own customised commands (eg <J0> from the throttle stops the Railbus auto sequence and <J1> starts it again. Similary <J3> mutes the sound and <J4> turns the sound on.)

    Edit: I meant to say my first video above of the Railbus was filmed without any manual intervention at all. I only chopped out the pauses at each end (it would be even more boring!) All controlled by the ESP8266-01!
     
    Last edited: Jan 30, 2018
  10. Shdwdrgn

    Shdwdrgn TrainBoard Member

    250
    182
    11
    That's pretty good for an -01 considering how limited the number of I/O pins is!
     

Share This Page