DCC++ Fails to compile on Arduino Uno

LEGOManiac Mar 31, 2016

  1. LEGOManiac

    LEGOManiac New Member

    5
    5
    1
    First of all, my compliments to Greg E. Berman for a remarkably professionally done set of videos. It totally got me hooked on the concept, so after waiting almost a month for the correct motor controller to arrive, I finally got it hooked up and went to compile the software for my Uno:

    DCCpp_Uno.h:51:4: error: #error CANNOT COMPILE - DCC++ ONLY WORKS WITH AN ARDUINO UNO OR AN ARDUINO MEGA 1280/2560

    Now, I know very little about programming in C/C++, but I do realize that, since this error is thrown during the compile phase and no communication has taken place with the Uno yet, that this has nothing to do with the Uno itself. I did, of course, confirm that I have the Uno selected as the target board. I also tried setting the MEGA 1280 and MEGA 2560 as my target board just to see what would happen but I get the same error.

    So, at this point, I had a look at DCCpp_Uno.h, line 51 and I see that this is a section of code that attempts to identify the target board and assign the correct output pins. I don't know how to go about checking what the compiler thinks the contents of ARDUINO_AVR_UNO is, which appears to be what it's testing for and not finding so I thought I'd work around it by commenting out all the other tests except:

    #define ARDUINO_TYPE "UNO"

    #define DCC_SIGNAL_PIN_MAIN 10 // Ardunio Uno - uses OC1B
    #define DCC_SIGNAL_PIN_PROG 5 // Arduino Uno - uses OC0B

    Recompiling, it got past this point and on to other errors indicating that (if I recall correctly) a Direction Control Register (DDCR) was not defined, or something like that. I didn't make notes and have since restored my files to the original copies.

    At this point I'm realizing that there's probably something more fundamental missing. I'm guessing something that defines both the ARDUNO_AVR_UNO variable and a whole bunch of others and for me to go mucking around with my beginner's knowledge of C, is just asking for more problems.

    So, can anyone tell me what's wrong here?
     
    Scott Eric Catalano likes this.
  2. LEGOManiac

    LEGOManiac New Member

    5
    5
    1
    It occurred to me after I posted, that my problem could be as simple as an included library file being pulled from the wrong directory. The linux version of the IDE is a bit on the stupid side in a few different ways, wherein it will pull the first #include file with the correct name that it finds in the libraries directory even though it's in the wrong sub-directory. I've had, on more than a few occasions, to move an entire library sub-directory out of the library directory to avoid a name conflict with a different project in a completely different sub-directory.

    Anyway, it turns out the names were all unique, so that's not the issue.
     
    Scott Eric Catalano likes this.
  3. Gregg

    Gregg TrainBoard Member

    237
    311
    18
    I've not tried to compile this on Linux though it has been tested extensively on Windows and Mac. It seems like the IDE is not correctly setting the board type. A DDCR error is generated by the IDE itself, not the DCC++ code, if you try to access pins or a feature of a board that is not defined for that board. My guess is that something is either missing or corrupted in the Arduino IDE install. Sorry not to be able to be more helpful.
     
    Scott Eric Catalano likes this.
  4. LEGOManiac

    LEGOManiac New Member

    5
    5
    1
    Confirmed.

    The IDE I was using was Arduino 2.1.0.5+dfsg2-4

    I used Microsoft's free Windows10 virtualbox image (yes, Microsoft actually provides it free of charge), and installed the Arduino IDE to that, I was able to compile DCC++ and download it to the Uno.

    The motor shield I bought had a sticker attached indicating that there was a new IDE available. I downloaded it, although the "latest" is listed as 1.7.9. That at least got me past the "Cannot Compile" error. Now it's complaining that
    'class EEPROMClass' has no member named 'put' , nor a member named 'get'.

    It would be lovely if there was a better way to identify, manage and maintain libraries. I'm using the default EEPROM library that came with the IDE package.

    Although, come to think of it, it compiled under Windows and should therefore be the same package as I have on Linux. I'll have to try and find out where it thinks it's getting the library from. The IDE does not seem to have a way to tell it which library to draw from and since I have two IDEs (2.1.0.5 and 1.7.9) I suppose it's possible the 1.7.9 IDE is trying to use the 2.1.0.5's libraries even though they are in different sub-directories. It shouldn't be hard to figure out. I'll post the results here in case another Linux user runs across this problem.
     
    Scott Eric Catalano likes this.
  5. Desiro

    Desiro New Member

    8
    19
    1
    Hi All,
    I somehow can't re-compile the base controller anymore, it gives me many errors such as lines below. Any helps will be appreciated. Thanks in advance.
    Regards
    Andi

    DCCpp_Controller:81: error: 'import' does not name a type
    import processing.serial.*;
    DCCpp_Controller:82: error: 'import' does not name a type
    import processing.net.*;
     
    Scott Eric Catalano likes this.
  6. Gregg

    Gregg TrainBoard Member

    237
    311
    18
    What version of Processing are you using (the code you reference is not the Arduino code). -Gregg
     
    Scott Eric Catalano likes this.
  7. Desiro

    Desiro New Member

    8
    19
    1
    So so sorry Greg. You are right. It was my mistake. I'm mistook the Controller for the baseStation.
     
    Scott Eric Catalano likes this.
  8. zephyr9900

    zephyr9900 TrainBoard Member

    34
    51
    2
    I have made that mistake also, Andi. The videos refer to the software as "Interface"... I tend to think of a controller as hardware so I need to mentally translate "Controller" to "Interface" :)

    Randy
     
  9. esfeld

    esfeld TrainBoard Member

    442
    382
    17
    Gregg ... and maybe SteveK
    While waiting for some boards to arrive I am trying to load DCCppUno to a LOLIN ModeMcu V3 board (supposedly a Chinese clone of the UNO..with built in 8266) .... I got Arduino_file_for_8266 to upload (to the ESP portion of the board) but can not get DCCppUno to upload without errors ........ are we not compatible with this board?
    Thanks
    Steve F
    Just received an Arduino ESP8266 WiFi Shield Version 1.0 by Wang Tongze .... anybody uploaded to this shield? I'll wait till the AM to play with it ...... hope I'm not the first and someone can give me some insight.
     
    Last edited: Jun 7, 2016
    Scott Eric Catalano likes this.
  10. rva1945

    rva1945 TrainBoard Member

    114
    39
    9
    Hi, I'd like to contact Mr Gregg Berman for questions about the code in DCCpp_Uno. I'd appreciate any help, many thanks.

    Robert
     
    Scott Eric Catalano likes this.

Share This Page