• phildunlap

    Hi Andreas, welcome to the forum!

    I think, I have to set the localDevice as a receifer in the notifications class on the the remote device.

    Yes, this is correct. You need to add your device as a destination in the recipientsList property on a notificationClass object. Then, on the object you wish to use that notification class to handle cases of intrinsic reporting, you set the notificationClass property on the object doing the intrinsic reporting to the object instance number of the notificationClass object you wish to use.

    You may need to try a CreateObjectRequest if the remote device doesn't have any existing notification classes.

    posted in BACnet4J general discussion read more
  • phildunlap

    Hi N8Hart, welcome to the forum!

    The batch file can be terminated normally and I don't see any errors in the log file

    The batch file should open a CMD window which stays open until closed (a hard kill to the process running in it) or Ctrl+C to tell Mango to shut down. If it opens and closes quickly there was some error during startup.

    To check what the error is, if it's going to stderr and not into the log file, you can open a command prompt and

    cd C:\Path\To\Mango\bin

    and then it will not close the window when it experiences the error and you can post the output or search if it has already been answered.

    posted in Mango Automation Installation read more
  • phildunlap

    @craigweb said in SNMP Publisher / Agent:

    Hi @ricardo

    Mango only has 4 publishers: BACnet, Modbus, Mango PTCP and an HTTP publisher

    Also Twilio and Pachube.

    posted in Mango Automation general Discussion read more
  • phildunlap

    Hi Ricardo,

    No, Mango does not currently have an SNMP publisher.

    Can Mango send SNMP traps as an Event Handler type?

    Yes, but it isn't really set up to make such a thing easy. I think we'd best to have a running SNMP data source and use some reflection, something like this, in a Set Point Event Handler,

    var snmpDataSourceId = com.serotonin.m2m2.db.dao.DataPointDao.instance.getIdByXid("DS_XID_HERE");
    var snmpDataSourceRT = com.serotonin.m2m2.Common.runtimeManager.getRunningDataSource( snmpDataSourceId );
    if( snmpDataSourceRT !== null ) {
        var field = snmpDataSourceRT.getClass().getDeclearedField("snmp");
        field.setAccessible( true );
        var snmp = field.get( snmpDataSourceRT );
        //get the SNMP version information
        field = snmpDataSourceRT.getClass().getDeclearedField("writeVersion");
        field.setAccessible( true );
        var writeVersion = field.get( snmpDataSourceRT );
        //get the target to send it to
        var target = writeVersion.getTarget( "", 162, 1, 5000 ); //host, port, retries, timeout
        //construct the PDU
        var pdu = writeVersion.createPDU();
        if( target.getVersion === org.snmp4j.mp.SnmpConstants.version1 ) {
            pdu.setType( org.snmp4j.PDU.V1TRAP );
            pdu.setEnterprise( new org.snmp4j.smi.OID( "") ); //probably a clever way to get the OID from the event
            pdu.setGenericTrap( org.snmp4j.PDUv1.ENTERPRISE_SPECIFIC );
            pdu.setSpecificTrap( 1 ); //looks like this may need to cycle in value 1-5
            pdu.setAgentAddress( new org.snmp4j.smi.IpAddress( "" )); //Mango's IP on the network here
            snmp.send( pdu, target );
        } else if ( target.getVersion === org.snmp4j.mp.SnmpConstants.version2c ) {
            throw "not yet implemented!";
        } else if ( target.getVersion === org.snmp4j.mp.SnmpConstants.version3 ) {
            throw "not yet implemented!";
        } else
            throw "unknown snmp version!";
    } else {
        throw "Data source not found to send trap for event: " + event;
    return UNCHANGED; //don't set from the set point handler

    I would be somewhat surprised if this works, but it shouldn't be too far from the way to do it. I consulted this site for the V1 implementation, and there is also a v2c example: https://www.jitendrazaa.com/blog/java/snmp/generating-trap-in-snmp-using-snmp4j/

    So, possible, but will probably take some trial and error to figure out.

    posted in Mango Automation general Discussion read more
  • phildunlap

    Hi techalton,

    This is the git issue it is being tracked in: https://github.com/infiniteautomation/BACnet4J/issues/43

    Michel has responded and it looks like Terry has coded a prospective solution to this specific issue, but that it needs review / assistance to generalize the relaxing of the type checking in reading properties from other devices.

    posted in MangoES Hardware read more
  • phildunlap

    No worries, the data file data source probably requires the most Java knowledge outside of writing scripts that invoke the code. Even then, the scripts get to benefit from JavaScripts willingness to store any ole' type into a variable, where everything needs to be properly typed and declared in the data file classes. Tricky when there are but few examples and it's closed source!

    I would guess there was an informative event raised about a failure to instantiate the poll class, but I couldn't say.

    posted in User help read more
  • phildunlap

    The issue with the poll class it will not work as an abstract class, it must be able to be instantiated so that it may be run. I just tested and was able to set values to data file points when my poll class looked like this:

    import com.infiniteautomation.datafilesource.rt.AbstractPollClass;
    import com.infiniteautomation.datafilesource.rt.PollClassInvoker;
    import com.serotonin.m2m2.rt.dataImage.DataPointRT;
    import com.serotonin.m2m2.rt.dataImage.PointValueTime;
    import com.serotonin.m2m2.rt.dataImage.SetPointSource;
    public class PutPollClass extends AbstractPollClass {
    	public void run(long time, PollClassInvoker invoker, String[] arguments) {}
    	public boolean setPointValueImpl(DataPointRT dataPoint, PointValueTime valueTime,SetPointSource source) {
    		return true;

    Remember, you'll need to recompile the class, and then restart the data source for the modifications to be applied.

    posted in User help read more
  • phildunlap

    Hi jleblancmango,

    How did you set up your path? Can you set the JAVA_HOME environment variable to your JDK directory? Either that, or you'd need to make sure the jar.exe file is in one of the locations defined by the "Path" environment variable for the user that is launching Mango.

    posted in User help read more
  • phildunlap

    Hi Fox,

    Can you post your poll class? What is the logging type of your points?

    The PUT endpoint behaves like a set through Mango. If the user your PUT'ing the value through the API has permission to set the point, you should see that get to the poll class's method I said you had to implement:

    public boolean setPointValueImpl(DataPointRT dataPoint, PointValueTime valueTime,
                SetPointSource source)

    You could do something in this method to prove to yourself it got there. If that returns true, then it will call setPointValue on the DataPointRT and that has some subtleties from logging type.

    EDIT: Alternatively, how hard would it be to convert the Data File datasources into Virtual datasources? If I could manage that, it would save a lot of fluff.

    You would have to do some work to ensure the id to xid set was the same (i.e. SELECT id, xid FROM dataPoints; and save that to make a bunch of update statements for the modified points. Here's an old python script that will convert all data source and data points in a JSON file to virtual sources and points (you may want to make them no change point locators): https://github.com/infiniteautomation/ma-devtools/blob/master/PythonUtilities/Simulation/virtualizeDataSources.py

    You would have to delete the old, import the new, and then run the SQL update statements to set the ID based on the XID such that old data wasn't lost. So, possible by maybe not trivial.

    posted in User help read more
  • phildunlap

    Hi Thomas, thanks for bringing this to our attention!

    I have created a git issue for this in the Modbus module's repo.

    posted in Dashboard Designer & Custom AngularJS Pages read more
  • phildunlap

    I think so, but not sure why we wouldn't see it as well. Maybe a plugin or something?

    Can you check the SVG to see if that downloaded a zero pixel plot area (i.e. the <svg> opening tag's height and width are 0)? Maybe try clearing the browser cache?

    posted in User help read more
  • phildunlap

    It would not be so simple. If the annotations aren't generating the models properly (although Terry did close the git issue he opened) then it'd be constructed by hand or examples within Mango would have to be recorded somewhere. It is easier to respond piecemeal for specific endpoints and fix model generation in later versions on endpoints where it isn't working.

    posted in User help read more
  • phildunlap

    Hi jflores13, lots of questions!

    Do you think SSL / port # is the problem or what else could be wrong?

    That definitely seems like it would be part of the problem. I'm not sure why the POP3 data source didn't expose the port as an option, it's certainly easy to do, so I have opened a git issue about this in the repository the module is in. Somewhat impassable issue until that is configurable.

    Last doubt: what is the RegEx syntax flavor used by Mango?

    When in the Java code (i.e. data sources that don't have scripts) https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html

    When in scripts, JavaScript regex syntax.

    Which command? Which state?

    This message is coming from javax.mail . I'm guessing Outlook may have accepted the connection, but perhaps not the access, so there's some exception in trying to access the inbox, i'm not sure. Regardless if 995 is the port I would expect issues.

    There's a doubt with that, because when I'm configuring the data source in the 3.6 UI, there is no "valueFormat" text box, but in the exported JSON the "valueFormat" property has the string that I input into "Binary 0 Value". Is this the expected behaviour?

    Yes, They are stored in the same property on the point locator because they can be. If a numeric point, the value format is interpreted as a java.text.DecimalFormat, and if binary it is simply string matched with what is captured in the value regex (capture group 1)

    This is the only error in the console, but I'm not sure it's related:

    I don't think it is, but I appreciate you checking the console!

    posted in User help read more
  • phildunlap

    Ah, good insight @ThomasEinasto that does make sense.

    In that case you'd want to bridge the two ports and only have one static IP on the bridge network adapter. The bridging section of this page may have the answers you seek: https://www.linux.com/news/what-can-you-do-second-ethernet-port/

    Although you'll perhaps want to make it permanent in the /etc/network/interfaces file, in which case this link may be helpful: https://wiki.debian.org/BridgeNetworkConnections#Configuring_bridging_in_.2Fetc.2Fnetwork.2Finterfaces

    posted in Development general discussion read more
  • phildunlap

    Are they separate networks? Why would you need two ports on the same subnet? The routers should get traffic where it's going. There are ways to use the two ports in parallel for a speed boost I think, but I have no experience with that and with either 100Mbs or 1Gbs, it doesn't seem necessary.

    posted in Development general discussion read more
  • phildunlap

    Not able to replicate simply by using Firefox 68.0.2

    Perhaps you can confirm that your Mango is fully up to date, and that no network requests are getting failing status codes?

    posted in User help read more
  • phildunlap

    Hi craig,

    The URL in that error is on the logging console page, so perhaps you were using that tab for some time.

    The "Download As..." options are a function of AMCharts after the plot is drawn and are fully occurring within your browser window, not downloads through Mango. What browser are you using?

    Edit: You could check your network tab to see if any requests are getting an error response, but my guess is for some reason it is exporting as a 0 pixel chart, from your description.

    posted in User help read more
  • phildunlap

    Hi HSAcontrols,

    Can you say more about what you're trying to achieve?

    You can certainly address the ports separately, but you'd want them to be on separate subnets or it is confusing for the operating system which address it is acting as, and one of the routes will have precedence over the other and handle all the traffic on the 192.168.0.x network (presuming subnet

    posted in Development general discussion read more
  • phildunlap

    The file called Mango Wireshark between 2019-10-03 1904PM to 2035PM I saw it in. Too large for email, as it was when you sent it!

    We can see frame 170715 for instance is sent but no Segment ACK is sent in response to it. I don't know if BACnet4J would wait to send the completing fragment until after receiving the ACK, but that's what appears to be happening. We can then see the six second retries. I'm not sure why the request in question is being sent out twice in rapid succession, though.

    posted in User help read more