• A
    aoliver

    Some Linux distributions as CentOS or RedHat are migrating from systemV init type to the newest systemd.

    If this is your case, you will need to do as follow to make Mango runs with every system startup:

    Create a mango.service file:

    touch /etc/systemd/system/mango.service
    chmod 664 /etc/systemd/system/mango.service

    Edit the new file so it contains the following:

    [Unit]
    Description=Mango Daemon Service
    After=network.target
    After=network-online.target

    [Service]
    Type=forking
    ExecStart=/opt/mango/bin/ma.sh start
    ExecStop=/opt/mango/bin/ma.sh stop
    ExecReload=/opt/mango/bin/ma.sh restart
    PIDFile=/opt/mango/bin/ma.pid

    [Install]
    WantedBy=multi-user.target

    NOTE: You will need to point the mango directory path to whatever your MA_HOME is.

    Reload systemd configuration files:
    systemctl daemon-reload

    Add mango to systemd, so it runs on every system startup:
    systemctl enable mango.service

    That's it. Now you can manage the Mango service with the following shell commands:

    systemctl [start|stop|reload|status] mango

    Good luck!

    Editted by Phil: original PIDFile entry --> PIDFile=/opt/ambilogger/bin/ma.pid, edited from ambiguity in: https://forum.infiniteautomation.com/topic/3179/centos-7-systemd-startup-failing

    posted in How-To read more
  • A
    aoliver

    Hello Mango masters!

    We are implementing [url=http://guac-dev.org/]Guacamole as a Mango module. This provides local SSH and remote desktop access into the Mango's web interface.
    We have been reading [url=http://store.infiniteautomation.com/documentation/develop/how-to-write-a-module]this documentation and the process seems pretty straightforward, however, we don't know how to add a menu item for this module.

    Could you please point me in the right direction?

    Thanks!

    posted in Development general discussion read more
  • A
    aoliver

    When using Modbus TCP transport with keep-alive method, the** slave must be connected to the network at the time of enabling the data source**, otherwise communication will not be restored once you connect the slave (until doing a manual data source disabling/enabling cycle).
    If there is communication with the slave before enabling the data source, then communication will be atomatically recovered after any connection failure.

    This problem is not seen when using simple TCP transport (without keep-alive).

    posted in Modbus4J general discussion read more
  • A
    aoliver

    From the Mango Scripting help:

    Example

    The following is a script that implements the Lorenz equations. Three numeric points must be defined, with variable names of x, y, and z. A cron pattern of '0/2 * * * * ?' causes the script to be run every 2 seconds, which allows the data source to produce a fair amount of readings in a relatively short time.

    if (x.value == 0 && y.value == 0 && z.value == 0) {
    // Initial point values
    y.set(1);
    }

    if (typeof(rho) == "undefined") {
    rho = 28;
    sigma = 10;
    beta = 8/3;
    dt = 0.01;
    }

    dx = sigma * (y.value - x.value);
    dy = x.value * (rho - z.value) - y.value;
    dz = x.value * y.value - beta * z.value;

    x.set(x.value + dx * dt);
    y.set(y.value + dy * dt);
    z.set(z.value + dz * dt);

    Note how the typeof function is used to determine if constants need to be defined. This is an effective way of initializing the script context upon startup of the data source.

    If I understand correctly, the rho variable value should persist between script executions as long as the data source is enabled so I can, for example, implement an accumulator variable.
    If this is correct, then it isn't working. I had tested and results in variable re-definition with every iteration (script execution).
    I could work around this by using an script data point as accumulator, but that implies database read/write operation on every cycle.

    Is this a bug or am I misunderstanding the point?

    posted in Scripting general Discussion read more
  • A
    aoliver

    Hi Mango developers!

    I need to report minute averages for two data points. The first point "A" is acquired directly from a modbus device and the second "B" is the value of "A" * 46.006 / 24.5.
    So I've configured the modbus data point (A) to poll every second and to logg averages every minute. For "B" I've created a meta data point with "A" as context updater:

    return p20.value * 46.006 / 24.5;

    B is also logging average on a 1 minute interval.

    Well, this works fine, except that A and B minute averages values won't match. If I manually calculate the B minutes averages using A averages they are slightly different.
    This is because both averages were calculated in different times, e.g.:

    Averages for A values are calculated and logged over the PAST 60 seconds values at the 30th second every minute, while B averages are calculated at the 17th second. This result in values being shifted by 13 seconds, so the logged values can't be correlated using the formula.

    This 30 and 17 seconds are not random. They are related to the time I enabled the data point or data source. So Mango will logg the first value 60 seconds after the data point got enabled. This is fine but, in that case, average calculation should be done using the PREV method instead the PAST method, so averages are calculated over the data between the start and end of a particular period (quantized).

    A workaround for this may be enabling both data point at the same second of any minute, this result in much comparable values, but it will last just until the next system or data source / point restart.

    I think it would be nice to quantize, not only the polling time, but also the logging period.

    posted in Wishlist read more
  • A
    aoliver

    I'm trying to configure some SNMP data points but, when I test the data source I get "mango.ayt: mango.ayt: Name or service not known".

    I'm pretty sure the SNMP agent is working good. Here is the output from a Linux box:

    [root@server ~]# snmpget -v 1 -c public 192.168.68.3 .1.3.6.1.2.1.1.1.0
    SNMPv2-MIB::sysDescr.0 = STRING: Linux server.ayt 2.6.18-371.1.2.el5 #1 SMP Tue Oct 22 12:57:43 EDT 2013 i686

    And this is the Mango output:

    image

    Can someone please let me know if I'm missing something?

    posted in User help read more
  • A
    aoliver

    Hello Jeremyh.

    We are interested in being able to fully administrate our customer's mango servers. The Guacamole API give us both, SSH and remote desktop control just using an http access, so we want to embedd this as a module only visible for admin users.

    posted in Development general discussion read more
  • A
    aoliver

    Hello Mango masters!

    We are implementing [url=http://guac-dev.org/]Guacamole as a Mango module. This provides local SSH and remote desktop access into the Mango's web interface.
    We have been reading [url=http://store.infiniteautomation.com/documentation/develop/how-to-write-a-module]this documentation and the process seems pretty straightforward, however, we don't know how to add a menu item for this module.

    Could you please point me in the right direction?

    Thanks!

    posted in Development general discussion read more
  • A
    aoliver

    Thank you Terry! I will be following this on the bugtracker.

    posted in Modbus4J general discussion read more
  • A
    aoliver

    When using Modbus TCP transport with keep-alive method, the** slave must be connected to the network at the time of enabling the data source**, otherwise communication will not be restored once you connect the slave (until doing a manual data source disabling/enabling cycle).
    If there is communication with the slave before enabling the data source, then communication will be atomatically recovered after any connection failure.

    This problem is not seen when using simple TCP transport (without keep-alive).

    posted in Modbus4J general discussion read more