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

Two quick commands after each other break #9

Open
Cxarli opened this issue Sep 8, 2019 · 3 comments
Open

Two quick commands after each other break #9

Cxarli opened this issue Sep 8, 2019 · 3 comments

Comments

@Cxarli
Copy link
Contributor

Cxarli commented Sep 8, 2019

For example, tapping twice quickly after another gives clickclick command not found, Eish. I think it's because the client_sock.recv(1024) receives too much at once.

Another case would be {"action":"mouse-move","x":1.811187744140625,"y":1.63995361328125}{"action":"mouse-move","x":2.9740753173828125,"y":0.71514892578125} command not found, Eish

Other than that, this works great! Thank you for making an open-source "It just works" equivalent. Other apps either didn't work, required WiFi, or were paid, so I appreciate this project 😄

@Rudis1261
Copy link
Owner

Rudis1261 commented Sep 8, 2019 via email

@Rudis1261
Copy link
Owner

@C-Bouthoorn Please pull the latest version of the server. I have added some code to try and curb the multiple commands coming through.

You may need to do this to get it to work:

sudo rm -rf core core.pyc #deletes possibly compiled version
git pull origin master
sudo ./bluetooth_server.py

This seems to make the mouse movement a bit smoother since it doesn't "drop" commands due to invalid JSON. Just a note on client_sock.recv(1024) you mentioned, what that means is that it will read up to 1024 bytes per request (1kb). Using something like this https://mothereff.in/byte-counter, you can see how much string content it could parse with 1kb of data.

This is quite fine, since most of these command as tiny. The issue is actually on the phone app, it's sending multiple commands in one string.

This fix should hopefully make it a bit better experience.

@Cxarli
Copy link
Contributor Author

Cxarli commented Oct 6, 2019

It seems to fix the case where two movements follow each other, but the following is still broken:

{"action":"mouse-move","x":0,"y":0}click command not found, or is missing in core

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

2 participants