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

    EVOK: wget/POST api only works when control panel is open in browser

    Scheduled Pinned Locked Moved Official API - Evok
    8 Posts 3 Posters 5.3k Views 1 Watching
    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.
    • R
      rob
      last edited by

      Re: Enabling counter mode for Neuron inputs via evok

      After discovering that counter_mode for digital inputs on Neuron S103 is actually enabled even though it is reported as disabled by evok POST api, I implemented my business logic as a simple bash script which uses wget as per the examples on the evok github page.

      It works nicely, but ONLY if I have a browser open on the "UNIPI control panel" page.

      As soon as I close the browser, all values are not updated anymore!
      Polling the counter value from my bash script always returns an old number (and old values of input states also), and as soon as I reopen the browser on the control panel I get a big jump in the counter in my app.

      It seems as if EVOK only updates its internal state if a websocket connection is in place.
      This seems horribly wrong to me: is it by design? Is there something wrong in my setup?

      Anyone else having this issue?
      Please advise.

      rob

      T 1 Reply Last reply
      Reply Quote 0
      • T
        tomas_hora administrators @rob
        last edited by

        @rob Thanks a lot for the info. I will try to implement the fix soon, https://github.com/UniPiTechnology/evok/issues/14

        1 Reply Last reply
        Reply Quote 0
        • R
          rob
          last edited by

          @tomas, thank you for taking care of this issue.

          Let me add some more info:

          1. I tried also the python/JsonRPC approach and I can confirm it behaves the same way, it only updates the values while a websocket connection is in place.

          2. As a workaround, I am using the code from the python websocket example on the evok github page to open a websocket connection from bash. I let it run in background on the rpi and this is enough for my original bash script (also running locally) to get the right real-time values from the REST calls, without the need to keep a separate computer running with the browser open on the control panel webpage.

          3. In the output of the python websocket app I only see the temperature values updating, but no reflection of input and output state changes... I did not investigate further, but tomas you might want to take a look at that also.

          I must say I really like the neuron concept and its combination with Evok, programming a PLC with standard linux tools, it just feels... empowering :)
          Hoping the stable, official release for Neuron comes soon.

          Also, let me suggest to improve the documentation... I know, it's tedious and time consuming, but good documentation gives first time customers like me the feeling of a robust product with a solid company behind, and makes everything just easier to start with.
          Keep up the great work guys!!

          rob

          1 Reply Last reply
          Reply Quote 0
          • M
            Merv
            last edited by

            This is causing me a problem too.....

            T 1 Reply Last reply
            Reply Quote 0
            • T
              tomas_hora administrators @Merv
              last edited by

              @Merv I saw your comment on github. I will get to it soon.

              T 1 Reply Last reply
              Reply Quote 0
              • T
                tomas_hora administrators @tomas_hora
                last edited by

                @tomas_hora The issue should be fixed in one of the latest commits. Please check and let me know.

                M 1 Reply Last reply
                Reply Quote 1
                • M
                  Merv
                  last edited by

                  That's brilliant.
                  I have some new micro SD cards on order, I'll do a clean new install and test once they arrive.

                  Merv.

                  1 Reply Last reply
                  Reply Quote 0
                  • M
                    Merv @tomas_hora
                    last edited by

                    @tomas_hora Hi,
                    I did a fresh Rasbian install, got the neuron online, did a
                    git clone http.....
                    set the permissions (as per the GIT page)
                    started it up.
                    and....

                    PERFECT!

                    I have my python monitoring program starting automatically as a service, and I had to put a little sleep command in it on start as it was trying to run before EVOK started. Runs great.

                    Many thanks.
                    Merv.

                    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