• terrypacker

    @mseverin the input on the page expects the local path to the db corresponding to the machine you are accessing. In later versions of Mango this is mah2.199, check the filename of the h2 dB file on your Mango machine and use the full path to the h2 file minus the .db extension. I don’t think you want the tcp url, use the file:// style.

    posted in Mango Automation general Discussion read more
  • terrypacker

    At this point it will be part of Mango 4.0 which will come out in the next few months. We are currently working towards that release.

    posted in Mango feedback read more
  • terrypacker

    @andrewh we will be adding that in the next version of Mango but for now it is not available in the new UI.

    posted in Mango feedback read more
  • terrypacker

    @nathanRona I just did a quick test against test.mosquitto.org and was able to publish and receive JSON with Timestamp based values. I'm posting the JSON config so you can import it and see for yourself. I can't see exactly what is wrong with your setup but this confirms that it does in fact work. In the configuration I'm providing there are 2 data points, when you set the value for one it will publish to the receiving topic of the other.

    {
      "dataSources":[
        {
          "xid":"DS_b911d1a5-dcfd-424d-ab07-77134185f2a8",
          "name":"Test.Mosquitto.ORG Client",
          "enabled":true,
          "type":"MqttClient",
          "alarmLevels":{
            "DATA_SOURCE_EXCEPTION_EVENT":"URGENT",
            "MQTT_CONNECTION_FAILURE_EVENT":"URGENT",
            "MQTT_PUBLISH_FAILURE_EVENT":"URGENT",
            "POINT_READ_EXCEPTION_EVENT":"URGENT",
            "MQTT_UNKNOWN_TOPIC":"IGNORE",
            "POINT_WRITE_EXCEPTION_EVENT":"URGENT"
          },
          "purgeType":"YEARS",
          "brokerUri":"tcp:\/\/test.mosquitto.org:1883",
          "x509CaCrt":"",
          "clientId":"Mango Automation MQTT Client 148709547341099",
          "userName":"",
          "userPassword":"",
          "topicFilters":"infiniteautomation\/test\/#",
          "autoReconnect":true,
          "cleanSession":true,
          "keepAliveInterval":60,
          "connectionTimeout":30,
          "qosType":"EXACTLY_ONCE",
          "editPermission":"",
          "purgeOverride":false,
          "purgePeriod":1
        }
      ],
      "dataPoints":[
        {
          "xid":"DP_ba31c77f-9c4f-4f02-802c-afcfae830441",
          "name":"number",
          "enabled":true,
          "loggingType":"ALL",
          "intervalLoggingPeriodType":"MINUTES",
          "intervalLoggingType":"AVERAGE",
          "purgeType":"YEARS",
          "pointLocator":{
            "dataType":"NUMERIC",
            "subscribeTopicType":"JSON_WITH_TIMESTAMP",
            "subscribeJsonTimestampPath":"\/ts",
            "subscribeJsonTimestampPattern":"yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSSX",
            "subscribeJsonValuePath":"\/d",
            "subscribeTopic":"infiniteautomation\/test\/number",
            "publishTopicType":"JSON_WITH_TIMESTAMP",
            "publishJsonTimestampName":"ts",
            "publishJsonTimestampPattern":"yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSSX",
            "publishJsonTimestampZone":"UTC",
            "publishJsonValueName":"d",
            "publishTopic":"infiniteautomation\/test\/set\/number"
          },
          "eventDetectors":[
          ],
          "plotType":"STEP",
          "rollup":"NONE",
          "unit":"s",
          "simplifyType":"NONE",
          "chartColour":"",
          "chartRenderer":{
            "type":"IMAGE",
            "timePeriodType":"DAYS",
            "numberOfPeriods":1
          },
          "dataSourceXid":"DS_b911d1a5-dcfd-424d-ab07-77134185f2a8",
          "defaultCacheSize":1,
          "deviceName":"Test.Mosquitto.ORG Client",
          "discardExtremeValues":false,
          "discardHighLimit":1.7976931348623157E308,
          "discardLowLimit":-1.7976931348623157E308,
          "intervalLoggingPeriod":1,
          "intervalLoggingSampleWindowSize":0,
          "overrideIntervalLoggingSamples":false,
          "preventSetExtremeValues":false,
          "purgeOverride":false,
          "purgePeriod":1,
          "readPermission":"",
          "setExtremeHighLimit":1.7976931348623157E308,
          "setExtremeLowLimit":-1.7976931348623157E308,
          "setPermission":"",
          "tags":{
          },
          "textRenderer":{
            "type":"ANALOG",
            "useUnitAsSuffix":true,
            "format":"0.00"
          },
          "tolerance":0.0
        },
        {
          "xid":"DP_0460c207-8a22-4b7c-92b6-ab70c1c41d1c",
          "name":"number-recieve",
          "enabled":true,
          "loggingType":"ALL",
          "intervalLoggingPeriodType":"MINUTES",
          "intervalLoggingType":"INSTANT",
          "purgeType":"YEARS",
          "pointLocator":{
            "dataType":"NUMERIC",
            "subscribeTopicType":"JSON_WITH_TIMESTAMP",
            "subscribeJsonTimestampPath":"\/ts",
            "subscribeJsonTimestampPattern":"yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSSX",
            "subscribeJsonValuePath":"\/d",
            "subscribeTopic":"infiniteautomation\/test\/set\/number",
            "publishTopicType":"JSON_WITH_TIMESTAMP",
            "publishJsonTimestampName":"ts",
            "publishJsonTimestampPattern":"yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSSX",
            "publishJsonTimestampZone":"UTC",
            "publishJsonValueName":"d",
            "publishTopic":"infiniteautomation\/test\/number"
          },
          "eventDetectors":[
          ],
          "plotType":"STEP",
          "rollup":"NONE",
          "unit":"s",
          "simplifyType":"NONE",
          "chartColour":"",
          "chartRenderer":{
            "type":"IMAGE",
            "timePeriodType":"DAYS",
            "numberOfPeriods":1
          },
          "dataSourceXid":"DS_b911d1a5-dcfd-424d-ab07-77134185f2a8",
          "defaultCacheSize":1,
          "deviceName":"Test.Mosquitto.ORG Client",
          "discardExtremeValues":false,
          "discardHighLimit":1.7976931348623157E308,
          "discardLowLimit":-1.7976931348623157E308,
          "intervalLoggingPeriod":15,
          "intervalLoggingSampleWindowSize":0,
          "overrideIntervalLoggingSamples":false,
          "preventSetExtremeValues":false,
          "purgeOverride":false,
          "purgePeriod":1,
          "readPermission":"",
          "setExtremeHighLimit":1.7976931348623157E308,
          "setExtremeLowLimit":-1.7976931348623157E308,
          "setPermission":"",
          "tags":{
          },
          "textRenderer":{
            "type":"ANALOG",
            "useUnitAsSuffix":true,
            "format":"0.00"
          },
          "tolerance":0.0
        }
      ]
    }
    

    posted in User help read more
  • terrypacker

    @nathanRona your JSON format doesn't seem right. I'm not 100% sure how to handle arrays but if you can change the format to this it will work:

    {
      "post": {
         "0": "20191223131022",
         "1": 10  
      }
    }
    

    I would suggest this as it makes more sense:

    {
      "post": {
         "date": "20191223131022",
         "value": 10  
      }
    }
    

    and then set your JSON pointer for value to /post/value and the time pointer to post/date.

    posted in User help read more
  • terrypacker

    No worries,

    Sorry about that you are right, that was a node.js code snippet not JSON. And yes those codes are also very common. In v3 of the REST api we are going to put some effort into making the Swagger output accurate AND useful...

    posted in User help read more
  • terrypacker

    @Balistar there are many permutations of creating a data point but this should give you a decent start:

    https://github.com/infiniteautomation/ma-modules-public/blob/85658f8eed2e681c00c0511c9264c4901be87670/Mango API/api-test/dataPoint.spec.js#L167

    specifically:

    {
      name: 'Node mango client test 2',
      dataSourceXid : 'mango_client_test',
      pointLocator : {
           startValue : '0',
           modelType : 'PL.VIRTUAL',
           dataType : 'NUMERIC',
           settable : false,
           changeType : 'BROWNIAN',
           max: 100,
           maxChange: 0.01,
           min: 0
        }
    }
    

    As for error code documentation, our Swagger documentation isn't complete so that will have to be trial and error, Generally these are the only errors you will get from our controllers:

    500 - Server error
    422 - Validation error
    404 - item not found
    400 - Bad Request

    posted in User help read more
  • terrypacker

    @ORU_david ,

    I just freed up over 1G of space by deleting some very old backups. It seems the bulk of your disk space is being taken up by Mango's NoSQL data and its incremental backups. Since you are pushing data out of this system over the Persistent publisher I suggest you change those settings to only keep a few days of data, especially if you are backing up data at the publish destination. Basically just keep enough data locally to persist across network outages.

    The current state of affairs:

    mango@MangoES:/$ df -h
    Filesystem      Size  Used Avail Use% Mounted on
    /dev/mmcblk0p2  7.1G  5.9G  861M  88% /
    
    mango@MangoES:/opt$ du -sh mango/
    3.6G	mango/
    mango@MangoES:/opt/mango$ du -sh backup/
    698M	backup/
    mango@MangoES:/opt/mango$ du -sh databases/
    2.4G	databases/
    mango@MangoES:/opt/mango/databases$ du -sh mangoTSDB/
    2.3G	mangoTSDB/
    

    posted in Hardware read more
  • terrypacker

    @ORU_david yes your drive is full. You will need to clear out some disk space and this is very system dependent. I would start by checking /opt/mango/logs and /opt/mango/backup

    It does not appear that you have much in your databases so this will be due to files accumulating somewhere on the file system outside the database.

    posted in Hardware read more
  • terrypacker

    @Phillip-Weeks I just implemented a Scripting Data source that runs this script and see no errors on Mango 3.6.6?

    var dataPoints = JSON.parse(JsonEmport.dataPointQuery("eq(name,Voltage)&limit(1000)")).dataPoints;
    print(JsonEmport.dataPointQuery("eq(name,Voltage)&limit(1000)"));
    

    I am searching for a point named Voltage

    Output:

    
    "dataPoints":[
    {
    "xid":"voltage",
    "name":"Voltage",
    "enabled":true,
    "loggingType":"ON_CHANGE",
    "intervalLoggingPeriodType":"MINUTES",
    "intervalLoggingType":"INSTANT",
    "purgeType":"YEARS",
    "pointLocator":{
    "dataType":"NUMERIC",
    "changeType":{
    "type":"BROWNIAN",
    "max":100.0,
    "maxChange":0.01,
    "min":0.0,
    "startValue":"1"
    },
    "settable":true
    },
    "eventDetectors":null,
    "plotType":"STEP",
    "rollup":"NONE",
    "unit":"V",
    "simplifyType":"NONE",
    "chartColour":"",
    "chartRenderer":null,
    "dataSourceXid":"DS_997094",
    "defaultCacheSize":1,
    "deviceName":"Dashboard Demo",
    "discardExtremeValues":false,
    "discardHighLimit":0.0,
    "discardLowLimit":0.0,
    "intervalLoggingPeriod":15,
    "intervalLoggingSampleWindowSize":0,
    "overrideIntervalLoggingSamples":false,
    "preventSetExtremeValues":false,
    "purgeOverride":false,
    "purgePeriod":1,
    "readPermission":"user",
    "setExtremeHighLimit":1.7976931348623157E308,
    "setExtremeLowLimit":-1.7976931348623157E308,
    "setPermission":"",
    "tags":null,
    "textRenderer":{
    "type":"ANALOG",
    "useUnitAsSuffix":true,
    "format":"#.00"
    },
    "tolerance":0.0
    }
    ]
    }
    

    The cause must be specific to your system. Perhaps that specific point is corrupt? Try another point and if that doesn't work take a look at the logs and see if anything is being output about the error.

    Thanks.

    posted in How-To read more