Arduion IDE error 'MyGateway' does not name a type



  • Greetings,

    I have used Arduino products and the IDE in the past. I downloaded the files for Arduino-Master and placed them where I was directed. When I open the IDE and run the SerialGateway sketch, I get the message in the title, as well as the following;

    Arduino: 1.5.4 (Windows 7), Board: "Arduino Nano, ATmega328"

    SerialGateway:33: error: 'MyGateway' does not name a type
    SerialGateway:35: error: 'MAX_RECEIVE_LENGTH' was not declared in this scope
    SerialGateway.ino: In function 'void setup()':
    SerialGateway:41: error: 'gw' was not declared in this scope
    SerialGateway.ino: In function 'void loop()':
    SerialGateway:46: error: 'gw' was not declared in this scope
    SerialGateway:50: error: 'inputString' was not declared in this scope
    SerialGateway.ino: In function 'void serialEvent()':
    SerialGateway:69: error: 'MAX_RECEIVE_LENGTH' was not declared in this scope
    SerialGateway:71: error: 'inputString' was not declared in this scope
    SerialGateway:75: error: 'inputString' was not declared in this scope

    Would someone be so kind as to suggest where I may be doing things wrong? I have a couple of nano devices connected to my radios . . . all I need is to make them communicate.

    Respectfully - Baran


  • Admin

    @Baran

    As your IDE can't find the libraries they must have been put in the wrong folder.



  • Greetings Again,

    I beg forgiveness for my relative density but I am not seeing the problem. The following line stops the compiler and is highlighted in yellow:

    MyGateway gw(DEFAULT_CE_PIN, DEFAULT_CS_PIN, INCLUSION_MODE_TIME, INCLUSION_MODE_PIN, 6, 5, 4);

    The errors are the same as reported above.

    My folder hierarchy is as follows:

    Arduino-master\libraries\MySensors\examples + MySensor.h, MySensor.cpp, MyGateway.h, MyGateway.cpp, plus several .h and .cpp files for the radio.

    As best as I can tell, this is correct - the examples folder is nested in the MySensors folder with all of the .h and .cpp files. Please correct me if I am wrong (and I must be) but I also tried placing all of the .h and .cpp files directly in the examples folder under MySensors to no avail.



  • Also . . . can anyone please tell me where to find stdarg.h? Unlike all the other .h files on GitHub, I cannot find anything that looks like a file with this name. If I am going to include it, I ought to find it first;).


  • Admin

    @Baran said:

    Arduino-master\libraries\MySensors\examples + MySensor.h, MySensor.cpp, MyGateway.h, MyGateway.cpp, plus several .h and .cpp files for the radio.

    This is wrong. Please look at the instructions/pictures here:

    http://www.mysensors.org/build/arduino#installing-the-sensor-libraries



  • @hek I have to agree with Baran. I just downloaded the new 1.4 file twice and followed the download instructions exactly, and I can't get it to recognize any of the # include files aside from SPI. There might be something wrong with how the new version the files were ordered in the zip file or something. If not could you tell us the correct order the files should go?


  • Admin

    @hek said:

    http://www.mysensors.org/build/arduino#installing-the-sensor-libraries

    Copy the libraries-folder out of the zip to the sketchbook-folder on your platform:

    findingLibraries.png



  • @hek There we go! Ok, so it's 'just' the library folder that we're supposed to move to the arduino sketch folder, and then let it merge with the existing arduino library file. That makes more sense.
    Thanks!



  • Hi Again,

    I really feel stupid. I followed the download and unzip instructions and still I received exactly the same errors as in the beginning with an error on the MyGateway gw line.

    One thing I still cannot resolve is where the program (serial gateway in the MySensors folder) finds the "stdawg.h" file. All of the other associate files (.h, .cpp, etc) reside in the MySensors folder next to the Examples folder. Is it possible that, without this file, my MyGateway.h file is not being properly read?

    Thank you for your patience - Baran



  • Baran, just wondering, but did you try to copy and past JUST the library folder from the zip file into the same folder where your Arduino IDE's library folder is located. Let me make it clear that I'm not talking about pasting it into the Arduino library folder itself, but into the same folder that the Arduino's library folder is located. When you do this the computer will bring up a box that says you can't have two folders named library in this location and then ask if you want to consolidate them. You say yes and then they become one folder making it's so your Arduino IDE can find the now one library file.


 

306
Online

8.2k
Users

9.1k
Topics

96.7k
Posts