• 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

    How to change the http sending value parameter

    User help
    3
    78
    20.3k
    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.
    • phildunlapP
      phildunlap
      last edited by

      With regards to B, I wonder if your server is holding the connection open after it sends the status 200 message?

      From my testing,

      while [ true ]; do nc -l 8899 <<< "HTTP/1.1 200 OK"; done
      

      will get updates every time a set a value in this setup. This is because the here-string "HTTP/1.1 200 OK" is sent in response and the connection is closed, then the server listens again.

      1 Reply Last reply Reply Quote 0
      • J
        jmatos
        last edited by

        Your help in this implementation has been very very useful. In the same "architecture" (BACnet/IP to HTTP) what is the best way to send a like point value time to time to work as a keep-alive. That is instead of sending the 'almnr' based on the actual alarm value will be sending say: '4999' on a time basis.

        thank you very much

        1 Reply Last reply Reply Quote 0
        • phildunlapP
          phildunlap
          last edited by phildunlap

          Hi jmatos,

          Glad to hear it.

          The "Send Regular Snapshot" feature of the publisher will send the latest value for all points in the set at that interval, but it sounds like you want a specific value set periodically. I would use a Scripting Data Source for that. Simply add the almnr point to the context (I will assume its variable name is almnr), run it on the cron you would like regular messages on the interval of, and have a script body:

          almnr.set(getPrefix() + "4999" + "0");
          

          But, perhaps as a keep alive you would be better served by adding a different point, 'keepAlive' to the publisher, and setting that to your keep alive value instead. Then your almnr point wouldn't be polluted by the keep alive sets, and you could even disable logging for the keep alive point (if you publisher is publishing all changes)

          J 1 Reply Last reply Reply Quote 0
          • J
            jmatos
            last edited by

            Hi phildunlap,

            I'm having troubles implement that last solution, but we what to buy one licence just like the MangoES. We can not order the computer itself because we'll have problems with CE certification. So...

              • What is the OS recommended by you? (the trial version as been working on Windows 7)
              • What is the price of the licence (like MangoES) that suits our needs; BACnet I/P to HTTP and all the data sources and script capability that we've talked about in this topic.

            Sorry I'm asking this to you. I already send a message to Joel but I'm not getting an answer and we need to step forward with the project.

            Thank you,
            Jose

            1 Reply Last reply Reply Quote 0
            • JoelHaggarJ
              JoelHaggar
              last edited by

              Sorry for not responding to your past email. I just sent you information about a special MangoES license.

              We highly recommend Linux and use debian based linux on our systems. The MangoES has 2GB of Ram and two quad core processors. What type of embedded computer will you use?

              1 Reply Last reply Reply Quote 0
              • J
                jmatos
                last edited by

                Hi Joel,

                For the OS we'are thinking about Ubuntu.

                What kind of computer may you advise? Solid State Disk is necessary, recommend? 4GB of RAM makes any difference? Intel processor or other?

                The limit of the license is to one computer or may we have a replica working with the same license in our office for support purpose?

                Thank you very much

                1 Reply Last reply Reply Quote 0
                • JoelHaggarJ
                  JoelHaggar
                  last edited by

                  That all depends on your application, number of data points, users, how much data you will be logging, etc. SSD is definitely nice. The license is for a single computer and you would need a separate license for each computer.

                  1 Reply Last reply Reply Quote 0
                  • J
                    jmatos @phildunlap
                    last edited by

                    @phildunlap

                    Hi phildunlap,

                    I'm a little bit confused with this implementation .

                    In fact I want to achieve two goals:

                    A) - I need to know if the BACnet server (the origin) is alive. For this I reserve a 48888 code to the 'almnr' variable. This have to be checked in a given period. How can I know if the BACnet server is alive (and well)?

                    B) - In the server that receives the HTTP (the destination) I must receive a 49999 code to the 'almnr' variable to tell that server that MANGO is alive. Is there a way to do this?

                    Thanks you,
                    Jose

                    1 Reply Last reply Reply Quote 0
                    • phildunlapP
                      phildunlap
                      last edited by

                      Hi jmatos,

                      Both cases sound like No Update detectors may do the trick.

                      A) If you create a 'no update' event handler on a BACnet point that you expect to get regular update, then you can go to the event handler page and create a 'Set Point' handler on the no update point event detector for the point. It would be configured to set 'almnr' to a static value, "48888"

                      B) The script suggestion earlier was to send a regular 49999. If instead it only needs to be sent if other things are not (as obviously Mango is up if it's sending messages at all), then you could put a 'no update' detector on the almnr point, then configure its handler to set almnr to a static value of "49999"

                      1 Reply Last reply Reply Quote 0
                      • J
                        jmatos
                        last edited by

                        Hi phildunlap

                        Great solution. Thanks.

                        Now for a twist... I want to sent a value to a BACnet point that is settable. I already set it by hand and it works find. May you please advise witch is the best to to - from another program - set remotely the value of a point?

                        May you give me an example?

                        Thank you,
                        Jose

                        1 Reply Last reply Reply Quote 0
                        • JoelHaggarJ
                          JoelHaggar
                          last edited by

                          Under the event handler you can add a "Set Point" type of hander on your event. Add the BACnet point you want to set when the event is active or inactive.

                          1 Reply Last reply Reply Quote 0
                          • J
                            jmatos
                            last edited by

                            I think I missed something... :(

                            Point = xyz

                            When I send a RESET must change xyz_value=3; sending ACK should change xyz_value=2: and SILENCE would change xyz_value=4.

                            1 Reply Last reply Reply Quote 0
                            • phildunlapP
                              phildunlap
                              last edited by

                              Are you saying there is the text string RESET, ACK, or SILENCE in one data point? This is a time to use a Point Link, something like,

                              //source point: the point getting RESET, ACK, SILENCE
                              //target point: xyz the point to set the value out to on your BACnet device
                              if(source.value == "RESET")
                                return 3;
                              else if(source.value == "ACK")
                                return 2;
                              else if(source.value == "SILENCE")
                                return 4;
                              else
                                throw "Unknown value for xyz set: " + source.value;
                              
                              J 2 Replies Last reply Reply Quote 0
                              • J
                                jmatos @phildunlap
                                last edited by

                                @phildunlap

                                Hi phildunlap,

                                Not exactly that. The text string is just my mnemonic.

                                I have this point that is 'settable' and is already created on MANGO and when I go to Data Point Details to that specific point I can put say the nr 2 in the 'set value box' and set it. This works OK...

                                Now, from an external program I need to send and set that or other values that point.

                                Witch will be the best way to do it?

                                Thanks,
                                Jose

                                1 Reply Last reply Reply Quote 0
                                • phildunlapP
                                  phildunlap
                                  last edited by

                                  Hi Jose,

                                  What sort of program? There are many ways. You probably want to use the HTTP Receiver data source, then you can set values to HTTP Receiver points through an HTTP GET. Here's a thread where I discussed the format: http://infiniteautomation.com/forum/topic/2187/how-to-use-publishers-http-sender/4 but the TLDR is that you'd send values with the parameter names as parameters in the /httpds?parameter=value section of the GET.

                                  Alternatively you could have a server socket in that program that can be interrogated for values, in which case I would look into using the TCP/IP data source.

                                  J 1 Reply Last reply Reply Quote 0
                                  • J
                                    jmatos @phildunlap
                                    last edited by

                                    @phildunlap

                                    It's working! :-)

                                    Thank you very much.

                                    1 Reply Last reply Reply Quote 0
                                    • phildunlapP
                                      phildunlap
                                      last edited by

                                      Glad to hear it!

                                      1 Reply Last reply Reply Quote 0
                                      • J
                                        jmatos @phildunlap
                                        last edited by jmatos

                                        @phildunlap said in How to change the http sending value parameter:

                                        Are you saying there is the text string RESET, ACK, or SILENCE in one data point? This is a time to use a Point Link, something like,

                                        //source point: the point getting RESET, ACK, SILENCE
                                        //target point: xyz the point to set the value out to on your BACnet device
                                        if(source.value == "RESET")
                                          return 3;
                                        else if(source.value == "ACK")
                                          return 2;
                                        else if(source.value == "SILENCE")
                                          return 4;
                                        else
                                          throw "Unknown value for xyz set: " + source.value;
                                        

                                        Hi phildunlap,

                                        I have tried to bring this code to the final solution with no success. :-(
                                        (I have make a "workaround" with http receiver, but this is not the real need)

                                        Objective:
                                        Send commands (a value) to a BACnet point by reading a string in a MySQL table.

                                        A) Get the string (word) after 'FNC="#' from the table logging column info.
                                        examples: FNC="#SILENCE SIRENES
                                        FNC="#RESET
                                        FNC="#SILENCE BUZZER

                                        B) Only send the command to a BACnet point IF the id changes

                                        'till now I have created a datasource SQL with the following statement:

                                        SELECT * FROM logging WHERE origin=4 AND type=8 AND info LIKE '%FNC="#%' ORDER BY id DESC LIMIT 1;
                                        

                                        and the result is:

                                        Column name	Value
                                        ID              512407
                                        Origin          4
                                        Type            8
                                        TimeStamp       2017-02-10 10:14:36.0
                                        Info            (other infos) FNC="#SILENCE SIRENES" (other infos)
                                        
                                        

                                        Now I having difficulty getting the value of the string and transfer it to a point only when the ID changes. Then date point will trigger the BACnet command translate the string as you first say in your code...

                                        Thanks in advance,
                                        Jose

                                        1 Reply Last reply Reply Quote 0
                                        • phildunlapP
                                          phildunlap
                                          last edited by

                                          Hi Jose,

                                          If I understand correctly, you have already gotten the ID and the Info into SQL data points. You could try a change detector on the ID point, has a Set Point event handler setting a new Alphanumeric point (probably a meta point would be best, one that executes on a cron with no context update, a cron like 0 0 0 1 1 ? 2099 ). The set point event handler will "Set to point value" and use the Info SQL point as the source point. Now you can create a point link from that new Alphanumeric Meta point to the outgoing BACnet point, and put whatever transformation logic you want in the point link.

                                          Alternatively (and perhaps more straightforwardly), you could use a scripting data source. Add the ID point to the context varName 'sqlMaxId', add the Info point to the context varName 'info', create a numeric (or multistate, I suppose) Scripting data point, varName 'lastHandledId', add the BACnet point to the context that you'd like to set varName 'dataOut' . Script executes on cron "0/1 * * * * ?" with a script body like....

                                          /* It looks like the strings in your info point aren't exactly these, so do be sure to modify this function as needed */
                                          function transformInfoToValue( infoValue ) {
                                            if(infoValue == "RESET")
                                              return 3;
                                            else if(infoValue == "ACK")
                                              return 2;
                                            else if(infoValue == "SILENCE")
                                              return 4;
                                            else
                                              throw "Unknown value for xyz set: " + source.value;
                                          }
                                          
                                          if( sqlMaxId.value != lastHandledId.value ) {
                                            lastHandledId.set( sqlMaxId.value );
                                            dataOut.set( transformInfoToValue( info.value ) );
                                          }
                                          

                                          This scripting solution won't work so well if your poll times for the SQL are less than two seconds, possibly.

                                          1 Reply Last reply Reply Quote 0
                                          • J
                                            jmatos
                                            last edited by jmatos

                                            Almost there... but, no I can not get the ID and the Info into SQL data points... :-(

                                            As you can notice, the info that I need to extract in among other alfanumeric characters in the field info.

                                            So, how can I get those into the SQL data points?

                                            Thanks in advance,
                                            Jose

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