Can not compile serial gateway on codebender or ide



  • I have tried to compile the serial gateway code before uploading to my nano and I keep getting errors. I have used code bender and the IDE. Used the libraries from 1.4 and 1.5 with no difference.

    The below text is the error from codebender.

    *Looks like your project uses header files or libraries that do not exist in our system, in your personal libraries or in your sketch. More info

    In file included from (sketch file) SerialGateway.ino:50:
    (personal library file) MySensors/MySensor.h:158:70: error: unknown type name 'MyHwDriver'

        MySensor(MyTransport &radio =*new MyTransportNRF24(), MyHw &hw=*new MyHwDriver()
                                                                            ^
    

    (sketch file) SerialGateway.ino:71:1: error: unknown type name 'MyHwATMega328'

    MyHwATMega328 hw;
    ^
    *

    The below text is from Arduino IDE.

    *Arduino: 1.6.10 (Windows 10), Board: "Arduino Nano, ATmega168"

    In file included from X:\Program Files\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.cpp:12:0:

    X:\Program Files\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.h:39:28: error: 'DEFAULT_CE_PIN' was not declared in this scope

    MyGateway(uint8_t _cepin=DEFAULT_CE_PIN, uint8_t _cspin=DEFAULT_CS_PIN, uint8_t _inclusion_time = 1, int8_t _inclusion_pin=-1, int8_t _rx=-1, int8_t _tx=-1, int8_t _er=-1);

                            ^
    

    X:\Program Files\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.h:39:59: error: 'DEFAULT_CS_PIN' was not declared in this scope

    MyGateway(uint8_t _cepin=DEFAULT_CE_PIN, uint8_t _cspin=DEFAULT_CS_PIN, uint8_t _inclusion_time = 1, int8_t _inclusion_pin=-1, int8_t _rx=-1, int8_t _tx=-1, int8_t _er=-1);

                                                           ^
    

    X:\Program Files\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.cpp: In constructor 'MyGateway::MyGateway(uint8_t, uint8_t, uint8_t, int8_t, int8_t, int8_t, int8_t)':

    X:\Program Files\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.cpp:30:163: error: no matching function for call to 'MySensor::MySensor(uint8_t&, uint8_t&)'

    MyGateway::MyGateway(uint8_t _cepin, uint8_t _cspin, uint8_t _inclusion_time, int8_t _inclusion_pin, int8_t _rx, int8_t _tx, int8_t _er) : MySensor(_cepin, _cspin) {

                                                                                                                                                                   ^
    

    X:\Program Files\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.cpp:30:163: note: candidates are:

    In file included from X:\Program Files\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.h:15:0,

                 from X:\Program Files\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.cpp:12:
    

    X:\Program Files\Program Files (x86)\Arduino\libraries\MySensors\MySensor.h:158:2: note: MySensor::MySensor(MyTransport&, MyHw&)

    MySensor(MyTransport &radio =*new MyTransportNRF24(), MyHw &hw=*new MyHwDriver()

    ^

    X:\Program Files\Program Files (x86)\Arduino\libraries\MySensors\MySensor.h:158:2: note: no known conversion for argument 1 from 'uint8_t {aka unsigned char}' to 'MyTransport&'

    X:\Program Files\Program Files (x86)\Arduino\libraries\MySensors\MySensor.h:149:7: note: constexpr MySensor::MySensor(const MySensor&)

    class MySensor

       ^
    

    X:\Program Files\Program Files (x86)\Arduino\libraries\MySensors\MySensor.h:149:7: note: candidate expects 1 argument, 2 provided

    X:\Program Files\Program Files (x86)\Arduino\libraries\MySensors\MySensor.h:149:7: note: constexpr MySensor::MySensor(MySensor&&)

    X:\Program Files\Program Files (x86)\Arduino\libraries\MySensors\MySensor.h:149:7: note: candidate expects 1 argument, 2 provided

    X:\Program Files\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.cpp: In member function 'void MyGateway::begin(rf24_pa_dbm_e, uint8_t, rf24_datarate_e, void ()(char))':

    X:\Program Files\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.cpp:44:20: error: 'setupRepeaterMode' was not declared in this scope

    setupRepeaterMode();

                    ^
    

    X:\Program Files\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.cpp:87:39: error: 'setupRadio' was not declared in this scope

    setupRadio(paLevel, channel, dataRate);

                                       ^
    

    X:\Program Files\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.cpp:88:36: error: 'BASE_RADIO_ID' was not declared in this scope

    RF24::openReadingPipe(WRITE_PIPE, BASE_RADIO_ID);

                                    ^
    

    X:\Program Files\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.cpp:90:23: error: cannot call member function 'void RF24::startListening()' without object

    RF24::startListening();

                       ^
    

    exit status 1
    Error compiling for board Arduino Nano.
    Invalid library found in X:\Program Files\Program Files (x86)\Arduino\libraries\libraries: X:\Program Files\Program Files (x86)\Arduino\libraries\libraries

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

    Thanks in advance



  • i think you have to correct how the text i shown here, now it looks very strange.
    When you edit you can see how it will look like on the right side(if you use a computer)

    Is you libraries installed on drive X?



  • I had just copied the messages strait on to here, probably why it looks weird.

    I had the libraries in drive "x", They were added to the arduino libraries.



  • @mugs said:

    X:\Program Files\Program Files (x86)

    is it installed as shown above?

    I have it installed at

    C:\Program Files (x86)
    


  • Yeah thats how it was installed. I have removed it all and reinstalled it back on to C drive. Still getting errors.

    The example won't even compile directly on the codebender website

    https://codebender.cc/example/MySensor/SerialGateway#SerialGateway.ino



  • Do you have an ATmega168 or ATmega328?
    You have selected ATmega168



  • I am not sure :s.

    But would that even matter if I can't verify the code before attempting to upload?



  • @mugs
    You need to know what ATmega you have.

    Yes it matters because they have different memory size.

    I tried to compile Serial GW with Atmega168, not possible because sketch is too big.

    Try with ATmega328 instead



  • It is the 328 I have.



  • Just tried again and the errors are slightly different. Sorry about the formatting.

    Arduino: 1.6.10 (Windows 10), Board: "Arduino Nano, ATmega328"

    WARNING: Category '' in library UIPEthernet is not valid. Setting to 'Uncategorized'
    Build options changed, rebuilding all
    In file included from C:\Program Files (x86)\Arduino\libraries\MySensors\MySensor.h:28:0,

                 from C:\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.h:15,
    
                 from C:\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.cpp:12:
    

    C:\Program Files (x86)\Arduino\libraries\MySensors\MyTransportNRF24.h:38:30: error: 'RF24_CE_PIN' was not declared in this scope

    MyTransportNRF24(uint8_t ce=RF24_CE_PIN, uint8_t cs=RF24_CS_PIN, uint8_t paLevel=RF24_PA_LEVEL);

                              ^
    

    C:\Program Files (x86)\Arduino\libraries\MySensors\MyTransportNRF24.h:38:54: error: 'RF24_CS_PIN' was not declared in this scope

    MyTransportNRF24(uint8_t ce=RF24_CE_PIN, uint8_t cs=RF24_CS_PIN, uint8_t paLevel=RF24_PA_LEVEL);

                                                      ^
    

    C:\Program Files (x86)\Arduino\libraries\MySensors\MyTransportNRF24.h:38:83: error: 'RF24_PA_LEVEL' was not declared in this scope

    MyTransportNRF24(uint8_t ce=RF24_CE_PIN, uint8_t cs=RF24_CS_PIN, uint8_t paLevel=RF24_PA_LEVEL);

                                                                                   ^
    

    In file included from C:\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.h:15:0,

                 from C:\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.cpp:12:
    

    C:\Program Files (x86)\Arduino\libraries\MySensors\MySensor.h:158:53: error: call to 'MyTransportNRF24::MyTransportNRF24(uint8_t, uint8_t, uint8_t)' uses the default argument for parameter 1, which is not yet defined

    MySensor(MyTransport &radio =*new MyTransportNRF24(), MyHw &hw=*new MyHwDriver()

                                                     ^
    

    C:\Program Files (x86)\Arduino\libraries\MySensors\MySensor.h:158:53: error: call to 'MyTransportNRF24::MyTransportNRF24(uint8_t, uint8_t, uint8_t)' uses the default argument for parameter 2, which is not yet defined

    C:\Program Files (x86)\Arduino\libraries\MySensors\MySensor.h:158:53: error: call to 'MyTransportNRF24::MyTransportNRF24(uint8_t, uint8_t, uint8_t)' uses the default argument for parameter 3, which is not yet defined

    In file included from C:\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.cpp:12:0:

    C:\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.h:39:28: error: 'DEFAULT_CE_PIN' was not declared in this scope

    MyGateway(uint8_t _cepin=DEFAULT_CE_PIN, uint8_t _cspin=DEFAULT_CS_PIN, uint8_t _inclusion_time = 1, int8_t _inclusion_pin=-1, int8_t _rx=-1, int8_t _tx=-1, int8_t _er=-1);

                            ^
    

    C:\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.h:39:59: error: 'DEFAULT_CS_PIN' was not declared in this scope

    MyGateway(uint8_t _cepin=DEFAULT_CE_PIN, uint8_t _cspin=DEFAULT_CS_PIN, uint8_t _inclusion_time = 1, int8_t _inclusion_pin=-1, int8_t _rx=-1, int8_t _tx=-1, int8_t _er=-1);

                                                           ^
    

    In file included from C:\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.cpp:12:0:

    C:\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.h:42:36: error: 'RF24_PA_LEVEL_GW' was not declared in this scope

    void begin(rf24_pa_dbm_e paLevel=RF24_PA_LEVEL_GW, uint8_t channel=RF24_CHANNEL, rf24_datarate_e dataRate=RF24_DATARATE, void (*dataCallback)(char *)=NULL);

                                    ^
    

    C:\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.h:42:70: error: 'RF24_CHANNEL' was not declared in this scope

    void begin(rf24_pa_dbm_e paLevel=RF24_PA_LEVEL_GW, uint8_t channel=RF24_CHANNEL, rf24_datarate_e dataRate=RF24_DATARATE, void (*dataCallback)(char *)=NULL);

                                                                      ^
    

    C:\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.h:42:109: error: 'RF24_DATARATE' was not declared in this scope

    void begin(rf24_pa_dbm_e paLevel=RF24_PA_LEVEL_GW, uint8_t channel=RF24_CHANNEL, rf24_datarate_e dataRate=RF24_DATARATE, void (*dataCallback)(char *)=NULL);

                                                                                                             ^
    

    C:\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.cpp: In constructor 'MyGateway::MyGateway(uint8_t, uint8_t, uint8_t, int8_t, int8_t, int8_t, int8_t)':

    C:\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.cpp:30:163: error: no matching function for call to 'MySensor::MySensor(uint8_t&, uint8_t&)'

    MyGateway::MyGateway(uint8_t _cepin, uint8_t _cspin, uint8_t _inclusion_time, int8_t _inclusion_pin, int8_t _rx, int8_t _tx, int8_t _er) : MySensor(_cepin, _cspin) {

                                                                                                                                                                   ^
    

    C:\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.cpp:30:163: note: candidates are:

    In file included from C:\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.h:15:0,

                 from C:\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.cpp:12:
    

    C:\Program Files (x86)\Arduino\libraries\MySensors\MySensor.h:158:2: note: MySensor::MySensor(MyTransport&, MyHw&)

    MySensor(MyTransport &radio =*new MyTransportNRF24(), MyHw &hw=*new MyHwDriver()

    ^

    C:\Program Files (x86)\Arduino\libraries\MySensors\MySensor.h:158:2: note: no known conversion for argument 1 from 'uint8_t {aka unsigned char}' to 'MyTransport&'

    C:\Program Files (x86)\Arduino\libraries\MySensors\MySensor.h:149:7: note: constexpr MySensor::MySensor(const MySensor&)

    class MySensor

       ^
    

    C:\Program Files (x86)\Arduino\libraries\MySensors\MySensor.h:149:7: note: candidate expects 1 argument, 2 provided

    C:\Program Files (x86)\Arduino\libraries\MySensors\MySensor.h:149:7: note: constexpr MySensor::MySensor(MySensor&&)

    C:\Program Files (x86)\Arduino\libraries\MySensors\MySensor.h:149:7: note: candidate expects 1 argument, 2 provided

    C:\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.cpp: In member function 'void MyGateway::begin(rf24_pa_dbm_e, uint8_t, rf24_datarate_e, void ()(char))':

    C:\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.cpp:40:15: error: 'BAUD_RATE' was not declared in this scope

    Serial.begin(BAUD_RATE);

               ^
    

    C:\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.cpp:44:20: error: 'setupRepeaterMode' was not declared in this scope

    setupRepeaterMode();

                    ^
    

    C:\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.cpp:87:39: error: 'setupRadio' was not declared in this scope

    setupRadio(paLevel, channel, dataRate);

                                       ^
    

    C:\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.cpp:88:36: error: 'BASE_RADIO_ID' was not declared in this scope

    RF24::openReadingPipe(WRITE_PIPE, BASE_RADIO_ID);

                                    ^
    

    C:\Program Files (x86)\Arduino\libraries\MySensors\MyGateway.cpp:90:23: error: cannot call member function 'void RF24::startListening()' without object

    RF24::startListening();

                       ^
    

    exit status 1
    Error compiling for board Arduino Nano.

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



  • @mugs said:

    WARNING: Category '' in library UIPEthernet is not valid. Setting to 'Uncategorized'
    Build options changed, rebuilding all

    This is normal, I also get this.

    I am using Arduino 1.6.8, Arduino Board 1.6.12, MySensors 1.5.1, Windows 10

    I can Compile Serial GW, Nano 328 with no problem.

    Maybe you can try to install IDE 1.6.8



  • Check here
    https://forum.mysensors.org/topic/4570/mysensors-ethernet-gw-w5100-problem/5

    Problem with 1.6.9 and 1.6.10 but they were using MySensors 2.0



  • I have the exact versions as you now . Verified and uploaded perfectly.

    Thanks for your help



  • @mugs
    Nice, no problem.


Log in to reply
 

Suggested Topics

14
Online

11.4k
Users

11.1k
Topics

112.7k
Posts