• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    http builder buffer

    How-To
    4
    8
    937
    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.
    • R
      Robmalone
      last edited by

      Hi all,
      I currently have a http builder set up to send post data to a server. Recently there was an issue where the server was rejecting the password and the mango device was receiving a 401 response.
      Is there a way using the http builder to keep unsent post messages in a buffer and then to automatically send them when the server issue is resolved?

      Thanks.
      Rob

      terrypackerT 1 Reply Last reply Reply Quote 0
      • terrypackerT
        terrypacker @Robmalone
        last edited by

        @robmalone yes, the Script data source and Meta data points retain state while they are enabled. This means you could create an array that exists while the source/point is running to store failed messages. On each run you would check the array and if not empty then try to resend the messages.

        Just remember if you stop the point or data source that array will go away. If you need more resilience you could attempt to store the messages, that will be much more complex but is possible.

        R 1 Reply Last reply Reply Quote 0
        • R
          Robmalone @terrypacker
          last edited by

          Thanks @terrypacker.
          The messages are actually already being saved.
          The meta data point is an alphanumeric point pulling values from other modbus points and sending them together in one message.
          I'm afraid I'm not a programmer. Would you be able to help with the script?

          R 1 Reply Last reply Reply Quote 0
          • R
            Robmalone @Robmalone
            last edited by

            @MattFox I don't suppose you can help me with this please?

            MattFoxM 1 Reply Last reply Reply Quote 0
            • MattFoxM
              MattFox @Robmalone
              last edited by

              @robmalone pm sent

              Do not follow where the path may lead; go instead where there is no path.
              And leave a trail - Muriel Strode

              1 Reply Last reply Reply Quote 0
              • D
                DillFunlap
                last edited by

                One way I kept state in my various scripting data sources was to JSON.stringify the persistent state into an alphanumeric point on the scripting data source. Then if

                if ( typeof( state ) === 'undefined' )
                  state = JSON.parse( state_context_point.value );
                

                Of course, that would require doing this on any state change (or every script execution):

                state_context_point.set( JSON.stringify( state ) );
                

                But it gets the added benefit that now the state of your script is accessible to either review or fetch into other logic or dashboards or whatnot.

                MattFoxM 1 Reply Last reply Reply Quote 0
                • MattFoxM
                  MattFox @DillFunlap
                  last edited by

                  @dillfunlap exactly what we did.

                  And if you're who I think you are. Good to see you.

                  Do not follow where the path may lead; go instead where there is no path.
                  And leave a trail - Muriel Strode

                  D 1 Reply Last reply Reply Quote 1
                  • D
                    DillFunlap @MattFox
                    last edited by

                    @mattfox

                    Thanks Matt :). Nice to see some familiar faces here!

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