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

    Error using "jsonrpclib"

    Scheduled Pinned Locked Moved Official API - Evok
    6 Posts 3 Posters 4.1k Views 1 Watching
    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

                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
                • First post
                  Last post