Closed jasonlshelton closed 7 years ago
BTW: Same dongle in a RP2 and I get:
BirdyCam bluetooth # csrmesh-cli --pin 0000 --dest E0:34:E4:02:01:EB --level 0 Running gatttool -b E0:34:E4:02:01:EB --char-write-req -a 0x0011 -n 0e3cca0080d83a5e95bfedf3d6d9b9ec36b22db0 connect error: Function not implemented (38) Running gatttool -b E0:34:E4:02:01:EB --char-write-req -a 0x0014 -n 64df08ff connect error: Function not implemented (38)
Does the dongle you are using support BT low energy? Also, the version currently on PyPi currently does not work properly with Python 2.x. I plan to push a new version that works with 2.x and 3.x tonight. Identified another bug in the git version and fixed just now, make sure to pull from Git before continuing to troubleshoot.
0.6 version on pypi and Github with all known issues fixed
I've used an Acer C720 with the latest Arch Linux release available today as well as a Raspberry Pi 3 with Raspbian Jessie as test platforms FYI.
Updated and still getting:
Traceback (most recent call last):
File "/usr/local/bin/csrmesh-cli", line 16, in
change the line again to read:
payload = bytearray([ chr(ord(a) ^ ord(b)) for (a,b) in zip(data, ebase) ])
and get the:
connect error: Function not implemented (38)
error. This dongle does support BTLE, lsusb gives me:
Bus 001 Device 005: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
the chip is a CSR8510 A10
Can you connect to the device manually using gatttool in interactive mode?
nope, I get the same sort of error:
Error: connect error: Function not implemented (38)
However, this does not explain the first error I get about the str and int in a bitwise OR
Hcitool gives me this:
Connection handle 72
so it looks like that works
This is a Bluetooth stack issue, what version of bluez are you running? Also good catch on the Python 2.7 bug! If you want to submit a pull request so you get "credit" for it please do so otherwise I will fix.
Your fix is correct too. Looking back at mjg59's commit to add Python 2.7 compatibility, that is where the bitwise XOR data type bug was introduced.
I don't really know how to do a pull request, so I'll leave it to you.
I removed bluez with apt and compiled the latest, 5.42
Is there a way to get more debugging info? I'm just figuring out all this bluetooth stuff.
I was trying to push the changed code, but I get permission denied. I've not contributed to a git project before so I'm trying to figure that out as well. Do you need to add me as a contributor before I can upload changes?
Can you connect successfully to the bulb using gatttool in interactive mode?
Nash Kaminski
On October 22, 2016 2:09:18 AM CDT, jasonlshelton notifications@github.com wrote:
change the line again to read:
payload = bytearray([ chr(ord(a) ^ ord(b)) for (a,b) in zip(data, ebase) ])
and get the: connect error: Function not implemented (38) error. This dongle does support BTLE, lsusb gives me: Bus 001 Device 005: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)the chip is a CSR8510 A10
You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/nkaminski/csrmesh/issues/10#issuecomment-255512160
Sent from my Android device with K-9 Mail.
As I said before nope, I get the same sort of error:
Error: connect error: Function not implemented (38)
Cannot reproduce on my Acer c720 or Pi 3. Will look into it more later since this looks like a bluez or driver issue.
I'm using my laptop now, with the same bluetooth dongle that I had on the Pi2, now I'm getting this: AsusLaptop ~ csrmesh-cli --pin 7735 --dest E0:34:E4:02:01:EB --level 0 Running gatttool -b E0:34:E4:02:01:EB --char-write-req -a 0x0011 -n 14349e00807efa972c0383d1d283dd0145dc1ceb Characteristic Write Request failed: A timeout occured Running gatttool -b E0:34:E4:02:01:EB --char-write-req -a 0x0014 -n 5506f2ff Characteristic Write Request failed: A timeout occured
Same as my first post, but I noticed that the lightbulb does go to full brightness anytime a command is sent to it, even if I use level 0
What firmware version on the bulb according to the (official) app?
Firmware is 0.16
The current version of this library works for several other users, with identical CSRMesh devices. Therefore this is almost certainly a Bluez or bluetooth hardware related issue.
Freshly installed with pip and I get the following:
AsusLaptop bluetooth # csrmesh-cli --pin 0000 --dest E0:34:E4:02:01:EB --level 0 Traceback (most recent call last): File "/usr/local/bin/csrmesh-cli", line 16, in
p = cm.make_packet(cm.network_key(args.pin),cm.random_seq(),cm.light_set_cmd(args.level,args.red,args.green,args.blue))
File "/usr/local/lib/python2.7/dist-packages/csrmesh/init.py", line 26, in make_packet
payload = bytes([ a ^ b for (a,b) in zip(data, ebase) ])
TypeError: unsupported operand type(s) for ^: 'str' and 'str'
I changed that line to read payload = bytes([ ord(a) ^ ord(b) for (a,b) in zip(data, ebase) ])
And it runs, but nothing happens, I get :
AsusLaptop bluetooth # csrmesh-cli --pin 1111 --dest E0:34:E4:02:01:EB --level 0 Running gatttool -b E0:34:E4:02:01:EB --char-write-req -a 0x0011 -n 44986300805b3233372c203130302c742af81aa3 Characteristic Write Request failed: A timeout occured Running gatttool -b E0:34:E4:02:01:EB --char-write-req -a 0x0014 -n 82167bff Characteristic Write Request failed: A timeout occured
Help?