Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. timo4583
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    timo4583

    @timo4583

    1
    Reputation
    5
    Posts
    77
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    timo4583 Follow

    Best posts made by timo4583

    • RE: #error No forward link or gateway feature activated - when including MySensors

      @electrik Oh yes, that did the trick. Thank you so much

      posted in Development
      timo4583
      timo4583

    Latest posts made by timo4583

    • RE: #error No forward link or gateway feature activated - when including MySensors

      @electrik Oh yes, that did the trick. Thank you so much

      posted in Development
      timo4583
      timo4583
    • RE: #error No forward link or gateway feature activated - when including MySensors

      @electrik Okayy.. that makes me curious. Did you try the exact same files and code like in my first post and it compiles? Changing the order does not work for me.

      posted in Development
      timo4583
      timo4583
    • RE: #error No forward link or gateway feature activated - when including MySensors

      Thank you very much for your help. I found a solution which is a little ugly, but it works. Splitting to header(.h) and code(.cpp) files does somehow not work with MySensors, or Im not able to find the right solution.

      For now Im no creating a seperate code(.cpp) file and put evertything to the header(.h). This works:
      /src/main.cpp:

      #define MY_RADIO_RF24
      
      #include <MySensors.h>
      
      #include <Example.h>
      
      void setup() {}
      
      void presentation() {}
      
      void loop() {}
      

      src/Example.h:

      // HEADER PART
      #ifndef _example_
      #define _example_
      
      #include <Arduino.h>
      #include <MySensors.h>
      
      void someFunction(int test);
      
      // IMPLEMENTATION PART
      
      void someFunction(int test) {
          Serial.println(test);
      }
      
      #endif
      

      This way, it will be easy to split the files again, as soon as I find out how 🙂

      posted in Development
      timo4583
      timo4583
    • RE: #error No forward link or gateway feature activated - when including MySensors

      Yes. But the first line of my Code is selecting the nrf24 as radio. So it should work. And indeed it works if I comment out the include of my example :

      #define MY_RADIO_RF24
      
      #include <MySensors.h>
      
      // #include <Example.h>
      
      void setup() {}
      
      void loop() {}
      

      This works and compiles without error. It has to be something with the include of MySensors in the Example.h file. But I dont know why.

      edit:
      This is a corresponding github issue I found:
      https://github.com/mysensors/MySensors/issues/485 - But it has no solution 🙂

      posted in Development
      timo4583
      timo4583
    • #error No forward link or gateway feature activated - when including MySensors

      Hello everyone,

      I know this topic exists more than once in this forum, but I couldnt find a solution until now. Im not a c++ expert, so the solution might be obvious.
      Im always getting the mentioned error when splitting files and including <MySensors.h>

      here is the error then compiling:

      In file included from src/Example.h:5:0,
                       from src\Example.cpp:1:
      C:\Users\timo\.platformio\lib\MySensors_ID548/MySensors.h:426:2: error: #error No forward link or gateway feature activated. This means nowhere to send messages! Pretty pointless.
       #error No forward link or gateway feature activated. This means nowhere to send messages! Pretty pointless.
      

      And here is my simplified code... Im trying to write external files for recurring code over serveral projects.

      src/main.cpp:

      #define MY_RADIO_RF24
      
      #include <MySensors.h>
      
      #include <Example.h>
      
      void setup()
      {
      }
      
      void presentation()
      {
      }
      
      void loop()
      {
      }
      

      src/Example.h:

      #ifndef _example_
      #define _example_
      
      #include <Arduino.h>
      #include <MySensors.h>
      
      void someFunction(int test);
      
      #endif
      

      src/Example.cpp

      #include <Example.h>
      
      void someFunction(int test) {
          Serial.println(test);
      }
      

      Environment:

      • VS Code with PlatformIO
      • MySensor lib 2.3.1

      It seems that the <MySensors.h> - include in the example file has no access to my defined constants and somehow gets executed first?
      Im not able to get rid of this problem.

      It compiles successfully if I leave out the include of MySensors in the Example.h
      Any help is appreciated 🙂

      posted in Development
      timo4583
      timo4583