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

    Watchdog and LED Device mixed in JSON/REST Interface

    Scheduled Pinned Locked Moved Official API - Evok
    5 Posts 2 Posters 2.6k 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.
    • J
      Joerg
      last edited by

      When I try to get the status of my watchdogs with i.e. http://unipi:8080/json/wd/1_01 I get back the status of the first LED:

      {"status": "success", "data": {"value": 0, "circuit": "1_01", "dev": "led", "glob_dev_id": 1}}
      

      This is the same output I get from http://unipi:8080/json/**led**/1_01. With wd 2_01 I get an internal server error, for led 2_01 the output is right.

      When I look at json/all, both watchdogs are there:

          {
            "circuit": "1_01",
            "value": 0,
            "glob_dev_id": 1,
            "dev": "wd",
            "timeout": 5000,
            "was_wd_reset": 0,
            "nv_save": 0
          },
          {
            "circuit": "2_01",
            "value": 0,
            "glob_dev_id": 1,
            "dev": "wd",
            "timeout": 5000,
            "was_wd_reset": 0,
            "nv_save": 0
          },
      

      What would be the right Statement to get (and set) watchdog states?
      The web interface shows the values, but no changes are possible.
      I run Fw: v5.31 on board E_8Di8Ro.

      1 Reply Last reply
      Reply Quote 0
      • T
        TomasKnot
        last edited by TomasKnot

        Hi @Joerg!

        This looks like a bug in EVOK. The /rest/wd interface should return it correctly, I'll fix this in the github repository shortly, but it may take a little while before it gets into a debian package.

        Once the update appears on GitHub you may be able to update EVOK manually by overwriting your /opt/evok/lib/python2.7/site-packages/evok/evok.py with the new version, or you can wait until the next EVOK release.

        1 Reply Last reply
        Reply Quote 0
        • J
          Joerg
          last edited by

          Hi Tomas,

          thanks a lot for the quick answer. You are right, the /rest/wd returns the right values, but I'm still not able to activate the watchdogs:

          $ /usr/bin/curl --request POST --url http://unipi:8080/rest/wd/1_01 --data 'value=1'
          {"result": {"circuit": "1_01", "value": 0, "glob_dev_id": 1, "dev": "wd", "timeout": 5000, "was_wd_reset": 0, "nv_save": 0}, "success": true}
          $ /usr/bin/curl --request GET --url http://unipi:8080/rest/wd/1_01 --data ''
          {"circuit": "1_01", "value": 0, "glob_dev_id": 1, "dev": "wd", "timeout": 5000, "was_wd_reset": 0, "nv_save": 0}
          

          Whereas setting of ULED works:

          $ /usr/bin/curl --request POST --url http://unipi:8080/rest/led/1_01 --data 'value=1'
          {"result": {"value": 1, "circuit": "1_01", "dev": "led", "glob_dev_id": 1}, "success": true}
          $ /usr/bin/curl --request GET --url http://unipi:8080/rest/led/1_01 --data ''
          {"value": 1, "circuit": "1_01", "dev": "led", "glob_dev_id": 1}
          

          I also tried setting it with the sample web interface, led works, watchdog does not.

          1 Reply Last reply
          Reply Quote 0
          • T
            TomasKnot
            last edited by

            It should be fixed in the latest Master development version on GitHub, but it may take a little while before the next release is done. You can test it out yourself by replacing the file as detailed above.

            1 Reply Last reply
            Reply Quote 0
            • J
              Joerg
              last edited by

              Sorry Tomas, maybe I have problems understanding watchdog operation. I have the new evok.py in place and when trying to activate (not to perform manual reset) the watchdog on the web interface I get:

              [I 190116 08:04:54 web:2064] 304 GET /rest/wd/1_01/ (::1) 4.81ms
              [I 190116 08:04:59 neuron:1296] Performed reset of board 1_01
              [I 190116 08:04:59 web:2064] 200 POST /rest/wd/1_01/ (127.0.0.1) 13.44ms
              

              The watchog stays inactive. Sometimes my Neuron stops working (every second LED on the main unit is blinking) and a manual power cycle is needed.

              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