Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server on Python3 - changes required #11

Open
BaggyLala opened this issue May 2, 2018 · 3 comments
Open

Server on Python3 - changes required #11

BaggyLala opened this issue May 2, 2018 · 3 comments
Assignees

Comments

@BaggyLala
Copy link

The code as it stands doesnt like sending the NAKs or AKs

eg.

in handler clientsock.send(NAK)
TypeError: a bytes-like object is required, not 'str'

so I commented this out (line 104 i think) and found that the string being received is as follows
received:b'{'
which looks like the ispindel is sending the code to convert a { into a byte value rather than the actual {
so if I bypass this as its essentially sending the { and change the check to

if inpstr[2] != "{" :

then things continue to the next step and I get stuff like

         _('xxx.xxx.xxx.xxx', 2043) received:b'"name":"iSpindel001","ID":748188,"angle":73.62824,"temperature":32.375,"battery":4.035453,"gravity":1.239934,"interval":30,"RSSI":-49}\r\n'

('xxx.xxx.xxx.xxx', 2043) Not JSON.
('xxx.xxx.xxx.xxx', 2043) - closed connection_

So two questions

  1. How best to fix the original NAK issue (& do I need to fork a seperate version for Python 3)?
  2. Is the problem of the extra characters with the iSpindel software (Sorry I know nothing of JSON yet)?

iSpindel is at 5.85

@DottoreTozzi
Copy link
Owner

I will look into this. It might have to do with Python 3 indeed as I have not noticed this behaviour with 2.7.
I am currently working on this part of the code anyway, so stay tuned and thanks for the info!

@DottoreTozzi DottoreTozzi self-assigned this May 6, 2018
@DottoreTozzi
Copy link
Owner

We'll switch to Python3 with the next release.

@rhys-ender
Copy link

Any word on Python 3?

I would be happy to contribute if you don't have the time...

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

No branches or pull requests

3 participants