• Recent
    • Tags
    • Popular
    • Register
    • Login
    1. Home
    2. aoliver

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website
    A
    • Profile
    • Following 0
    • Followers 0
    • Topics 6
    • Posts 20
    • Best 1
    • Controversial 0
    • Groups 0

    aoliver

    @aoliver

    1
    Reputation
    1.1k
    Profile views
    20
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    aoliver Unfollow Follow

    Best posts made by aoliver

    • How to automatically start Mango in a systemd based Linux OS

      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
      A
      aoliver

    Latest posts made by aoliver

    • How to automatically start Mango in a systemd based Linux OS

      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
      A
      aoliver
    • RE: Menu item for new module

      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
      A
      aoliver
    • Menu item for new module

      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
      A
      aoliver
    • RE: Menu item for new module

      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
      A
      aoliver
    • RE: Resilience issues when using TCP with keep-alive transport method

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

      posted in Modbus4J general discussion
      A
      aoliver
    • Resilience issues when using TCP with keep-alive transport method

      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
      A
      aoliver
    • RE: Resilience issues when using TCP with keep-alive transport method

      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
      A
      aoliver
    • RE: Variable's value persistence between script executions

      Thank you Joel!

      Ok, that works, so I must review my script.
      Anyway, your example reads the count value from database.

      A better example for in memory value storage would be:

      if (typeof(count) == "undefined") { 
        var count = 0;
      }
      
      count = count +1;
      counter.set(count);
      

      This also works!

      posted in Scripting general Discussion
      A
      aoliver
    • Variable's value persistence between script executions

      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
      A
      aoliver
    • RE: Variable's value persistence between script executions

      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
      A
      aoliver