To use a specific Timezone:
DateTimeFormatter dateTimeFormatter = DateTimeFormat.forPattern("MM/dd/yyyy HH:mm").withZone(DateTimeZone.UTC);
Just wanted to let you know we have updated our developers documentation. We have separated it into 2 parts, Angular for the UI and Java for the backend. As of Mango 3.7 there is a new 'development' mode that can save time developing. Check them out here:
But i don't know how to update this files in my mango installation...
It will be far easier for you to upgrade to Mango 2.6.0 that has all the work done for you. It will be pre-released very soon.
If you are game to give it a try, here is some documentation on the SQL api for Java:
As a side note Mango 4.0 will have a Message event handler that will allow using Twilio and in the future other platforms to send messages.
Sorry, our maven repository only holds the latest snapshot versions and lets the older ones roll off. The latest version is
3.6.1-SNAPSHOT for the api module. Since that version will also eventually drop off of the repository I would suggest you use the release version of the api module as that will always be available. So change the dependency from
3.6.0 and you should be good to go.
@MattFox just letting you know I've tried in the past to fix this but didn't have much luck. But I tried again today and managed to make an improvement. There are likely other models that will suffer from this problem so when Mango 3.7.0 is released if you see any more of these types of problems please let us know.
Here is the git issue if you are interested in following:
There is no way to currently get a list of realtime values for multiple points by filtering by data point XID. The next release of Mango will have some RQL endpoints. I can see if I can put it in for the realtime endpoint, this would allow you to perform SQL-like queries via the URL such as:
More on RQL here: https://github.com/persvr/rql
For now you could just request ALL the realtime data and filter it by XID on the client side. See this:
Where the limit is greater than or equal to the number of points in your Point Hierarchy.
@BG I am pretty sure there will be no problems with the versions of MariaDB that support JSON columns. To make a long story short we have not tested it with MariaDB but the only place we use the
JSON type column so far is in the create table script for the
users table so the alias they have will be fine on that statement.
In the future we may actually create queries that introspect the data in that column but this will likely be for custom modules and not part of the standard Mango application. Also H2 does not support
JSON column types so all of our queries basically use that column as a
LONGTEXT type currently.
@cmusselm the logging mechanism displays the entire message and uses the same code to convert the input from a byte array into a Hex String as the logic that saves the matched String to the point. My guess is that since it is displaying in the log correctly that you are not matching the entire message to save into the point?
You can get some detailed logging by enabling debug logging for that data source, this might point you in the right direction. Add this to the log4j2.xml configuration and reload it:
<AsyncLogger name="com.infiniteautomation.serial.rt.SerialDataSourceRT" includeLocation="true" level="debug"/>
@cnmlscada Mango doesn't default to use port 8443, you must configure SSL for this to happen. It looks to me like Mango is finding a different properties file then the one you think it is using. Here is the search precedence in Mango 4:
# Config file (mango.properties) search path: # $mango_config # $MA_ENV_PROPERTIES (legacy environment variable) # $mango_paths_data/mango.properties # $mango_paths_data/env.properties # ~/mango.properties # $mango_paths_home/env.properties (legacy location) # $mango_paths_home/overrides/properties/env.properties (legacy location)
@till When using this tool it is best to use an absolute path to the database and also note it doesn't want the extension. So on my system the file in the Mango databases folder is named
So the URL I'm using is:
@cmusselm if they were HTTP requests you could try the HTTP data source(s) or in 4.0 you can write a script in the filestore and process POST requests with it. Since you didn't mention that I'll assume they are some custom TCP/IP protocol of the device.
You could try using a Serial data source (which is event driven by messages on the wire). In this setup you would use either a physical TCP/IP to Serial converter or try a Mango Virtual Serial Port listening on the chosen TCP Port.
@till there is a limit on the size of a value for Alphanumeric points in the NoSQL database, you won't be able to get around that. However we do have an auxiliary database for doing something like what you want. We call it the Mango data store. There aren't many examples around using it in a script but I could probably help you out.
There isn't a length restriction on the point data store AFAIK so this should be able to store much large JSON strings. The following is from a Scripting Data Source I just wrote that has a Virtual point in the external context with the key (variable name) of
//get the point data dao (assuming Mango NoSQL module is installed) var pointDataDao = com.serotonin.m2m2.Common.databaseProxy.noSQLProxy.createPointDataDao(); //get the common object mapper to convert Json var objectMapper = com.serotonin.m2m2.Common.getBean( com.fasterxml.jackson.databind.ObjectMapper.class, 'commonObjectMapper'); //Create empty object var data = objectMapper.createObjectNode(); data.put("numberValue", 1.0); //Get the time at which to store the data against: var dataTime = com.serotonin.m2m2.Common.timer.currentTimeMillis(); //Create data to save (a PointDataTime object) var dataToSave = new com.infiniteautomation.nosql.PointDataTime( dataTime, data); //Save this to the data point at the given time pointDataDao.savePointDataTime(storage.id, dataToSave); //Get the data back out print(pointDataDao.getPointDataTimeAt(storage.id, dataTime).getData());
The output of this script is:
As for publishing this data, it won't work using the Persistent TCP publisher/data source as that only works with point values, you would have the same problem with the JSON store. If you wanted to push this to another instance you could attempt to write a script using the HTTP Script utility to access the remote Mango's REST api using the endpoints at:
@dan we are still expanding on the features of that module but the initial release includes:
The help and documentation is currently in progress.
Once the Mango environmental properties file was pointing to the keystore it worked.
So you are all good now? Or still having issues? If you are still stuck you should follow the recommendations in that StackTrace link about enabling SSL logging by adding this to the java command that is starting mango:
And seeing what the details of the problem are.
@robmalone are you seeing anything in the log output of either Mango? If so please provide that.
A quick google search turned up this: https://stackoverflow.com/questions/6908948/java-sun-security-provider-certpath-suncertpathbuilderexception-unable-to-find
It could be that Mango isn't pointed at the correct keystore, the one with the new cert in it?