Comments (7)
I never tried with a v6. Did you order it recently ?
Try connecting with a public address type :
sudo gatttool -t public -b EA:9C:0F:A6:A0:22 -I
from magicblue.
I tried with -t public with V8 and it doesn't works. (only works with -t random).
With v6, I can't connect with both of them.
I bought it through aliexpress 6 months ago.
For v8 I use handle 0x000c and for v6 handle 0x0043, but as I said you, I can't connect throught gattool to test it without the official Android application.
from magicblue.
I tested bulb v6 with your app and it works, but only on interactive mode:
sudo python3 magicblueshell.py
Magic Blue interactive shell v0.4.2
Type "help" for a list of available commands
> list_devices
Listing Bluetooth LE devices in range for 300 seconds. Press CTRL+C to abort searching.
ID Name Mac address
-- ---- -----------
1 LEDBlue-72C816D6 d0:39:72:c8:16:d6
> connect 1
INFO:__main__:Connected
> set_color green
When I tried to change the color without interactive mode, it doesn't work:
sudo python3 magicblueshell.py -c 'set_color blue' -m d0:39:72:c8:16:d6
Traceback (most recent call last):
File "magicblueshell.py", line 307, in <module>
sys.exit(main())
File "magicblueshell.py", line 298, in main
shell.cmd_connect([params.mac_address])
File "magicblueshell.py", line 159, in cmd_connect
self._magic_blue.connect(self.bluetooth_adapter)
File "/usr/local/lib/python3.5/dist-packages/magicblue-0.4.2-py3.5.egg/magicblue/magicbluelib.py", line 119, in connect
File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 318, in __init__
self.connect(deviceAddr, addrType, iface)
File "/usr/local/lib/python3.5/dist-packages/bluepy/btle.py", line 367, in connect
"Failed to connect to peripheral %s, addr type: %s" % (addr, addrType))
bluepy.btle.BTLEException: Failed to connect to peripheral d0:39:72:c8:16:d6, addr type: random
Do you know why it doesn't works? What is the difference between interactive connection and non-interactive connection?
from magicblue.
I tried with MAC but it doesn't work, but if I use the ID it works. Why is it?
> list_devices
Listing Bluetooth LE devices in range for 300 seconds. Press CTRL+C to abort searching.
ID Name Mac address
-- ---- -----------
1 LEDBlue-72C816D6 d0:39:72:c8:16:d6
^C
> connect d0:39:72:c8:16:d6
ERROR:__main__:Unexpected error with command "connect d0:39:72:c8:16:d6": Failed to connect to peripheral d0:39:72:c8:16:d6, addr type: random
> connect 1
INFO:__main__:Connected
from magicblue.
I solved!
I don't know why, but version 6, is equal to version 9 or 10.
read device_info
INFO:__main__:Received device_info: {'r': 0, 'effect_speed': 0, 'brightness': 255, 'device_type': 21, 'version': 6, 'on': True, 'g': 0, 'effect': None, 'effect_no': 65, 'b': 0}
If I choose any of these versions, it works
sudo python3 magicblueshell.py -c 'set_warm_light 1.0' -m d0:39:72:c8:16:d6 -b 9
from magicblue.
Do you know why it doesn't works? What is the difference between interactive connection and non-interactive connection?
Interactive mode auto-detect address type during scan. We don't do this when connecting directly or using the library for performance reasons.
However setting version to 9 or 10 forces address type to be a public address, that means v6 uses a public address type too. I'll make a commit to officially support this version with the info you provided.
Thanks for your feedback 👍
from magicblue.
Merged with master, will be included in next release. You can continue to use -b 9
or -b 10
, it won't have any other impacts.
from magicblue.
Related Issues (20)
- Add support for functions (strobe, colors crossfade...etc) HOT 1
- UnboundLocalError: local variable 'addr_type' referenced before assignment HOT 3
- Publish to pypi HOT 2
- Add support for time schedules HOT 1
- Multiple bulbs setup HOT 14
- v8 bulbs can't connect sometimes HOT 5
- Testing the library without the actual bulb (suggestion) HOT 1
- MagicBlue interactive shell enhancement with python-prompt-toolkit
- API Usage HOT 9
- x86 architecture HOT 6
- Tkinter GUI HOT 3
- Install and run magicblue in Raspbian Stretch (kernel version 4.9) - SOLVED! HOT 3
- Issues using magic blue HOT 3
- bluepy 1.20 is out HOT 2
- Cannot connect from shell HOT 4
- question: other lights HOT 5
- loss of connection after 10-15 minutes HOT 2
- Dependabot couldn't authenticate with https://pypi.python.org/simple/
- b
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from magicblue.