Geoff Bunza geoffb

Take the 2 boards pictured below, download the efforts of Gregg E. Berman, the creator of DCC++:  https://sites.google.com/site/dccppsite/, add 2 wire jumpers and you have a DCC base station that can be controlled with multiple throttles directly from your PC. It will also act as a $9 JMRI to DCC hardware interface—really! This was pointed out by Dave here: DCC++ on Arduino supported by JMRI https://forum.mrhmag.com/post/dcc-on-arduino-supported-by-jmri-12202303 -- JMRI has recently been updated so that it can directly control the Arduino board combo without any other software on your PC. Moreover, you can follow the exploits of the intrepid Dave Bodnar here: My Experiments with DCC++ https://forum.mrhmag.com/post/my-experiments-with-dcc-12202876 and add a booster or remote handheld throttle—great stuff. This article describes some tinkering beyond my own first DCC++ build that may be of interest to other modelers too.

Uno.jpg   eld%20R3.jpg 

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 2
Geoff Bunza geoffb

@Peter re:Compilation error

Hi Peter.

Your messages point to a couple of possibilities:

-- You may have duplicate files or libraries of the same name.
-- You may have an old copy of the Arduino IDE (editor).
-- You may have missing files.
 
Let's start by isolating your problem.
-- I just tested this with version 1.16.13 of the Arduino IDE, load it onto your system or a later version
-- Download a fresh copy of the zip file and use those folders only
-- I suggest renaming your ..\Documents\Arduino\.. folder to ..\Documents\oldArduino\..  to save it.
-- Now create a new folder ..\Documents\Arduino\ and put the DCCpp_Ctlr_SW into it
            like ..\Documents\Arduino\DCCpp_Ctlr_SW
-- Now create the libraries folder  like ..\Documents\Arduino\libraries
-- Now put the LCDKeypad into the libraries folder like  ..\Documents\Arduino\libraries\LCDKeypad
 
If your Arduino IDE was open and running, shut it down, and restart it -- make sure it is 1.16.13 or later,
and verify that it now compiles correctly. It just worked for me. If this now works for you, then in your old oldArduino folder you have one or more of the conflicts I referred to before.
 
If it does not work, copy exactly what shows up in the entire message window in the IDE., and post it.
 
Have fun! 
Best regards,
Geoff

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 1
MikeM

The latest Arduino IDE appears to be 1.8.0

https://www.arduino.cc/en/main/software

MikeM

Reply 1
Heisler wanted

RR compilation error

Thanks, Will check this out. Btw, did you mean IDÉ 1.6.13; a slight misprint ?  As someone just pointed out there's now a 1.8 release, have not seen what modifications.

Regards

Peter

Reply 1
Geoff Bunza geoffb

@Peter re: release versions

Hi Peter,

As I said: " I just tested this with version 1.16.13 of the Arduino IDE, load it onto your system or a later version" so either one will do. This works with both, and was verified.

Have fun! 
Best regards,
Geoff

 

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 1
Heisler wanted

Re release ver

Hello Geoff,

I am now running IDÉ 1.8.0, and almost one page of warnings and errors  disappeared. I was previously using 1.6.9, without problems. One thing though, the compiler can't find LCDKeypad.h. IT is there, I ran à testprogram for  

the display earlier. Have tried your suggestion with à new library "Arduino" with only your program and à subprogram "libraries" containing only LCDKeypad.h;

what I get is "fatal error: LCDKeypad.h: No such filé or directory". This refers to line 128, #include < LCDKeypad.h> .

Have you used 1.8.0 ?  Could this version look for libraries in à different manner ?

A totally different issue is that I do not know how new 1.8.0 is, is it stable ?  Before you ask, I haven't found

version 1.16.xxx.

Many questions here, I will also check forums for comments on this new version. 

Regards 

Peter

 

 

 

Reply 1
Geoff Bunza geoffb

@Peter re:Questions

Hi Peter,

Version 1.8.0 is stable and works just fine.

You need to load the entire LCDKeypad keypad library into your ...\Document\Arduino\libraries\ folder. This is a fairly standard an easily available library, but here is a link to download it: /sites/model-railroad-hobbyist.com/files/users/geoffbfiles/LCDKeypad.zip

Unzip it and put the entire LCDKeypad  folder into the libraries folder and your error should disappear.

Have fun! 
Best regards,
Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 1
Heisler wanted

Re questions

Hi Geoff,

Thanks for the link. The missing file error disappeared all right, but instead I now have the two other errors back.

Here's the error listing, if you'd kindly have a look at it. The Mega is chinese btw.

Thanks and Regards

Peter

 

