Help needed



  • I'd like to make a serial gw with a arduino mega2560 (maybe later a ethernet GW).

    I've downloaded the latest arduino sketch and loaded the serial gatweay.ino

    But when i try to load it to the arduino i'm getting errors.

    Arduino: 1.6.5 (Windows 7), Board:"Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"
    
    In file included from SerialGateway.ino:53:0:
    GatewayUtil.h:21: error: unterminated #ifndef
     #ifndef __GATEWAYUTIL_H__
     ^
    In file included from D:\Program Files\Arduino\libraries\MySensors/MyTransportRFM69.h:26:0,
                     from SerialGateway.ino:42:
    D:\Program Files\Arduino\libraries\MySensors/utility/RFM69.h:78:62: error: 'RF69_IRQ_PIN' was not declared in this scope
         RFM69(byte slaveSelectPin=RF69_SPI_CS, byte interruptPin=RF69_IRQ_PIN, bool isRFM69HW=false, byte interruptNum=RF69_IRQ_NUM) {
                                                                  ^
    D:\Program Files\Arduino\libraries\MySensors/utility/RFM69.h:78:116: error: 'RF69_IRQ_NUM' was not declared in this scope
         RFM69(byte slaveSelectPin=RF69_SPI_CS, byte interruptPin=RF69_IRQ_PIN, bool isRFM69HW=false, byte interruptNum=RF69_IRQ_NUM) {
                                                                                                                        ^
    In file included from SerialGateway.ino:42:0:
    D:\Program Files\Arduino\libraries\MySensors/MyTransportRFM69.h:33:145: error: 'RF69_IRQ_PIN' was not declared in this scope
      MyTransportRFM69(uint8_t freqBand=RFM69_FREQUENCY, uint8_t networkId=RFM69_NETWORKID, uint8_t slaveSelectPin=RF69_SPI_CS, uint8_t interruptPin=RF69_IRQ_PIN, bool isRFM69HW=false, uint8_t interruptNum=RF69_IRQ_NUM);
                                                                                                                                                     ^
    D:\Program Files\Arduino\libraries\MySensors/MyTransportRFM69.h:33:202: error: 'RF69_IRQ_NUM' was not declared in this scope
      MyTransportRFM69(uint8_t freqBand=RFM69_FREQUENCY, uint8_t networkId=RFM69_NETWORKID, uint8_t slaveSelectPin=RF69_SPI_CS, uint8_t interruptPin=RF69_IRQ_PIN, bool isRFM69HW=false, uint8_t interruptNum=RF69_IRQ_NUM);
                                                                                                                                                                                                              ^
    In file included from SerialGateway.ino:53:0:
    GatewayUtil.h:145: error: 'endif' does not name a type
     endif 
     ^
    unterminated #ifndef
    
      Dit rapport zou meer informatie hebben met
      "Tijdens de compilatie uitgebreide uitvoer weergeven"
      ingeschakeld in Bestand > Voorkeuren.
    

    What is wrong and what should be changed in order to make it work???

    (I'm a noob at arduino programming)


  • Hero Member

    @MarkV are you using rf69? did you follow the instructions for downloading the libraries and installing them in the arduino IDE (see http://www.mysensors.org/about/arduino, scroll down a little)



  • I've downloaded the libary and the latest version of Arduino sketch.
    Sketchbook location is: C:\Users\MarkV\Documents\Arduino
    Arduino Sketch location is: D:\Program Files\Arduino
    I've unzipped the mysensors zip file under my sketchbook location and also copied the libary files to D:\Program Files\Arduino\libary.

    Hardware i'm using for the gateway is:
    Arduino Mega 2560
    Ethernet shield WL5100
    NRF24L01+ 2.4GHz

    I'm not using a rf69.


  • Admin

    @MarkV, think I found the problem. Could you try out the development-branch?

    https://github.com/mysensors/Arduino/commit/1652d4b8209c9dd5f7ddfaccde3b887de586bbc1



  • I've copied the whole code from the development-branch and replaced this in the file.
    After that sketch didn't give any more error 😄

    U but what was wrong, just for me to learn a little bit about this?



  • I'm checking where i could change the pin settings.
    I believe because of the fact that i'm using a Mega the pin settings are different.
    Is there a way to make this in a file.
    Like when i'm using a mega i wil include for example a file called Mega2560.h and when i'm using a uno i have to include uno.h.
    so the settings are always wright???



  • Now it says:

    0;0;3;0;9;radio init fail
    

    I've connected my nRF24L01 on my Mega2560 and change the pin settings in the Myconfig.h.
    MISO = Pin 53
    MOSI = Pin 51
    SCK = Pin 52
    CSN = Pin 41
    CE = Pin 40
    IRQ not connected

    MyConfig.h code part looks like:

    /**********************************
    *  NRF24L01 Driver Defaults
    ***********************************/
    #define RF24_CE_PIN		   40
    #define RF24_CS_PIN		   41
    

    All the wiring checked, no problems.
    Why do i keep getting the radio init fail 😞



  • @MarkV
    I have different pins for the mega.
    Here is a picture from a forum user.

    1428958756089-edited-mega2560_r3_label-small-v2-2.png

    MISO: 50
    MOSI: 51
    SCK: 52
    SS: 53

    I have my mega connected in MISO, MOSI, SCK (50,51,52) and CSN, CE in the default library pins (10,9).

    If you need to change the CS and CE pins, you don't need to change the library default pins, you can do it when you instantiante the library, something like this:

    // SPI Pins
    #define CE_PIN 9
    #define CS_PIN 10
    
    // Instanciate MySersors Gateway
    MySensor gw(CE_PIN,CS_PIN);
    
    

    Cheers



  • SUPER!!!!!!!!

    It works 😄
    Thats for my first Serial gateway, now i'm going to have a look if i can convert it to the ethernet version.

    An other question:
    Is it also possible to make a gateway wich can controle multiple receivers??
    For example, the RF24L01 with a 434Mhz receiver etc??


Log in to reply
 

Suggested Topics

  • 87
  • 6
  • 5
  • 1
  • 7
  • 7

1
Online

11.4k
Users

11.1k
Topics

112.7k
Posts