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. Troubleshooting
  3. Problem compiling sketch on library 1.5 DEVEL

Problem compiling sketch on library 1.5 DEVEL

Scheduled Pinned Locked Moved Troubleshooting
5 Posts 2 Posters 2.4k 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.
  • X Offline
    X Offline
    xefil
    wrote on last edited by
    #1

    Hello,

    I know it's in development, but I've moved to library 1.5 DEVEL to test the MQTT clientforwarder.
    Now, I'm trying to compile an old sketch that worked on previous libraries and it fails here:

    In file included from my-example.ino:17:0:
    
    \arduino-1.6.1\libraries\MySensors/MySensor.h:223:3: 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.
       ^
    my-example.ino:109:1: error: 'MySensor' does not name a type
    my-example.ino: In function 'void setup()':
    my-example.ino:129:3: error: 'gw' was not declared in this scope
    my-example.ino: In function 'void loop()':
    my-example.ino:190:3: error: 'gw' was not declared in this scope
    my-example.ino: In function 'void incomingMessage(const MyMessage&)':
    my-example.ino:298:6: error: 'gw' was not declared in this scope
    

    Line 109 is where i declare MySensor outside any void:

    MySensor gw;
    

    Line 129 in void setup() :

    gw.begin(incomingMessage, 20, true, 0);
    

    Line 190 - in void loop() :

    gw.process();
    

    Line 298 - in void incomingMessage(const MyMessage &message) {:

    gw.saveState(message.sensor, message.getBool());
    

    Any suggestion?

    Thanks!

    Simon

    korttomaK 1 Reply Last reply
    0
    • X xefil

      Hello,

      I know it's in development, but I've moved to library 1.5 DEVEL to test the MQTT clientforwarder.
      Now, I'm trying to compile an old sketch that worked on previous libraries and it fails here:

      In file included from my-example.ino:17:0:
      
      \arduino-1.6.1\libraries\MySensors/MySensor.h:223:3: 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.
         ^
      my-example.ino:109:1: error: 'MySensor' does not name a type
      my-example.ino: In function 'void setup()':
      my-example.ino:129:3: error: 'gw' was not declared in this scope
      my-example.ino: In function 'void loop()':
      my-example.ino:190:3: error: 'gw' was not declared in this scope
      my-example.ino: In function 'void incomingMessage(const MyMessage&)':
      my-example.ino:298:6: error: 'gw' was not declared in this scope
      

      Line 109 is where i declare MySensor outside any void:

      MySensor gw;
      

      Line 129 in void setup() :

      gw.begin(incomingMessage, 20, true, 0);
      

      Line 190 - in void loop() :

      gw.process();
      

      Line 298 - in void incomingMessage(const MyMessage &message) {:

      gw.saveState(message.sensor, message.getBool());
      

      Any suggestion?

      Thanks!

      Simon

      korttomaK Offline
      korttomaK Offline
      korttoma
      Hero Member
      wrote on last edited by
      #2

      Looking at the MySensors example sketches from the develoupment branch it seems like you can remove:

      MySensor gw;
      

      and from the rest just remove

      gw.
      
      • Tomas
      1 Reply Last reply
      0
      • X Offline
        X Offline
        xefil
        wrote on last edited by xefil
        #3

        Thanks @korttoma but, if I remove:

        MySensor gw;
        

        and then move from:

        gw.begin(incomingMessage, 20, true, 0);
        

        to:

        begin(incomingMessage, 20, true, 0);
        

        I get

        \arduino-1.6.1\libraries\MySensors/MySensor.h:223:3: 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.
           ^
        my-example.ino: In function 'void setup()':
        my-example.ino:128:37: error: 'begin' was not declared in this scope
        (...)
        
        1 Reply Last reply
        0
        • korttomaK Offline
          korttomaK Offline
          korttoma
          Hero Member
          wrote on last edited by korttoma
          #4

          I think you need to include MySensor.h after any configuration defines

          I found a post by @hek pointing to the following document -> https://docs.google.com/document/d/1NKq5uuNdnxF5jWnum7VT32mbKLjuvqlx2A5D1qQ-H3Q/edit#

          There I read:

          Converting sketch from 1.5 to to 2.0
          
          Add the following to activate NRF-radio support
          #define MY_RADIO_NRF24
          
          Remove MySensor constructor 
          MySensors gw; 
          
          Remove MySensors setup() call 
          gw.setup(....);
          
          If node expects incoming messages, add the following function to handle data:
          void receive(const MyMessage &msg) {}
          
          Move present() and sendSketchInfo() from setup() to a new function called presentation().
          void presentation() {
               sendSketchInfo(...)	
               present(...);
          }
          
          If you’re using static ids , add:
          #define MY_NODE_ID xx
          
          If static parent node is used, add:
          #define MY_PARENT_NODE_ID xx
          
          If you want node to be a repeater, add
          #define MY_REPEATER_FEATURE
          
          Remove all “gw.” before MySensors library calls.
          
          If node requests time using requestTime(), remove callback argument define define the following function to handle time response:
          void receiveTime(unsigned long ts) {
          }
          
          Make sure to include MySensor.h after any configuration defines.
          • Tomas
          1 Reply Last reply
          1
          • X Offline
            X Offline
            xefil
            wrote on last edited by
            #5

            Thanks a lot for pointing me to the right place! Now it compiles correctly.
            It's only to understand if it works. Cannot test it here right now. I'll do it soon!
            Thank you ;)

            Simon

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


            18

            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