Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Message parse error #4

Open
smith153 opened this issue Feb 22, 2017 · 3 comments
Open

Message parse error #4

smith153 opened this issue Feb 22, 2017 · 3 comments

Comments

@smith153
Copy link

Currently items that do not return with an '.id' attribute are not parsed correctly since the talk() method tried to group the returned messaged by the '.id'. Take for example a call to "/system/health/getall". Normally only '{}' is returned but here is the debug output:

DEBUG:tikapy.api:<<< /login
DEBUG:tikapy.api:<<<
DEBUG:tikapy.api:>>> !done
DEBUG:tikapy.api:>>> =ret=b7d111a30dfcd1961a35078aa325748b5
DEBUG:tikapy.api:>>>
DEBUG:tikapy.api:<<< /login
DEBUG:tikapy.api:<<< =name=admin
DEBUG:tikapy.api:<<< =response=005103b580598061d06ca196a
DEBUG:tikapy.api:<<<
DEBUG:tikapy.api:>>> !done
DEBUG:tikapy.api:>>>
DEBUG:tikapy.api:<<< /system/health/getall
DEBUG:tikapy.api:<<<
DEBUG:tikapy.api:>>> !re
DEBUG:tikapy.api:>>> =voltage=37.3
DEBUG:tikapy.api:>>> =temperature=60
DEBUG:tikapy.api:>>>
DEBUG:tikapy.api:>>> !done
DEBUG:tikapy.api:>>>
DEBUG:tikapy:>>> [('!re', {'voltage': '37.3', 'temperature': '60'}), ('!done', {})]
{}

A simple fix would be to add an id attribute if one is not found and keep track of the index. I can submit a fork if needed.

@otterbotter
Copy link

@smith153
I was stuck with this for a bit as I'm trying to extract information from a /health/system/print call.
Would you mind submitting a fork or sending me the code required to get around this?

As of right now I've hacked the code by bypassing the current json extract method and implementing my own.

-Jaron

@andrekeller
Copy link
Member

Hi,

if you submit a pull request, it's likely to get merged :-)

@shidalgo21
Copy link

Hi, I'm new to this programming world. I want to connect to the RB and I get this error. Thank you

could not establish SSL connection
Traceback (most recent call last):
File "c:\users\stanl\onedrive\documents\visual studio 2017\Projects\prueba\prueba\prueba.py", line 8, in
client.login('prueba', '123456')
File "C:\Program Files\Python36\lib\site-packages\tikapy_init_.py", line 162, in login
self.connect()
File "C:\Program Files\Python36\lib\site-packages\tikapy_init
.py", line 248, in _connect
raise ClientError('could not establish SSL connection')
tikapy.ClientError: could not establish SSL connection

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants