• C
    crutherf

    Does anyone know the proper syntax for the Analytics Object "time" functions in the metadata source in Mango 1.12.0? Does it work? When I use the following syntax, I get no error messages, but ALWAYS 0.0 as a result.

    return pxxxx.past(DAY, 30).maximum.time

    The idea is to find the time at which the maximum value occurred in the past 30 days. Any help would be appreciated

    Craig

    posted in How-To read more
  • C
    crutherf

    I'm working on some custom views that need the current value of a particular datapoint available as a JS variable. If I declare the variable in my JS header info, and then try to update using the form:

    var x = value;

    within the script section of the scriptPoint tag, this doesn't update the previously declared JS variable (even though "value" is functional and clearly available based on other tests). Is there a straightforward method of achieving this? It doesn't have to utilize the scriptPoint function. If this isn't possible currently, is there a way to do this through a global script?

    Thanks,
    Craig

    posted in How-To read more
  • C
    crutherf

    I have a new sensor I'm trying to test which utilizes a server based datalogger with forwarding via HTTP GET or POST. In order to properly acknowledge the GET, a specific epilogue must be received by the server in order to complete the transaction. I have set the epilogue up for an HTTP receiver using the directions in the help files, and confirmed that it is properly entered in the database using a PHPadmin tool. The issue is that whenever I actually send a GET operation to the HTTP receiver in Mango, it responds with the "200 OK" and 2 copies of the epilogue. Unfortunately, the sending server rejects this response although the first half of the double epilogue matches its requirement exactly (it says "check URL" expected "X" received "XX" where X is the epilogue and XX is the epilogue twice with no space between them). So far I have tested this in 1.12.0, 1.12.4, and 1.13.0 with the same result. It also appears if you use the httpds example in the "help" text (the resulting page shows an unconsumed key wrapped in two copies of the epilogue text although there is no prologue... I even tried putting in an empty field in the prologue to see if that killed the double epilogue with no luck).

    Any idea what might be causing this, and how to stop it? This will be a dealbreaker for this data source if I can't get it figured out.

    Thanks,
    Craig

    posted in User help read more
  • C
    crutherf

    Jasbir,

    So now you have the two instances (or internally in the one instance) communicating right? (you can pass the "static data"). In order to pass real data in the body and store it, try the following.

    1. if you have some real data points to send, make a new publisher like the one we did previously. Make sure you save the publisher. I don't think Mango will let you add real datapoints until you save the publisher. If you don't have any real data to pass yet then make a "Virtual Data Source" and add a point to make random numbers every 30 seconds or so.
    2. Now we're going to add data points to the publisher. Select one of your real data points that you have or the one you made as a "Virtual Data Source" in the pull down menu at the bottom of the page. Select one or more datapoints to send.
    3. In order to properly send the data, you will have to name the "parameter" (datapoint). This is the same parameter name you will use on the HTTP Receiver end to listen for the datapoint and add it to your database. Make sure that you have selected "All Updates" on the "update events" box. This means that any time a new datapoint changes in a way that the sending instance considers worthy of logging it will send the value to your receiver (timestamp, value or either depending on how your logging is setup).
    4. On the receiver end, you will need to setup the points you are listening for. In the HTTP Receiver that you have already confirmed is sending static data (from the previous exercise), you will need to add some receiver points. Again, you have to save the HTTP Receiver, or it won't let you add data points. Once you do this, you can add a new receiver point by clicking the green circle with the arrow at the bottom of the screen. The new point should be of the same data type as the publisher (binary, numeric, alphanumeric, etc). You will also need to put the exact same parameter name here as you put in the publisher for the data point (this is case sensitive so it has to be EXACT). Save the datapoint once you have entered all of the information.
    5. Now that you have a data point configured, make sure you turn the datapoint on, and the data source. You can click on the red balls for the datapoint and the data source to toggle them green. The receiver will only receive and store data if these are green. Also, make sure that your HTTP Publisher has the "Enabled" checkbox checked (or that there is a green ball on the status under the "Publishers" page)
    6. that's really it.... you should now be passing and storing data for the datapoint you added. If you want to quickly confirm this, you can click on the "Watchlist" and add the point you just added to the current watchlist (so you can see the most recent value, and some charting over time).

    Hope this helps,
    Craig

    posted in How-To read more
  • C
    crutherf

    Thanks Matt,

    That was the info I needed to figure it out. I didn't realize I could apply the "help" to drill down. I put in the following script:

    return p1164.past(HOUR, 24).help

    And got the response:

    Could not convert result "{minimum: 83.013917, minTime=1361337619432, maximum: 307.904591, maxTime=1361383219432, average: 161.63032972540182, sum: 93298.89984499985, count: 576, noData: false, realStart: 1361299318262, end: 1361385718262}" to Numeric

    So it looks like "minTime" and "maxTime" is the proper syntax (I tried this earlier, but I think I put "mintime" and "maxtime" which returns the same 0.0)

    Thanks for the help.

    Craig

    posted in How-To read more
  • C
    crutherf

    Thanks for the quick response Matt. Tried that with the same result ("Success. result=0.0"). .maximumTime, .maximumtime, .maximum_time, and .maximum.time all give that same response, but if I give a known bad (.maximum time or .time.maximum for example) I still get a script error (type errors or other).

    Confused.

    Craig

    posted in How-To read more
  • C
    crutherf

    Jasbir,

    I've found the following helpful for first-time troubleshooting:

    1. open up the publisher in one window, and the retriever in another, and open both the publisher and receiver for editing.
    2. make sure the HTTP receiver is "listening" (click the "Listen for HTTP data" button), and for this test, leave devices and IP white lists at "" and "...*" respectively
    3. in the HTTP publisher. Make sure that the URL you are sending to (the HTTP receiver) is correct and in the form http://xxx.xxx.xxx.xxx:8080/httpds (if sending between machines) or http://localhost:8080/httpds if you're sending within the same machine.
    4. add some static information, for example, add a device in the "static parameters" filed called : Key: __device, Value: test and hit the green "+" to add the parameter. Now save this publisher using either a GET or POST method.
    5. push the "Send Static Data" button in your publisher. You should see a message show up in the listener window on the receiver.

    This will get you started confirming a link. Once you've done that you can add points, setup whitelists for more secure connections, etc.

    Craig

    posted in How-To read more
  • C
    crutherf

    Does anyone know the proper syntax for the Analytics Object "time" functions in the metadata source in Mango 1.12.0? Does it work? When I use the following syntax, I get no error messages, but ALWAYS 0.0 as a result.

    return pxxxx.past(DAY, 30).maximum.time

    The idea is to find the time at which the maximum value occurred in the past 30 days. Any help would be appreciated

    Craig

    posted in How-To read more
  • C
    crutherf

    I'm working on some custom views that need the current value of a particular datapoint available as a JS variable. If I declare the variable in my JS header info, and then try to update using the form:

    var x = value;

    within the script section of the scriptPoint tag, this doesn't update the previously declared JS variable (even though "value" is functional and clearly available based on other tests). Is there a straightforward method of achieving this? It doesn't have to utilize the scriptPoint function. If this isn't possible currently, is there a way to do this through a global script?

    Thanks,
    Craig

    posted in How-To read more