Arduino:1.8.0 (Windows XP), Kort:"Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

C:\Documents and Settings\Karin\Mina dokument\Arduino\DCCpp_Ctlr_SW\DCCpp_Ctlr_SW.ino:136:59: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]

 CurrentMonitor mainMonitor(CURRENT_MONITOR_PIN_MAIN,"< p2> ");  // create monitor for current on Main Track

                                                           ^

DCCpp_Ctlr_SW:343: error: expected declaration before '}' token

   }                 

   ^

exit status 1
expected declaration before '}' token

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Reply 1
Geoff Bunza geoffb

@Peter re: Warning Message

As I recall, I did get a warning message from the compiler too, and ignored it. The current monitor code isn't mine and I never used it as well.

Have fun! 
Best regards,
Geoff

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 1
jayfmn

Updates

Hi Geoff, have you delved any further into the possibility of doing the DCC++ Throttle using a touch screen?

Or is this beyond the scope of what you are doing.

Thanks!!

Jay-AT&SF

Reply 1
Geoff Bunza geoffb

@Jay re:Touchscreens

Hi Jay,

I have some ongoing background work using 3.5, 5 and 7 inch color touchscreens, largely because most of the button options I have tried are way too limiting.

Unfortunately I have limited ongoing interest in DCC++ as a universal base station, or one where my use of DCC++ would require a complex user interface. So while I may revisit this sometime, I have no near-term plans to put these together.

Have fun! 
Best regards,
Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 1
Cosmos

Can't get Dccpp_Controller to talk to Arduino R3 Motor Shield

First ..  I'm a Newbie to  "N" scale. I got really interested when I saw the DCC control info. I've been an Electronics Engineering Tech for 45 years. Love building new toys.... I have built two of your decoders, but I used the Nano. I went & got the Processing IDE & I can't get the Controller panel to talk to the Motor shield. I've had no problem controlling my  N  scale with JMRI Decoder pro & WiFi. When I chose emulator Com it freezes up & I get an error code. Have same problem if I try Com1.  Any Help Appreciated .   Thanks for all your Work you have done ....

P.S.     When I tried to use the Arduino IDE I got an Error>   File Type Not Defined... When I looked at the sketch.. The top include files had  ( .* ) as a file type...  So.. I saw in your text to use Processing IDE & I went & got it to compile & run the DCCpp_Controller. As you might figure..  I don't have a lot of knowledge on Arduino.... Did I use the right IDE ?

 

img.jpeg 

 

img.jpeg 

Reply 1
DBodnar

Touch Screen Throttle for DCC++ (wireless, too)

Jay - I have designed and built several throttles for DCC++

The first uses a standard LCD and buttons - see:

http://www.trainelectronics.com/DCC_Arduino/DCC++/Throttle/index.htm

The second one I built uses a Nextion touch screen - see:

http://www.trainelectronics.com/DCC_Arduino/Nextion_LCD/index.htm

Both work for basic functions - you could easily modify the code to fit your goals.

dave

Reply 1
Geoff Bunza geoffb

@Cosmos rerocessing Panel Comms Problem

Hi Cosmos,

Quote:

I can't get the Controller panel to talk to the Motor shield.

I am not a Processing  expert, but consider:

1. If you loaded the sketch I used with the LCD/Button displays it will never communicate with the Processing Software. For your Arduino to communicate with Processing you need to load Gregg's original software, which you can get from: https://github.com/DccPlusPlus/BaseStation  After downloading and unzipping DCCpp_Uno, put the entire folder into your ...\Documents\Arduino\  folder (not \libraries)  and download DCCpp_Uno.ino to your Arduino. 

2. Once you have loaded your Arduino, leave it plugged into your computer, but exit the Arduino IDE and start the Processing software. You should now be able to run Gregg's Processing .pde or my smaller version. Remember, the software for Processing is not the same as the sketch that loads into the Arduino.

3. Did you remember to properly jumper the Motor shield/Arduino combo? Go back over Gregg's instrctions and diagrams.

4. Are you using the same Motor shield that I used? If not, I can't help you.

Have fun! 
Best regards,
Geoff Bunza

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 1
Cosmos

No comm to Arduino with DCCppp_Controller

Hi Geoff...

Thanks for you reply...

1.  I didn't use LCD sketch... The uno & mega have the DCCpp_uno loaded on them, as I use when I WiFi control my N DCC engine.

2.  I had to use processing IDE to get the DCCpp_Controller to run. When I tried to use Arduino IDE I got error..  No File Type Defined. I hope I used the Right IDE ( Processing ) . The file types had ( .* ) as file type.

