• header.categories
    • header.recent
    • header.tags
    • header.popular
    • register
    • login

    Req V_FORECAST with arduino 1.8.6

    scheduled pinned locked moved Troubleshooting
    5 posts 2 posters 816 views 1 watching
    loading-more-posts
    • oldest-to-newest
    • newest-to-oldest
    • most-votes
    reply
    • reply-as-topic
    guest-login-reply
    deleted-message
    • skywatchS offline
      skywatch
      global: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 one-reply-to-this-post last-reply-time reply quote 0
      • jkandasaJ offline
        jkandasa @skywatch
        global: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 one-reply-to-this-post last-reply-time reply quote 0
        • skywatchS offline
          skywatch @jkandasa
          global: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 one-reply-to-this-post last-reply-time reply quote 0
          • jkandasaJ offline
            jkandasa @skywatch
            global: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 one-reply-to-this-post last-reply-time reply quote 0
            • skywatchS offline
              skywatch @jkandasa
              global: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.

              one-reply-to-this-post last-reply-time reply quote 0
              • first-post
                last-post

              0

              online

              644

              users

              532

              topics

              3.4k

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