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

    Watchdog and LED Device mixed in JSON/REST Interface

    Official EVOK API
    2
    5
    1212
    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
              • First post
                Last post