• Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. Maxiba
    M
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 3
    • Best 0
    • Controversial 0
    • Groups 0

    Maxiba

    @Maxiba

    0
    Reputation
    1
    Profile views
    3
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Maxiba Unfollow Follow

    Latest posts made by Maxiba

    • Unipi 1.1 watchdog?

      Hello,

      how does the watchdog functionality work exactly? I can't seem to find any documentation about watchdog. And how can I Get and Change the watchdog state? I looked in the evok 1.11 API (https://evok-14.api-docs.io/1.11/rest/get-watchdog-state-watchdog-alias)

      The following get requests give me an internal server error 500:

      ("GET", "/rest/wd/1_01", payload)
      ("GET", "/rest/watchdog/1_01", payload)
      ("GET", "/rest/wd/1", payload)
      ("GET", "/rest/watchdog/1", payload)
      ("GET", "/rest/wd/1/1", payload)
      ("GET", "/rest/watchdog/1/1", payload)
      

      whilst input, ai and ouput do work.

      What am I missing? Does the Unipi 1.1 even have a watchdog?

      posted in Official EVOK API
      M
      Maxiba
    • RE: Curl works, Python http.client.request not fully

      Thank you for the answer!

      I am using the websocket API now, as this suits my requirements the most.

      Have a nice day!

      posted in Official EVOK API
      M
      Maxiba
    • Curl works, Python http.client.request not fully

      Hello!

      I'm new to the Unipi. I have Python and general coding/programming experience.

      I have the Unipi 1.1 and a RaspberryPi 3B+. I want to create an application to monitor the rpm of a machine, and if the rpm is ok, i output a signal on a relay.

      For this, i need to read analog and digital inputs and write relay states. I started to play a bit with the Evok API and i ran into following problem:

      1: command line: curl http://localhost:8080/json/input/{1,2} - works
      2: command line: curl http://localhost:8080/json/{input,ai}/{{1,2},1} - works
      3: python: conn.request("GET", "/json/input/1", payload) - works
      4: python: conn.request("GET", "/json/input/{1}", payload) - does not work
      5: python: conn.request("GET", "/json/input/{1,2}", payload) - does not work
      6: python: conn.request("GET", "/json/input/%7B1%7D", payload) - does not work

      Output of #2:

      {"status": "success", "data": {"bitvalue": 0, "glob_dev_id": 0, "value": 0, "circuit": "1", "time": 0, "debounce": 0, "counter_mode": false, "dev": "input"}}{"status": "success", "data": {"bitvalue": 0, "glob_dev_id": 0, "value": 0, "circuit": "2", "time": 0, "debounce": 0, "counter_mode": false, "dev": "input"}}{"status": "success", "data": {"bitvalue": 0, "glob_dev_id": 0, "value": 0, "circuit": "1", "time": 0, "debounce": 0, "counter_mode": false, "dev": "input"}}{"status": "success", "data": {"glob_dev_id": 0, "modes": ["Simple"], "value": 0.0011303831752485904, "circuit": "1", "time": null, "mode": "Simple", "interval": 2.0, "bits": 18, "dev": "ai", "gain": 1}}{"status": "success", "data": {"glob_dev_id": 0, "modes": ["Simple"], "value": 0.0011303831752485904, "circuit": "2", "time": null, "mode": "Simple", "interval": 1.0, "bits": 18, "dev": "ai", "gain": 1}}{"status": "success", "data": {"glob_dev_id": 0, "modes": ["Simple"], "value": 0.0011303831752485904, "circuit": "1", "time": null, "mode": "Simple", "interval": 2.0, "bits": 18, "dev": "ai", "gain": 1}}
      

      Output of #4-#6:

      b'{"status": "error", "message": "Internal Server Error", "code": 500}'
      

      Python-code:

      import http.client
      
      conn = http.client.HTTPConnection("localhost:8080")
      
      payload = "{}"
      
      conn.request("GET", "/json/input/%7B1%7D", payload)
      
      res = conn.getresponse()
      data = res.read()
      
      print(data)
      

      maybe the problem is, how the http.client.request method handles the URL. but i already tried to Encode the URL, and it didnt help...

      What can i try now?

      Best Regards
      Max

      posted in Official EVOK API
      M
      Maxiba