• 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

    Ascii file source, read binary value in file

    User help
    4
    6
    2.1k
    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.
    • jeremyhJ
      jeremyh
      last edited by

      Hi,

      I would like to read a file (on a linux filesystem) using the ASCII file data source. The file simply contains either a 0 or a 1 depending on a condition. No other characters or data are present in the file.

      I can't figure out how to get the ASCII file data source to read this. It is looking at the correct file but I am not sure about what I should put in the additional settings for point identifier, value index etc. Any hints?

      Cheers
      Jeremy

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

        Oops, I meant to post this in 'User help', although this is somewhat hardware related as I am trying to access the GPIO pins on a Raspberry Pi (if successful I will post the steps here/on the wiki for others).

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

          Well, after playing around with this - I (mostly) have a solution using python, but it's pretty ugly and inefficient.
          I would really like it if I could read the bit directly into mango as above.

          Again, the file just contains a single bit; a zero or a one, which changes as the input changes.
          @phildunlap, perhaps you have some idea about how to do this?

          1 Reply Last reply Reply Quote 0
          • AldoRamosA
            AldoRamos
            last edited by

            Also looking to implement similar data points for GPIO.

            I have resorted to a "grep" and using the filename as a point identifier, which is ugly in itself, but the real problem is getting the binary data ("1" or "0") to be properly read into the regex. What I seem to be getting is a 1 if the regex matches, not the actual value of the regex pattern. Are there any examples for regex patters for binary data such as the GPIO values?

            Thanks in advance.

            Aldo

            1 Reply Last reply Reply Quote 0
            • P
              Puckfist
              last edited by

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • phildunlapP
                phildunlap
                last edited by

                Hey guys, sorry I never saw this... I took a bit of a hiatus.

                Yes you can do this with the ASCII file data source. Simply point the datasource at the file, configure a data point as follows:

                Point Identifier:
                Point Identifier Index: 2
                Value Index: 1
                Value Regex: (0|1)()

                So the trick here is to leave the point identifier totally empty and then capture an empty group at some point in our regex.

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