• Categories
    • Recent
    • Tags
    • Popular
    • Register
    • Login

    Req V_FORECAST with arduino 1.8.6

    Scheduled Pinned Locked Moved Troubleshooting
    5 Posts 2 Posters 615 Views 1 Watching
    Loading More Posts
    • 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.
    • skywatchS Offline
      skywatch
      last edited by skywatch

      Hello! - Me again! 😉

      I am trying to get a node to get data on node power up from the controller - I am sure it worked just a week or two ago, but now I cannot get it to work properly. The only thing that changed is update from arduino IDE 1.8.5 to 1.8.6.

      Here are the bits of the code that you'll want to see and maybe I have missed something whilst refining the code....

      ...init....
      #define CHILD_ID_GETFORECAST 4
      ......message....
      MyMessage msgGetForecast(CHILD_ID_GETFORECAST, V_FORECAST);
      ......presentation....
      present(CHILD_ID_GETFORECAST, S_BARO, "Forecast", true);
      .....request data.....
       request(CHILD_ID_GETFORECAST, V_FORECAST);
      .....receive function.....
      void receive(const MyMessage &message) {
         if (message.type == V_FORECAST) {
          forecast = (message.getString());
         }
          if (forecast == "stable"){
          Index = 0;}
          else if (forecast == "sunny"){
          Index = 1;}
          else if (forecast == "cloudy"){
          Index = 2;}
          else if (forecast == "unstable"){
          Index = 3;}
          else if (forecast == "thunderstorm"){
          Index = 4;}
          else if (forecast == "unknown"){
          Index = 5;}
      }
      
      

      If I use the resources>action>send raw data I can send any of the possible states and it works fine, so the receive works, just does not get the data to start with. I have tried putting the request in the end of 'setup' as well as in 'loop' but it just doesn't want to work now.

      jkandasaJ 1 Reply Last reply Reply Quote 0
      • jkandasaJ Offline
        jkandasa @skywatch
        last edited by

        @skywatch Can you check it in MyController resources log? Do you receive any request? Also, check it in MyController server log, is there any error reported?

        skywatchS 1 Reply Last reply Reply Quote 0
        • skywatchS Offline
          skywatch @jkandasa
          last edited by

          @jkandasa Nothing in the server log - I will check with the resources log today -

          I will also make a little 'test node' just to test this out as it was working before. It works when I send data to it, but does not receive data on start up request. Weird!

          Thanks!

          jkandasaJ 1 Reply Last reply Reply Quote 0
          • jkandasaJ Offline
            jkandasa @skywatch
            last edited by

            @skywatch

            add some wait statement before request(CHILD_ID_GETFORECAST, V_FORECAST);

            example:

            present(CHILD_ID_GETFORECAST, S_BARO, "Forecast", true);
            wait(200);
            
            request(CHILD_ID_GETFORECAST, V_FORECAST);
            wait(200);
            
            skywatchS 1 Reply Last reply Reply Quote 0
            • skywatchS Offline
              skywatch @jkandasa
              last edited by

              @jkandasa There are already wait(100); between nrf sends, and big (1000+uF) capacitors to buffer energy for the send.

              I have made progress and sent you an email with my findings.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post

              0

              Online

              587

              Users

              529

              Topics

              3.4k

              Posts
              Copyright © 2015-2025 MyController.org | Contributors | Localization