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

    Error using "jsonrpclib"

    Official EVOK API
    3
    6
    2421
    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.
    • M
      moeins last edited by

      Hi,
      this is my code:

      import websocket
      import json
      from jsonrpclib import Server
      
      s=Server("http://192.168.1.200/rpc")
      s.relay_set(4,1)
      
      

      I am getting always this error:

      File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/jsonrpclib/jsonrpc.py", line 239, in _request
      return response['result']
      TypeError: 'NoneType' object has no attribute 'getitem'

      Raspberry 2 B
      RASPBIAN JESSIE

      1 Reply Last reply Reply Quote 0
      • T
        tomas_hora administrators last edited by

        Hi, is the relay visible in the web interface or the output of the debugging mode? https://github.com/UniPiTechnology/evok#debugging

        1 Reply Last reply Reply Quote 0
        • M
          moeins last edited by

          Hi,

          the relay is visible on the web interface and works fine.
          The output of debugging mode is on the attached screenshot.

          0_1480010164201_screenshot_01.png

          1 Reply Last reply Reply Quote 0
          • M
            moeins last edited by

            0_1480011637271_screenshot_02.png

            1 Reply Last reply Reply Quote 0
            • T
              tomas_hora administrators last edited by tomas_hora

              Could you please try this workadound? https://forum.unipi.technology/topic/86/relay-command-with-python/3
              I thought that this issue has been fixed...

              1 Reply Last reply Reply Quote 0
              • C
                chuckhinds last edited by

                I have a Raspberry Pi 3 running Jessie with fresh installation of Evok. I am also using Python 3.4. I received the error, "TypeError: 'NoneType' object is not subscriptable." The workaround Tomas referred to on Nov 25, 2016, worked, but I first had to install jsonrpclib-pelix, a version of jsonrpclib updated for Python 3. The standard jsonrpclib does not work with Python 3.

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