Watchdog and LED Device mixed in JSON/REST Interface
-
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. -
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.
-
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.
-
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.
-
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.44msThe watchog stays inactive. Sometimes my Neuron stops working (every second LED on the main unit is blinking) and a manual power cycle is needed.
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