• 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

    Developing a module to read data from Redis in-memory data structure store

    How-To
    3
    7
    3.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.
    • mebiusM
      mebius
      last edited by

      hi dear supporter

      I need to developing a module of Mango Automation 2.7 to read data from Redis, a in-memory data structure store, used as database, cache and message broker.

      I think the new data source should be like the SQL data source to a certain extend, could you give some instruction for me on how to develop such a data source?

      Thanks.

      1 Reply Last reply Reply Quote 0
      • hussamH
        hussam
        last edited by

        you just want to read data from Redis,or you want store and read on redis;if you want store,you need to solve the key-Unique issue,redis is key-value struct,if you just want to read,it 's simple,you can see the redis official demo.

        1 Reply Last reply Reply Quote 0
        • mebiusM
          mebius
          last edited by

          hi Hussam

          I need only to read data from redis and know how to program that. Now I need some instruction on how to build such a data source module on MangoAutomation 2.7.

          Could you please give some advice? Or any open source code can be refered.

          Thanks.

          1 Reply Last reply Reply Quote 0
          • phildunlapP
            phildunlap
            last edited by

            Hi Medbius,

            You could consider the SSH data source for this purpose. It provides functionality to SSH into a server using a key, run a command and use regex to parse the result.

            If you consider it necessary to write your own data source, you'll have to pick an API to query which could determine which module would be a good launching point. If you're using the CLI, any module for a polling data source (such as ASCII file) could get you the general structure, and you'll be invoking commands in the runtime within the doPoll method, which you could look at ProcessHandlerRT for some example usage. Then most of the work would be in writing the wrappers to make it usable.

            mebiusM 1 Reply Last reply Reply Quote 0
            • mebiusM
              mebius @phildunlap
              last edited by

              @phildunlap

              Hi phildunlap,

              We really appreciate your kind help. With your help, we made the new module work. But we still met a problem as the data points in watchlist(http://localhost:8080/watch_list.shtm) do not refresh periodically. In the new module, we have removed some data like "timestampFormat".

              Could you please tell us what could possibly make this refreshing not work?

              Thanks

              Mebius

              1 Reply Last reply Reply Quote 0
              • phildunlapP
                phildunlap
                last edited by phildunlap

                Hi mebius,

                Two possibilities come to mind, either...

                1. the session viewing the watchlist has expired. If this were the case, refreshing the page would either correct it or present a login page.
                2. the method you're using to save point values isn't the DataPointRT.updatePointValue method. This method generates events, while going directly through the PointValueCache may not.
                mebiusM 1 Reply Last reply Reply Quote 0
                • mebiusM
                  mebius @phildunlap
                  last edited by

                  @phildunlap

                  I used wrong API as case-2. It works fine now. Thank you very much!

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