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. Development
  3. No forward link or gateway feature activated, but I did.

No forward link or gateway feature activated, but I did.

Scheduled Pinned Locked Moved Development
sonoffesp8266library
7 Posts 3 Posters 3.0k Views 4 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.
  • nicomediaN Offline
    nicomediaN Offline
    nicomedia
    wrote on last edited by
    #1

    I made some code for a Sonoff relay, which has an esp8266 chipset. I defined MY_GATEWAY_ESP8266, but when I compile it gives me this error: No forward link or gateway feature activated.
    How can I solve it? I did define my gateway.

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Fabien
      wrote on last edited by
      #2

      @nicomedia said:

      No forward link or gateway feature activated.

      did you define the radio ?

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

        Did you define that before or after including MySensors.h?

        nicomediaN 1 Reply Last reply
        2
        • hekH hek

          Did you define that before or after including MySensors.h?

          nicomediaN Offline
          nicomediaN Offline
          nicomedia
          wrote on last edited by
          #4

          @hek Tried both, doesn't make a difference. I'll include my sketch below.

          #include <MySensors.h>
          #include <MyConfig.h>
          
          // Modalità debug
          //#define MY_DEBUG
          
          // Baud rate seriale mod. debug
          #define MY_BAUD_RATE 9600
          
          //#define MY_RADIO_NRF24
          //#define MY_RADIO_RFM69
          
          #define MY_GATEWAY_ESP8266
          
          #define MY_ESP8266_SSID "SSID"
          #define MY_ESP8266_PASSWORD "Password"
          
          //#define MY_USE_UDP
          
          #define MY_ESP8266_HOSTNAME "Sonoff1"
          
          //#define MY_IP_ADDRESS 192,168,178,87
          
          // If using static ip you need to define Gateway and Subnet address as well
          //#define MY_IP_GATEWAY_ADDRESS 192,168,178,1
          //#define MY_IP_SUBNET_ADDRESS 255,255,255,0
          
          //Porta in ascolto
          #define MY_PORT 5003
          
          // Numero massimo di client
          #define MY_GATEWAY_MAX_CLIENTS 2
          
          // Enable inclusion mode
          #define MY_INCLUSION_MODE_FEATURE
          
          // Enable Inclusion mode button on gateway
          // #define MY_INCLUSION_BUTTON_FEATURE
          // Set inclusion mode duration (in seconds)
          #define MY_INCLUSION_MODE_DURATION 60
          // Digital pin used for inclusion mode button
          #define MY_INCLUSION_MODE_BUTTON_PIN  3
          
          #define MY_REPEATER_FEATURE
          
          
          #define RELAY_1  12  // Pin del relè
          #define NUMBER_OF_RELAYS 1 // Numero di relè
          #define RELAY_ON 1  // Stato del pin per relè attivo
          #define RELAY_OFF 0 // Stato del pin per relè inattivo
          
          #if defined(MY_USE_UDP)
          #include <WiFiUdp.h>
          #endif
          
          #include <ESP8266WiFi.h>
          
          
          void before()
          {
            for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) {
              // Imposta il quale pin è quello del relè
              pinMode(pin, OUTPUT);
              // Imposta il relè allo stato precedente (in caso salti la luce)
              digitalWrite(pin, loadState(sensor)?RELAY_ON:RELAY_OFF);
            }
          }
          
          void setup()
          {
          }
          
          void presentation()
          {
          	  // Invia informazioni versione al gateway
            sendSketchInfo("Relay", "1.0");
          
            for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) {
              // Presenta i sensori locali al gateway
              present(sensor, S_BINARY);
            }
          }
          
          void receive(const MyMessage &message)
          {
            // Controllo il messaggio inviato
            if (message.type==V_STATUS) {
              // Cambia stato relè
              digitalWrite(message.sensor-1+RELAY_1, message.getBool()?RELAY_ON:RELAY_OFF);
              // Memorizza stato relè
              saveState(message.sensor, message.getBool());
              // Informazioni debug
              Serial.print("Cambiamento relè:");
              Serial.print(message.sensor);
              Serial.print(", Nuovo Stato:");
              Serial.println(message.getBool());
            }
          }
          
          
          void loop()
          {
          
          }
          1 Reply Last reply
          0
          • F Fabien

            @nicomedia said:

            No forward link or gateway feature activated.

            did you define the radio ?

            nicomediaN Offline
            nicomediaN Offline
            nicomedia
            wrote on last edited by
            #5

            @Fabien I did but I got the same error

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

              Always put the include after the defines. The sketch posted above is wrong and will fail at compile time. And remove the MyConfig.h include.

              nicomediaN 1 Reply Last reply
              3
              • hekH hek

                Always put the include after the defines. The sketch posted above is wrong and will fail at compile time. And remove the MyConfig.h include.

                nicomediaN Offline
                nicomediaN Offline
                nicomedia
                wrote on last edited by
                #7

                @hek That did it! I included the library with the Arduino IDE and it put it on the top. Didn't know that, thanks!

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


                5

                Online

                11.7k

                Users

                11.2k

                Topics

                113.0k

                Posts


                Copyright 2019 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