Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Hardware
  3. Help needed

Help needed

Scheduled Pinned Locked Moved Hardware
9 Posts 4 Posters 5.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MarkV
    wrote on last edited by MarkV
    #1

    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)

    Moshe LivneM 1 Reply Last reply
    0
    • M MarkV

      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)

      Moshe LivneM Offline
      Moshe LivneM Offline
      Moshe Livne
      Hero Member
      wrote on last edited by Moshe Livne
      #2

      @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)

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MarkV
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • hekH Offline
          hekH Offline
          hek
          Admin
          wrote on last edited by
          #4

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

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

          1 Reply Last reply
          0
          • M Offline
            M Offline
            MarkV
            wrote on last edited by
            #5

            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 :-D

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

            1 Reply Last reply
            0
            • M Offline
              M Offline
              MarkV
              wrote on last edited by
              #6

              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???

              1 Reply Last reply
              0
              • M Offline
                M Offline
                MarkV
                wrote on last edited by
                #7

                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 :-(

                barduinoB 1 Reply Last reply
                0
                • M MarkV

                  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 :-(

                  barduinoB Offline
                  barduinoB Offline
                  barduino
                  wrote on last edited by
                  #8

                  @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

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    MarkV
                    wrote on last edited by
                    #9

                    SUPER!!!!!!!!

                    It works :-D
                    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??

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    14

                    Online

                    11.7k

                    Users

                    11.2k

                    Topics

                    113.1k

                    Posts


                    Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • MySensors
                    • OpenHardware.io
                    • Categories
                    • Recent
                    • Tags
                    • Popular