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

Req V_FORECAST with arduino 1.8.6

Scheduled Pinned Locked Moved Troubleshooting
5 Posts 2 Posters 713 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.
  • S Offline
    skywatch
    last edited by skywatch 10 Feb 2018, 20:12 30 Aug 2018, 16:18

    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.

    J 1 Reply Last reply 31 Aug 2018, 01:25 Reply Quote 0
    • J Offline
      jkandasa @skywatch
      last edited by 31 Aug 2018, 01:25

      @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?

      S 1 Reply Last reply 31 Aug 2018, 08:36 Reply Quote 0
      • S Offline
        skywatch @jkandasa
        last edited by 31 Aug 2018, 08:36

        @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!

        J 1 Reply Last reply 31 Aug 2018, 10:28 Reply Quote 0
        • J Offline
          jkandasa @skywatch
          last edited by 31 Aug 2018, 10:28

          @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);
          
          S 1 Reply Last reply 31 Aug 2018, 15:00 Reply Quote 0
          • S Offline
            skywatch @jkandasa
            last edited by 31 Aug 2018, 15:00

            @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
            3 out of 5
            • First post
              3/5
              Last post

            1

            Online

            632

            Users

            532

            Topics

            3.4k

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