3.  Yes on the correct jumper pinouts, as I use both the Uno & mega to WiFi control my DCC engine.

4.  I'm using the ORG  Arduino Motor Shield R3.  OPPS...  LOOKS like you use the  DEEK-ROBOT motor shield..But will that keep cause the errors about file save & write error to Pop up ?

In that line 101 of DCCpp_Controller error about what looks like it could't write to a file location.. I went & told windows to allow read / write to that file folder..Another text string that shows up as soon as I run is Can't save. will try again repeats until I try to run Emulator.

Thanks again for help...

Alan

Reply 1
Geoff Bunza geoffb

@Alan

Hi Alan,

Quote:

  I had to use processing IDE to get the DCCpp_Controller to run. When I tried to use Arduino IDE I got error..

I don't understand this point. The code (.pde) for Processing will only run on Processing. The Arduino sketch (.ino) will only run on the Arduino.

Quote:

The uno & mega have the DCCpp_uno loaded on them, as I use when I WiFi control my N DCC engine.

Are you trying to use DCCpp_uno.ino with a WiFi library (that is are you customizing your sketch)? If yes, your WiFi library may be incompatible with DCCpp. If this is what you are doing, try removing the WiFi library and see if the problem disappears. Obviously the Wifi will not function at this point-- it is merely a test.

I think I remember that there is a forum on the net that Gregg (the author of DCC++) uses for DCC++ discussion. You might do a google search for it and direct your questions there. I think you need some expert DCC++ help beyond simple sketch modifications or connections to JMRI.

"Hope this helps. Have fun! 
Best regards,
Geoff

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 1
Cosmos

No comm to Arduino with DCCppp_Controller

Hi Geoff..

I'm not using WiFi with DCCpp_Controller...  I Think I joined that DCC++ group...  I'll try there..

And Thanks again for you help.....  BTW... It looks like DEEK-Robot is out of business..  I tried to find their motor shield.   I'm really excited about getting your decoder designs running...... I'll let you know when I do & what problems I guess I Created...  LOL....

I'ma gonna have  FUN..... 

Alan......

Reply 1
Cosmos

A thought...

Hi Geoff....

I was wondering if where I have the DCCpp_controller files are a problem.  I have DCCpp_controller under.... C:\Arduino Processing\processing-3.2.3-windows64\processing-3.2.3 ... Uh.. I also have it at C:\program files\ (86)Arduino\libraries\DCCpp_controller   ...   Should I go get  3.1.2  ??  I'm still waiting to get approved for the DCC++ site btw... 

IMG_0326.JPG 

Thank you for your patience Geoff.......

Not having Fun Yet....  But trying...  GRRrrrr

Alan

Reply 1
Geoff Bunza geoffb

@Alan re:File Locations

Hi Alan,

You may have identified some of your problems.

The Processing files are not the same as the Arduino files and I would strongly recommend you put them in distinctly separate, non overlapping, non shared branches of your file system. Why? Because the Arduino IDE was once upon a time built from Processing. So there are overlaps in naming conventions and such that you may confuse yourself (a practice I unfortunately experience from time to time) and the compilers you use.The libraries aso do not overlap.

Next, I have found out the hard way that having multiple copies of the Arduino IDE and/or Processing is not a good idea in general. Again this is a search path problem for the IDE and the compilers.

My suggestion. Clear your folders and directories so you only have one copy of each, and keep them separate. Then try to build your sketches and software anew.

Good luck with your project and have fun! 
Best regards,
Geoff

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 1
Cosmos

File Locations...

Hi Geoff...

Thanks...  I'll  go & give that a try.....

Reply 1
Cosmos

KEWL BEANS

 

Hey..  Geoff...

It's a running.....  All I got to do now is Learn how to make the controller software turn on the Led's...LOL

I just wiped out my previous text trying to place a pic on here.... Anyhowz..  I think I loaded the 7 Servo / 10 Led sketch into the Decoder Arduino, I haven't been able to turn on or blink any Leds. I'm still trying to get my head around the address structures... Mobile  /  Accessory  /  And   the  CV's....  Any known Videos that might help me ?  I'm also not sure which port to attach to ..  the operations or the programming port. 

Here is a pic of the Clean Data at the Arduino Decoder

Thanks  Loads for you help.....     Alan

 

 

 

IMG_0329.JPG 

Reply 1
Geoff Bunza geoffb

@Alan re: Working!!

Hi Alan,

That's great you got it working! Congrats.

Quote:

I'm also not sure which port to attach to ..  the operations or the programming port. 

