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

Works great until I try to use the write() method #66

Closed
idealmundo opened this issue Aug 10, 2015 · 1 comment
Closed

Works great until I try to use the write() method #66

idealmundo opened this issue Aug 10, 2015 · 1 comment

Comments

@idealmundo
Copy link

I've had success using bluepy to connect to and read characteristics from the raspberry pi, but when I try to use the write() method, it isn't working:

baddr = 'xx:xx:xx:xx:xx:xx'
device = btle.Peripheral(baddr,'random')
chars = device.getCharacteristics()

chars[9].read()

returns '\x00'

but
chars[9].write('02')

and
chars[9].write('\x02')

accomplish nothing, because if I issue again

chars[9].read()

again I get '\x00'

with gatttool in bash the following works:

gatttool -b xx:xx:xx:xx:xx:xx  -t random --char-write 0x001b -n 02

How can I pass data to a characteristic using the write() method?

Thanks!

@IanHarvey
Copy link
Owner

Firstly, is the characteristic at chars[9] actually writable? If you run 'python btle.py xx:xx:xx:xx:xx:xx' it should give a list of all characteristics and their properties. It would be helpful to have the output from this command here.

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