• Recent
    • Tags
    • Popular
    • Register
    • Login

    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

    getting value from last line in a logfile

    User help
    2
    6
    2.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      sprokkie
      last edited by

      Hi,

      I have an inverter for my solar panels.
      There is a log file that is written with the actual value of that moment.
      The problem is that the file is written for one day and the new value is the last line of the file.
      i want to read out the file and have the last value what is teh actual value on that moment displayed on my view, so it must be turned in to a data point.

      any suggestions ?

      this is how the file looks like:

      W
      -10496
      mnuPower

      63580756887;6,10
      63580756947;6,91
      63580757007;5,83
      63580757067;5,28

      2 minutes later

      W
      -10496
      mnuPower

      63580756887;6,10
      63580756947;6,91
      63580757007;5,83
      63580757067;5,28
      63580757127;5,83

      2 minuts later

      W
      -10496
      mnuPower

      63580756887;6,10
      63580756947;6,91
      63580757007;5,83
      63580757067;5,28
      63580757127;5,83
      63580757187;6,37

      i want to have the last value in this case 6.37 in my data point

      thanks in advanced

      1 Reply Last reply Reply Quote 0
      • jeremyhJ
        jeremyh
        last edited by

        Hey sprokkie,

        You could use some regex like this:

        http://rextester.com/tester/RQZA31460

        To match the value, but not sure how you would get the last occurance.

        You have a SMA inverter right? You might be able to buy a cheap speedwire card for it, which would give you a Modbus TCP/IP interface, which would work much better with Mango. You could also then monitor some other parameters too.

        1 Reply Last reply Reply Quote 0
        • S
          sprokkie
          last edited by

          Hi Jeremyh.

          The sma inverter is not a problem, sunnydata explorer has a online function, i read the xml file with a http retriever.
          That online file is refreshed with new data each 2 minutes.
          I use the modbus for reading out a cheap kwh meter i purchased on alieexpress.com. that works realy fine.
          That kwh meter is conencted between the phillips evo inverter.

          The lof file reading that is not working is for a new power-one pvi 2000 inverter. power one is now part of ABB.
          The log file is cummulating during the day.
          So i am only interested in the last line written.

          1 Reply Last reply Reply Quote 0
          • S
            sprokkie
            last edited by sprokkie

            Found it !!

            the expression in mango:
            ;(.*?)$
            The $ on the end did the trick

            on the rextester it is:
            ([0-9],[0-9][0-9]*.?$)

            1 Reply Last reply Reply Quote 0
            • jeremyhJ
              jeremyh
              last edited by jeremyh

              Hey Sprokkie, that's great, and thanks for posting your solution - handy trick which will probably come in useful to me! I thought I would try that myself so I know how to do it in future. I have made a file the same as yours on my server:

              Screen Shot 2015-10-20 at 11.32.07 am.png

              But my point does not read any value from the file.

              Can I ask what values you put for Point Identifier, Point Identifier Index, and Value Index?

              1 Reply Last reply Reply Quote 0
              • S
                sprokkie
                last edited by

                The data source is http retriever.
                I made a junction link between the directory where the logfile is written and a directory in the mango web directory,
                so the data in the mango/web/system is the same as in programfiles/auroracommunicator/system.
                The auroracommunicator/system is the directory where the inverter software puts the logfiles.

                junction links are easily made with junction link magic : http://www.rekenwonder.com/linkmagic.htm

                the mango webdirectory is accessable with the http retriever.
                Point the datasource to the ipaddress and port of youre mango server. ie http://192.168.100.1:8080/system/filename.extension now the file is accesable, i tried the 127.0.0.1 adres, that didn't work
                the datapoint is like this:
                datapoint.PNG

                this wil do the trick :)

                now my next challenge put all seperate logfiles in 1 file with the actual value, otherwise i have to configure a data source and data point for each logfile

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post