• Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Evok, json, Python2.7, read multiple inputs so SLOW??

    Scheduled Pinned Locked Moved Evok API
    2 Posts 1 Posters 1.9k Views
    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.
    • C
      capitanfindus
      last edited by capitanfindus

      Hello, here I post my code. "s" is the server instance from jsonrpclib.

      while 1:
      i1=s.input_get_value(1);
      i2=s.input_get_value(2);
      i3=s.input_get_value(3);
      ......
      If I only read one input, response time is approx 0.1[s]. But if I read all 12 (not DI13 and DI14) inputs (also with for loop writing into array) it takes 0.7 to 0.8 [s].

      Any idea on how to speed this up? I can't have that latency when reading all inputs. My idea is to have a while 1 loop to have coherent info inside it: read input, do my code, set output.

      Thank you for help!
      Is there anything like this?
      https://github.com/kimmoli/evok/commit/14442a67cd79b211c2c8756092a4aa0314f1f741

      ps: UniPi 1.1 (full version wiith 8 output relays)

      ps2: VERY IMPORTANT: in the webbrowser the status of the digital inputs has no delay! I found with measuring timers that is the "s.input_get_value(1)" operation that takes a lot of time. Any other way? Using PIGPIO is ok to read digital inputs?

      1 Reply Last reply
      Reply Quote 0
      • C
        capitanfindus
        last edited by

        Websocket solved the issue. Thank you

        1 Reply Last reply
        Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post