You should connect the decoders to the operations port. You can program the CV's with ops mode programming via JMRI. try the single CV programmer tool. Under tools in the JMRI drop menu you ca use Power Control to turn DCC++ on and off, and Turnout Control to switch my accessory decoders, which unless you changed the address, start responding at ACC address 40. Each function pin the gets the next address in sequence.

If you create mobile/function decoders, the default address I set them to was 24. You can create a "generic" throttle with a simple decoder model like a Digitrax DN140, set its address to 24, and use that JMRI throttle with the programmed mobile/function decoder.

If you are using the DCC++ Programming interface the Accessory decoder addressing is NOT the same as the JMRI interface. If you look at the Programming DCC++ Accessory interface it requires you to provide a 2 part address, which I vaguely remember get added to form the composite address. It was rather clumsy! and I decided never to use it.

Have fun!
Best regards,
Geoff

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 1
Cosmos

New Hobby

Hi  Geoff..

Thanks for helping me into my new Hobby...  I really got interested in Model Rail Road because of  DCC... I'm also a Ham Radio guy. ( just what I need ..  another expensive hobby ) LOL.  I built Two of your decoders & tried to do a Cram course in 3 or 4 days.. LOL... I have a lot of off the wall ideas about Toys to build for this hobby & your decoders are a good learning tool.  A cpl of them like Ultrasonic mapping of track layout. Infrared mapping.. Train ID & location Using the Kiss method..LOL.  Anyhow... Gonna be FuN.......  Thanks again & I'll try to use JMRI first to Yak at the decoder......

Alan

Reply 1
Geoff Bunza geoffb

@Alan

Hi Alan,

You are most welcome!

As a radio Ham you might like to poke around into the relatively new radio control with DCC options that have been offered commercially (search for RailPro for one). Also if you like to mix you radio interests a bit more you could take a peek here:

Modeling Working Cranes 2 in Model Railroad Hobbyist Mag, Jan 2016  or here

Battery Powered Models in HO Scale in Model Railroad Hobbyist Mag, Nov 2014

both of which include radio control. And always... Have fun! 
73
AD7JP \ Geoff

Geoff Bunza's Blog Index: https://mrhmag.com/blog/geoff-bunza
More Scale Model Animation videos at: https://www.youtube.com/user/DrGeoffB
Home page: http://www.scalemodelanimation.com

Reply 1
Cosmos

Murphy is in the house....

Hi Geoff....

Well.. I just typed a pile of stuff a while ago  &  LOST  it Again...  GRRrrr...  I think I wasn't logged in...

I'll re-type it after I eat...

Well...  Kewl - Beans.... AD7JP...  Go look me up on QRZ..  KB5CUS.... 

73.....    Alan

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

I tried all kinds of ways to try to talk to the decoder....Then I decided to try your simple AccDec_17LED_Ftn sketch...  It's kinda weird that the  RX led on the Arduino Nano is on Steady..... I created a new Loco Using MNRA Ass Decoders... It only has 4 CV's. It looked like I was able to write Address 40 to the Arduino I think because when I went to  the CV's Tab in new Loco  # 1 was 40, #17 was 123, #18 was 123, & #29 was 91. With Only 4 showing, does that mean that if I use JMRI or Processing that  I Only have 3 functions ?  I tried to talk to it & no Leds light... Not really sure what going on...  LOL  As you can probably tell....    OH..  What Bands on HF do you work ?  Prob on Air you can tell how I messed all of this up...  LMAO.....  

Uhhh..  Am I writing the Address to the right CV ?? GRRRR I'll go & try to find where it's supposed to be.....

Also ..  It looks like in new Loco you cannot create any new CV's...  Is this right  ??

I just used JMRI ..  Simple Programmer to go & read with & when I read CV #1 it comes back  123   ....Weird...

73...  Alan

Reply 1
Erik A. Erik84750

build questions: LCD-keypad shield

Hi Geoff,

I have 2 questions about the hardware setup

1. You mention only a slide switch backlight control LCD-keypad shield should be used. If I am correct most of the non-slideswitch LCD-keypad shields use D10 to control the backlight where D10 switches the base of a transistor for this purpose. Would it be ok for the hardware here if a D10-activated LCD-keypad shield were used with the D10 connection to this transistor is cut? (ie. backlight on all the time)

2. You disconnect A0 from the shield stack and jumper it to A2. A0 actually reads the keypad status, does this mean you use A2 for this purpose now? And for what reason did you change it to A2?

Geoff, I admire your energy and capabilities: you do unbelievable things not only for this community but for everyone interested in electronics and programming in general. David Bodnar is also someone who does such amazing things; great guys, you inspire a lot of people. And in more then the technical aspects.

Erik

 

Reply 1
Reply