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

    get all doesnt get all ?!?

    Official EVOK API
    2
    5
    1612
    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.
    • T
      tja last edited by

      hi all,

      i'm trying to get a complete configuration via evok ws/json.
      but im kinda confused. doc says:

      • 1Wire Device model
      • Analog Input state model
      • Analog Output state model
      • Input state model
      • Relay state model
      • Register state model
      • Neuron state model
      • UART state model
      • ULED state model
      • Watchdog state model
      • WiFi state model (if enabled)

      but all i get is inputs and relays:

      import websocket
      import json
      import logging
      
      logging.basicConfig()
      url = "ws://drhouse:3080/ws"
      
      def on_message(ws, message):
        obj = json.loads(message)
        for single_obj in obj:
          dev = single_obj['dev']
          circuit = single_obj['circuit']
          value = single_obj['value']
          print "Device: " + str(dev) + " / Circuit: " + str(circuit) + " / Value: " + str(value)
        # print json.dumps(obj, indent=2, sort_keys=True)
      
      def on_error(ws, error):
        print error
      
      def on_close(ws):
        print "Connection closed"
      
      def on_open(ws):
        ws.send(json.dumps({"cmd":"all"}))
      
      #receiving messages
      ws = websocket.WebSocketApp(url, on_open = on_open, on_message = on_message, on_error = on_error, on_close = on_close)
      ws.run_forever()
      
      tja@drHouse:~ $ python testGetAll.py > testGetAll.out
      ^Ctja@drHouse:~ cat testGetAll.out ut
      Device: input / Circuit: UART_1_2_05 / Value: 0
      Device: input / Circuit: UART_1_2_18 / Value: 0
      Device: input / Circuit: UART_1_2_16 / Value: 0
      Device: input / Circuit: 1_01 / Value: 0
      Device: input / Circuit: 1_02 / Value: 0
      Device: input / Circuit: 1_03 / Value: 0
      Device: input / Circuit: 1_04 / Value: 0
      Device: input / Circuit: UART_1_2_13 / Value: 0
      Device: input / Circuit: UART_1_2_10 / Value: 0
      Device: input / Circuit: UART_1_2_11 / Value: 0
      Device: input / Circuit: UART_1_2_06 / Value: 0
      Device: input / Circuit: UART_1_2_12 / Value: 0
      Device: input / Circuit: UART_1_2_15 / Value: 0
      Device: input / Circuit: UART_2_3_07 / Value: 0
      Device: input / Circuit: UART_2_3_06 / Value: 0
      Device: input / Circuit: UART_2_3_05 / Value: 0
      Device: input / Circuit: UART_2_3_04 / Value: 0
      Device: input / Circuit: UART_2_3_03 / Value: 0
      Device: input / Circuit: UART_2_3_02 / Value: 0
      Device: input / Circuit: UART_2_3_01 / Value: 0
      Device: input / Circuit: UART_2_3_09 / Value: 0
      Device: input / Circuit: UART_2_3_08 / Value: 0
      Device: input / Circuit: UART_1_2_01 / Value: 0
      Device: input / Circuit: UART_1_2_17 / Value: 0
      Device: input / Circuit: UART_1_2_03 / Value: 0
      Device: input / Circuit: UART_1_2_09 / Value: 0
      Device: input / Circuit: UART_1_2_08 / Value: 0
      Device: input / Circuit: UART_1_2_02 / Value: 0
      Device: input / Circuit: 2_12 / Value: 0
      Device: input / Circuit: 2_13 / Value: 0
      Device: input / Circuit: 2_10 / Value: 0
      Device: input / Circuit: 2_11 / Value: 0
      Device: input / Circuit: 2_16 / Value: 0
      Device: input / Circuit: UART_1_2_04 / Value: 0
      Device: input / Circuit: 2_14 / Value: 0
      Device: input / Circuit: 2_15 / Value: 0
      Device: input / Circuit: UART_3_4_08 / Value: 0
      Device: input / Circuit: UART_1_2_07 / Value: 0
      Device: input / Circuit: UART_1_2_14 / Value: 0
      Device: input / Circuit: UART_3_4_01 / Value: 0
      Device: input / Circuit: UART_3_4_03 / Value: 0
      Device: input / Circuit: UART_3_4_02 / Value: 0
      Device: input / Circuit: UART_3_4_05 / Value: 0
      Device: input / Circuit: UART_3_4_04 / Value: 0
      Device: input / Circuit: UART_3_4_07 / Value: 0
      Device: input / Circuit: UART_3_4_06 / Value: 0
      Device: input / Circuit: UART_2_3_14 / Value: 0
      Device: input / Circuit: UART_2_3_15 / Value: 0
      Device: input / Circuit: UART_2_3_16 / Value: 0
      Device: input / Circuit: UART_2_3_17 / Value: 0
      Device: input / Circuit: UART_2_3_10 / Value: 0
      Device: input / Circuit: UART_2_3_11 / Value: 0
      Device: input / Circuit: UART_2_3_12 / Value: 0
      Device: input / Circuit: UART_2_3_13 / Value: 0
      Device: input / Circuit: UART_2_3_18 / Value: 0
      Device: input / Circuit: 2_05 / Value: 0
      Device: input / Circuit: 2_04 / Value: 0
      Device: input / Circuit: 2_07 / Value: 0
      Device: input / Circuit: 2_06 / Value: 0
      Device: input / Circuit: 2_01 / Value: 0
      Device: input / Circuit: 2_03 / Value: 0
      Device: input / Circuit: 2_02 / Value: 0
      Device: input / Circuit: 2_09 / Value: 0
      Device: input / Circuit: 2_08 / Value: 0
      Device: relay / Circuit: 1_01 / Value: 0
      Device: relay / Circuit: 1_02 / Value: 0
      Device: relay / Circuit: 1_03 / Value: 0
      Device: relay / Circuit: 1_04 / Value: 0
      Device: relay / Circuit: UART_3_4_14 / Value: 0
      Device: relay / Circuit: UART_3_4_12 / Value: 0
      Device: relay / Circuit: UART_3_4_13 / Value: 0
      Device: relay / Circuit: UART_3_4_10 / Value: 0
      Device: relay / Circuit: UART_3_4_11 / Value: 0
      Device: relay / Circuit: 2_12 / Value: 0
      Device: relay / Circuit: 2_13 / Value: 0
      Device: relay / Circuit: 2_10 / Value: 0
      Device: relay / Circuit: 2_11 / Value: 0
      Device: relay / Circuit: 2_14 / Value: 0
      Device: relay / Circuit: UART_3_4_09 / Value: 0
      Device: relay / Circuit: UART_3_4_08 / Value: 0
      Device: relay / Circuit: UART_3_4_01 / Value: 0
      Device: relay / Circuit: UART_3_4_03 / Value: 0
      Device: relay / Circuit: UART_3_4_02 / Value: 0
      Device: relay / Circuit: UART_3_4_05 / Value: 0
      Device: relay / Circuit: UART_3_4_04 / Value: 0
      Device: relay / Circuit: UART_3_4_07 / Value: 0
      Device: relay / Circuit: UART_3_4_06 / Value: 0
      Device: relay / Circuit: 2_05 / Value: 0
      Device: relay / Circuit: 2_04 / Value: 0
      Device: relay / Circuit: 2_07 / Value: 0
      Device: relay / Circuit: 2_06 / Value: 0
      Device: relay / Circuit: 2_01 / Value: 0
      Device: relay / Circuit: 2_03 / Value: 0
      Device: relay / Circuit: 2_02 / Value: 0
      Device: relay / Circuit: 2_09 / Value: 0
      Device: relay / Circuit: 2_08 / Value: 0
      Device: ai / Circuit: 1_01 / Value: 0.0619234416178
      Device: ao / Circuit: 1_01 / Value: 0.0023
      Device: wd / Circuit: 1_01 / Value: 0
      Device: wd / Circuit: 1_01 / Value: 0
      
      Connection closed
      
      1 Reply Last reply Reply Quote 1
      • T
        TomasKnot last edited by TomasKnot

        Websocket has a default filter for the 5 devices you see (di,do,ai,ao,wd), in order to limit the number of events which are sent. You can change this with the filter command, as per: https://evok-4.api-docs.io/1.04/aggjmsqrwmypnmorz/websocket#websocket

        JSON/REST should indeed get all the devices, and is how the web GUI acquires them.

        We have recently improved the JSON validation filter, so that the JSON API should be more reliable. If you use 1Wire or UART extensions you might benefit from upgrading to the 2.04 release (or the latest master).


        edit: After reviewing some past documentation WebSocket 'all' is limited due to compatibility reasons with UniPi 1.1, and it isn't possible to change using the filter command.

        I have now added the ability to use the filter command to change this behavior into the master branch on GitHub, and we'll think about how we can do it better.

        Apologies

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

          This should now also be fixed in the latest release (V2.0.5), at least in the sense that the filter command should also define the update set.

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

            thx tomas !

            is there some safe upgrade procedure for evok or should i just install over the old version ?

            tia,tja...

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

              We don't have an upgrade procedure yet. We plan to move to using debian packages, which will make the problem a lot easier, but for now you should just use a clean system.

              Installing EVOK twice on the same SD Card installation/image might break something, depending on various factors.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post