• Recent
    • Tags
    • Popular
    • Register
    • Login
    1. Home
    2. MaP
    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
    M
    • Profile
    • Following 0
    • Followers 0
    • Topics 14
    • Posts 64
    • Best 0
    • Controversial 0
    • Groups 0

    Posts made by MaP

    • RE: Rest API CORS config env.properties

      @MattFox I was able to run a test on a Mango4 unit and get access to rest V3 API via a non-local-host IP, but not on mango 3.7.2 REST V1 - this still only allows local-host originating requests. Wondering if there is something with IP tables or some network wizardry on the Mango itself to Destination NAT or masquarade requests from another port to overcome the CORS rules.

      I would prefer a solution without involving another device/cloud server and a public IP address/Domain

      posted in User help
      M
      MaP
    • RE: Rest API CORS config env.properties

      @MattFox

      I attempted the following but it still does not seem to have worked

      rest.cors.enabled=true
      rest.cors.allowedOrigins=*,localhost,<IP-HERE>
      rest.cors.allowedMethods=PUT,POST,GET,OPTIONS,DELETE
      rest.cors.allowedHeaders=LOGOUT,PASSWORD,content-type,accept,x-requested-with,authorization
      rest.cors.exposedHeaders=
      rest.cors.allowCredentials=true
      rest.cors.maxAge=3600

      ahh using Nginx would be a clever trick, I would prefer not to do this on the production environment but this is a great tip for future installs, nginx with certbot would be handy

      posted in User help
      M
      MaP
    • Rest API CORS config env.properties

      I have been struggling to query the rest API from anywhere other than localhost. I think this is due to the CORS setup (or lack thereof) in the env.properties file.

      Does someone have an example of a CORS setup to allow me to query the rest API from a non-local-host machine? The only one I can find quoted on the forum has been removed/linked to a different page - so any help would be greatly appreciated

      posted in User help rest api cors
      M
      MaP
    • User Permissions disappearing

      A client has contacted me because they are losing the ability to see dashboard data - the cause of this is because their user has lost user permissions to view the datapoint - BUT - after bulk permission association a few weeks later the problem returns and I need to reassociate the user permissions with the XID's/Data sources - has anyone experienced a bug like this before or have any idea of root cause?

      posted in Mango General permissions bug dashboard user
      M
      MaP
    • RE: JWT JSON Web Token Transfer

      @MaP
      It seems stack overflow is letting me know that JWT are not stored on the filesystem at all meaning I most likely have to recompile the source with a newly generated JWT.. happy if anyone has another solution though! :-)

      posted in User help
      M
      MaP
    • JWT JSON Web Token Transfer

      Can anyone tell me where the JWT are stored on the file system? I am preparing to transfer an executable to a new mango and I would prefer to just copy the JWT api token onto the new machine than create a new JWT and ammend/recompile the executable.

      posted in User help filesystem jwt
      M
      MaP
    • Mango Fan Control - thermal shutdown

      I have a mango with a thermal shutdown occuring and I wanted to check the fan settings I found an old post which showed you could change temperature thresholds and PWM controls here
      /sys/devices/odroid_fan.13 but it seems the newer mango I have (3576) has a different hardware setup - interestingly it does have a file called fans sitting @ $MA_HOME but looking through the linux kernal files this file refers to is a bit to esoteric for my liking ..

      posted in User help hardware temperature cpu fan
      M
      MaP
    • RE: Virtual Data Source Disabled on Reboot / Lifecycle terminating

      @MaP @MattFox Its currently winter here so i'm assuming thermal shutdown must be caused by High CPU use or a fan not running properly? Are there some things to set off of high priority? When I look at work items everything is high priority, CPU use is low but temperatures are pretty high.

      523a765e-28b9-490b-996d-d9838b147890-image.png

      posted in User help
      M
      MaP
    • RE: Virtual Data Source Disabled on Reboot / Lifecycle terminating

      @MaP Found it! It is a thermal shutdown!

      Jul 28 08:44:01 mangoES3576 CRON[1977]: (root) CMD ((sleep 30; [ -x /usr/sbin/systemInfo/cronRunner ] && /usr/sbin/systemInfo/cronRunner) >/dev/null$Jul 28 08:44:02 mangoES3576 python[6945]: AEMO Healthy - PriceNow:92.31
      Jul 28 08:44:57 mangoES3576 kernel: [1471180.187164] thermal thermal_zone2: critical temperature reached(107 C),shutting down
      Jul 28 08:44:57 mangoES3576 systemd[1]: Started Synchronise Hardware Clock to System Clock.
      Jul 28 08:44:57 mangoES3576 systemd[1]: Stopping Session c1 of user root.
      Jul 28 08:44:57 mangoES3576 systemd[1]: Stopping system-ifup.slice.
      Jul 28 08:44:57 mangoES3576 systemd[1]: Removed slice system-ifup.slice.
      Jul 28 08:44:57 mangoES3576 systemd[1]: Stopping User Manager for UID 0...
      Jul 28 08:44:57 mangoES3576 systemd[1]: Stopping Graphical Interface.
      Jul 28 08:44:57 mangoES3576 systemd[1]: Stopped target Graphical Interface.
      Jul 28 08:44:57 mangoES3576 systemd[1]: Stopping Multi-User System.
      Jul 28 08:44:57 mangoES3576 systemd[1]: Stopped target Multi-User System.
      Jul 28 08:44:57 mangoES3576 systemd[1]: Stopping Deferred execution scheduler...
      Jul 28 08:44:57 mangoES3576 systemd[1]: Stopping OpenBSD Secure Shell server...
      Jul 28 08:44:57 mangoES3576 systemd[1]: Stopping AEMO Service...
      Jul 28 08:44:57 mangoES3576 systemd[1]: Stopping Regular background program processing daemon...
      Jul 28 08:44:57 mangoES3576 systemd[1]: Stopping OpenVPN service...
      Jul 28 08:44:57 mangoES3576 systemd[1]: Stopped OpenVPN service.
      Jul 28 08:44:57 mangoES3576 systemd[1]: Stopping Login Prompts.
      Jul 28 08:44:57 mangoES3576 systemd[1]: Stopped target Login Prompts.

      posted in User help
      M
      MaP
    • RE: Virtual Data Source Disabled on Reboot / Lifecycle terminating

      Hi @MattFox !
      Yes an ES instance. Yes there have been some OOM like behaviours in the past but because of these previous incidents I have been trending the JVM memory and the memory seemed pretty stable at the time. And these usually result in mango service crashing but I can still use SSH to reboot the service. The most disconcerting thing here is the ethernet interface going dead. I would like to discover the root cause but from a mitigation standpoint I would also like a recovery option which doesn't include driving to site.. A shell script which monitors systemctl active status and reboots the device seems like an option. Tips for discovering root cause, or mitigation strategies appreciated!

      posted in User help
      M
      MaP
    • Virtual Data Source Disabled on Reboot / Lifecycle terminating

      Some very strange behaviour occured with our mango (3.5.6). The device became uncontactable (no respond to pings over ethernet) and upon reboot a virtual data source appeared enabled (green LED) but reported being disabled. Toggling the enabled/disabled re-enabled this data source.

      On review an information event recorded a System Shutdown. Is system shutdown a user only issued command or is it capable of being autonomously triggered?

      INFO 2022-07-09T03:05:08,153 (com.infiniteautomation.mango.excelreports.ExcelReportPurgeDefinition.execute:32) - Report purge ended, 1 report instan$INFO 2022-07-09T06:57:53,784 (com.serotonin.m2m2.Lifecycle.terminate:422) - Mango Lifecycle terminating...
      INFO 2022-07-09T06:57:53,784 (com.serotonin.m2m2.Lifecycle.terminate:422) - Mango Lifecycle terminating...
      INFO 2022-07-09T06:57:54,205 (com.serotonin.m2m2.rt.DataSourceGroupTerminator.terminate:72) - Terminating 2 LAST priority data sources in 8 threads.
      INFO 2022-07-09T06:57:54,221 (com.serotonin.m2m2.rt.RuntimeManagerImpl.stopDataSourceShutdown:423) - Data source 'MetaPoints' stopped
      INFO 2022-07-09T06:57:54,267 (com.serotonin.m2m2.rt.RuntimeManagerImpl.stopDataSourceShutdown:423) - Data source 'Meta' stopped
      INFO 2022-07-09T06:57:54,307 (com.serotonin.m2m2.rt.DataSourceGroupTerminator.terminate:102) - Termination of 2 LAST priority data sources took 103m$INFO 2022-07-09T06:57:54,308 (com.serotonin.m2m2.rt.DataSourceGroupTerminator.terminate:72) - Terminating 14 NORMAL priority data sources in 8 threa$INFO 2022-07-09T06:57:54,631 (com.serotonin.m2m2.rt.RuntimeManagerImpl.stopDataSourceShutdown:423) - Data source 'MangoES System' stopped …..

      posted in User help
      M
      MaP
    • RE: Mango Crash - No Restart Flag

      02e1fb21-f4ca-4a17-874b-aec38f17d8eb-image.png

      posted in User help
      M
      MaP
    • Mango Crash - No Restart Flag

      Mango crashed and did not restart unfortunately after I restarted the service there was nothing in the ma.log from the previous day only logs from the restart point. Interestingly the ma-script.log showed when it exited the day before and shows it didn't restart because "no restart flag found, not restarting MA. How do i set this restart flag? " MAStopped.PNG

      posted in User help
      M
      MaP
    • RE: REST V1/V2 Update Point Values help

      well I think this works for anyone interested ->

      Python 2.7.15+ (default, Nov 27 2018, 23:36:35)
      [GCC 7.3.0] on linux2
      Type "help", "copyright", "credits" or "license" for more information.
      >>>
      >>> import requests
      >>> import json
      >>> bearertoken = 'Bearer <your token here>'
      >>> headers = {'Accept':'application/json','Content-Type': 'application/json','Authorization': bearertoken }
      >>> curtailxid = 'DP_05bf6e60-8a86-42a7-9284-0e74cf56f902'
      >>> xid = curtailxid
      >>> currentprice = 5555
      >>> dd =  {"dataType": "NUMERIC","timestamp": 0,"value": currentprice,"xid": "DP_05bf6e60-8a86-42a7-9284-0e74cf56f90"}
      >>> putDPurl = 'http://192.168.10.130:8080/rest/v1/point-values/' + xid + '?unitConversion=false'
      >>> #putDPurl2 = 'http://192.168.10.130:8080/rest/v2/point-values/DP_05bf6e60-8a86-42a7-9284-0e74cf56f902/attributes'
      ... r = requests.put(putDPurl,headers = headers, data=json.dumps(dd))
      >>>
      >>> r.status_code
      201
      >>> r.text
      u'{"dataType":"NUMERIC","value":5555,"timestamp":1591858602770,"annotation":null}'
      >>>
      
      posted in User help
      M
      MaP
    • REST V1/V2 Update Point Values help

      I am struggling with updating a point value using python. I get a 200 status code and everything looks kosher but the value does not update... as you can see i write to the value get a 200 response then check the value using the v1 rest address and its still the old value.. i was able to get it to change but this may have been via the swagger testing suite. Below i try to change the value to 12.5 - get a 200 status code then read it back and see its still 55.

      map@SE2526:/$ python
      Python 2.7.15+ (default, Nov 27 2018, 23:36:35)
      [GCC 7.3.0] on linux2
      Type "help", "copyright", "credits" or "license" for more information.
      >>> import requests
      >>> import json
      >>> bearertoken = 'Bearer <insert your token here>'
      >>> headers = {'Accept':'application/json','Content-Type': 'application/json','Authorization': bearertoken }
      >>> curtailxid = 'DP_05bf6e60-8a86-42a7-9284-0e74cf56f902'
      >>> xid = curtailxid
      >>> dd =  {"annotation": "Help!","dataType": "NUMERIC","timestamp": 0,"value": 12.5,"xid": "DP_05bf6e60-8a86-42a7-9284-0e74cf56f90"}
      >>> putDPurl = 'http://192.168.10.130:8080/rest/v1/point-values/' + xid + '?unitConversion=false'
      >>> putDPurl2 = 'http://192.168.10.130:8080/rest/v2/point-values/DP_05bf6e60-8a86-42a7-9284-0e74cf56f902/attributes'
      >>> r = requests.put(putDPurl2,headers = headers, data=json.dumps(dd))
      >>>
      >>> r.status_code
      200
      >>> r.text
      u'{"annotation":"Help!","xid":"DP_05bf6e60-8a86-42a7-9284-0e74cf56f90","dataType":"NUMERIC","value":12.5,"timestamp":0}'
      >>> getDPurl = 'http://192.168.10.130:8080/rest/v1/point-values/' + xid + '/latest?useRendered=false&unitConversion=false&limit=1&useCache=true'
      >>> r = requests.get(getDPurl, timeout=5, headers=headers);
      >>> r.status_code
      200
      >>> r.text
      u'[{"cached":true,"dataType":"NUMERIC","value":55.5,"timestamp":1591856389181,"annotation":null}]'
      >>>
      
      posted in User help
      M
      MaP
    • RE: HTTP Builder with Basic Auth & Client-Cert

      I have to log the API data and add it to an existing modbus connection the mango has with a PLC so the PLC and a SCADA system can make decisions/control options based on the data.

      Things are so much easier with less secure connections! Certificate chains and such give me headaches. Its sounding like I will need to perhaps make a python script on the mango OS call it on boot and then also add a API connection to write from the python script into a mango data point. Was hoping for an easy win, alas.

      posted in User help
      M
      MaP
    • RE: HTTP Builder with Basic Auth & Client-Cert

      I noticed you could POST to https requests using httpbuilding - such as the slack integration.

      function notifyToSlack(text, attachments) {
      var url = "https://hooks.slack.com/services/xxxxxxx/yyyyyy/zzzzzzzzzzzzzzzzzzzzzzzzzz";
      var headers = {
      "Content-Type": "application/json"
      };
      var data = {
      "text": text,
      "attachments": attachments
      };
      HttpBuilder.post(url, headers, data).err(function(status, headers, data) {

          throw "Script failed with HTTP status : " + status;
      
      }).resp(function(status, headers, data) {
      
          "Hallo" 
      
      }).execute();
      

      }

      posted in User help
      M
      MaP
    • RE: HTTP Builder with Basic Auth & Client-Cert

      Apprently I need to Generate a Certificate Signing Request (openSSL?) - Then
      the Organisation Validates CSR.

      Organisation Generates the SSL certificate from the CSR.
      Distributes the Certificate details:
      a. Users public certificate
      b. Gateway public certificate
      c. CA certificate

      posted in User help
      M
      MaP
    • RE: HTTP Builder with Basic Auth & Client-Cert

      I have done a bit of quick research into Basic Auth and Client Certs and unfortunately its a valid combination apparently. Im double checking but the documentation says you need your basic auth credentials and a certificate. The api requests are all https requests.

      I was hoping mango would be able to manage it without having to introduce another cloud server or service to manage the data feed. Trying to figure out if it can be done in a meta data source, a scripting source, or perhaps a python script. Keeping it in mango reduces networking requirements and complexity.

      The documentation recommends testing with Postman where you can specify Basic Auth as the Authentication for base64 encoded credentials added to the headers and then add a Client side certificate through the Postman Security settings for client SSL certificates.

      posted in User help
      M
      MaP