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

    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

    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
    • RE: Quantized logging period

      Thanks Joel. I'll watch any news regarding this.

      posted in Wishlist
      A
      aoliver
    • Quantized logging period

      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
      A
      aoliver
    • RE: Quantized logging period

      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
      A
      aoliver
    • RE: SNMP Host Testing : Name or service not known [SOLVED]

      Ok, I finally got this thing working.
      The error message "mango.ayt: mango.ayt: Name or service not known" gave me a clue: the server doesn't recognises its own hostname.
      A quick view on /etc/hosts confirmed this idea

      [root@mango ~]# cat /etc/hosts
      127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
      ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
      

      So I edited this file to make it look like this:

      [root@mango ~]# cat /etc/hosts
      127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
      192.168.68.2 mango mango.ayt
      ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
      

      And voila!, problem solved. Now SNMP module is working.

      This could be valid for anyone trying to get Mango Automation to work on CentOS 6.

      posted in User help
      A
      aoliver
    • RE: SNMP Host Testing : Name or service not known [SOLVED]

      Ok, I think there is a problem with the Linux server environment :cry: .
      I ran the same test from a different Mango instance running on my PC (Windows 7) to the same SNMP Agent (through internet access) and this is the reply:

      image

      Thanks a lot, Joel

      posted in User help
      A
      aoliver
    • RE: Mango M2M 2.2.2 Postgresql Issue

      Sad to hear that.

      I was also planning to migrate from Derby to PostgreSQL. I prefer postgres over MySQL due to license terms.

      posted in Mango Automation Installation
      A
      aoliver
    • RE: Mango M2M 2.2.2 Postgresql Issue

      From the GitHub public source:

      https://github.com/infiniteautomation/ma-core-public/blob/master/Core/db/createTables-POSTGRES.sql

      Also, test-env.properties is configured for postgres:

      https://github.com/infiniteautomation/ma-core-public/blob/master/Core/src-test/test-env.properties

      posted in Mango Automation Installation
      A
      aoliver
    • RE: SNMP Host Testing : Name or service not known [SOLVED]

      Yes, Joel. I've tried without local IP specification (Mango server has two IP address) and the three snmp versions.

      Also, this is the target machine snmpd.conf

      com2sec local_host localhost public
      com2sec local_net  192.168.68.0/27 public
      
      #Se asigna local_host al grupo de lectura escritura
      group MyRWGroup v1 local_host
      group MyRWGroup v2c local_host
      group MyRWGroup usm local_host
      
      #Se asigna local_net al grupo de solo lectura
      group MyROGroup v1 local_net
      group MyROGroup v2c local_net
      group MyROGroup usm local_net
      
      ## name   incl/excl subtree   mask(optional)
      view all  included  .1        80
      
      ## group         context  sec.model sec.level prefix read   write notif
      access MyROGroup ""       any       noauth    exact  all    none  none
      access MyRWGroup ""       any       noauth    exact  all    all   all
      
      syslocation Servidor AyT (Linux)
      syscontact Administrador (aoliver@xxx.xx)
      
      posted in User help
      A
      aoliver
    • SNMP Host Testing : Name or service not known [SOLVED]

      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
      A
      aoliver
    • RE: SNMP Host Testing : Name or service not known [SOLVED]

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