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

uploadCharacteristics function not working properly #92

Open
ivanbazina opened this issue Feb 26, 2020 · 5 comments
Open

uploadCharacteristics function not working properly #92

ivanbazina opened this issue Feb 26, 2020 · 5 comments

Comments

@ivanbazina
Copy link

uploadCharacteristics function doesn't work (Exception message: communication error).
I downloaded characteristics of fingerprint with downloadCharacteristics function and stored it on my PC. Then deleted that fingerprint and tried to upload it back.

  • I suspect that it is because of data length which is 512 and I am not shure if it should be sent in 2 or 3 separate packages (because maxPackageLength is 256, and checksum is also calculated in packageLength)

  • Also I saw in sensor documentation this line: "Data packet; Data packet shall not appear alone in executing processs, must follow command packet or acknowledge packet."
    I don't see any acknowledge packets sent after data packets.

Does anyone have similar problems?
I will try to fix this but I just started using lib few days ago and if you can help with any idea what is wrong it would be nice.

@philippmeisberger
Copy link
Collaborator

Which sensor do you use? Could you provide some of your code?

@ivanbazina
Copy link
Author

ivanbazina commented Feb 28, 2020

Snesor is R307.
Code is cloned from this repo on development branch.

Update: After I changed maxPacketSize variable in uploadCharacteristics function to 32 it works. (256 is what I get from module, but after that I overwrite it to 32 and then it works) .

Also I added one more line of code for fixing the packets which have length that is not multiple of 32.

I will create pull request so you can see the code.

@ivanbazina
Copy link
Author

I just tried to push new branch with my fixes and I don't have permissions to do it.
Do I need to fork repository before or what?

@philippmeisberger
Copy link
Collaborator

Sure, you need to fork this repo and create a pull request

@ivanbazina
Copy link
Author

I created 2 pull requests:
#93 - I think it should be done anyway
#94 - As I told you, uploading characteristics didn't work for me until I hardcoded maxPacketLength to 32 even it is set to 256 on device.

There is also 1 question in #94 because I am not sure about it - for me it works without that code.

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