-
Notifications
You must be signed in to change notification settings - Fork 90
Unable to connect to the Sphero Mini #95
Comments
Hi ! I'm getting the same error on OSX and using Sphero Mini. |
I have both a mini and a sprk+. I've noticed that the output from |
I'm running into the same error with a mini on Ubuntu 14.04. I'm running on a Thinkpad X230 with a Broadcom Corp. BCM20702 Bluetooth 4.0. Just for troubleshooting sake, how are you identifying the mini? I can't find much on the naming conventions for the Sphero Mini, but guessed that it was the device I found with local name "SM-9D49". Does this match the naming convention you're seeing? Just fyi, here's the output of peripheral-explorer.js that I see:
|
From what I can tell you're info is similar to what I have. My output is below and the Local Name seems to be similar to yours. peripheral with ID d1cfcbccf40e found services and characteristics: For comparison here's the output from my sprk+ which does connect and is working. Notice how much more info is being output: peripheral with ID c904e6b3436a found services and characteristics: |
Having same issue with Sphero R2-D2. My output from peripheral-explorer.js is below and looks similar to the one above from the Sphero Mini.
|
In lines 64 - 70 of
Presumably, we could fix this specific problem by putting in the corresponding UUIDs for the newer models. I can't see any way to figure out what any of these services mean. Also, given that there seems to have been a bunch of updates, there probably will be other bugs we'll have to fix. |
I think it's unlikely that this is going to be fixed any time soon. Sphero seems to have more or less abandoned it. I think that if we want to control our Sphero minis with a fully featured code base, we'll have to do it ourselves or use a different project. One of the big developers for this project seems to have moved to the hybrid group, who actually responded to a sphero mini feature request on their go based interface. That group also seems to have an actively maintained javascript adapter, but it seems like it is dependent on sphero.js. |
Exploring @ThomasProctor find I've copied the node_modules/sphero/lib/adaptors/ble.js to node_modules/sphero/lib/adaptors/ble2.js changed the service address to "00010001574f4f2053706865726f2121" and passed in a custom my initialization: global.bb8 = sphero('d1cfcbccf40e',{adaptor:"ble2"}); No crash for characteristic. but when I try and pass in a command I now get: Unhandled rejection TypeError: this.connection.write is not a function |
Hmm... I tried something similar, but didn't get that error. What did you set as the service address? Within ble.js, I was thinking of just trying every permutations of the UUIDs that our minis show, but I think that I'd prefer to use gobot instead. |
I used: 00010001574f4f2053706865726f2121 from the output from the service UUID out of peripheral-explorer.js |
I am trying to build a js lib for the new toys, I will get back when I get it working :) |
@xocialize Got it working with my sdk! adding more functionality right now and making it more robust implementation. |
@igbopie That's very impressive. Let me know when you're at a point for some testing. I've run into a few issues with disconnecting the spheros with BLE that I'd love to discuss when you're at that point if you're willing. |
@xocialize I think it is ready for some testing, I can't figure out the sensor data, I probably need a hand over there :) |
Hi all, I have recently got a Sphero Mini and have decided to try to put together a Python library for it (because I mainly code in Python). So far, I have managed to establish a BLE connection using Bluepy, determined the available services and characteristics, and then - by reverse-engineering @igbopie 's javascript library - wake up the device, and (so far) change the LED colour. But @igbopie , I have a few questions for you. How did you manage to determine the correct sequence of actions when writing your library? For example, in your start() function in core.js, you begin by writing the string 'usetheforce...band' to the "antiDoSCharacteristic" characteristic. This seems to stop my device from disconnecting after 10 seconds, but how did you know to write that phrase to that characteristic? Did you analyze the hcidump when coding using the Sphero Edu app? If so, it must have taken ages. Similarly, in the method to change the colour of an LED based on a RGB values (setMainLedColor() in user-io.js), the first two bytes of the payload are 0 and 144, with the R, G and B byte vales thereafter. How did you determine these and other similar values? Your code has been very helpful for me (thank you!) but I'm struggling to follow because Javascript is something that I have almost no experience with. |
@igbopie I am having the same issue of not detecting my Sphero mini. I'm actually using your library and it simply just says scanning devices and never finds anything. Suggestgions are appreciated. |
My build environment is a raspberry pi 3 with the "stretch" as the OS. I can successfully connect and control the sprk+ but I receive the following error when trying to connect to the mini.
/var/public/node_modules/sphero/lib/adaptors/ble.js:405
return this._connectedService(serviceId).characteristics;
^
TypeError: Cannot read property 'characteristics' of null
at Adaptor._connectedCharacteristics (/var/public/node_modules/sphero/lib/adaptors/ble.js:405:43)
at Adaptor._connectCharacteristic (/var/public/node_modules/sphero/lib/adaptors/ble.js:358:12)
at /var/public/node_modules/sphero/lib/adaptors/ble.js:303:12
at /var/public/node_modules/sphero/lib/adaptors/ble.js:346:9
at Peripheral. (/var/public/node_modules/noble/lib/peripheral.js:73:7)
at Object.onceWrapper (events.js:254:19)
at Peripheral.emit (events.js:159:13)
at Noble.onServicesDiscover (/var/public/node_modules/noble/lib/noble.js:208:16)
at NobleBindings.emit (events.js:159:13)
at NobleBindings.onServicesDiscovered (/var/public/node_modules/noble/lib/hci-socket/bindings.js:291:8)
at Gatt.emit (events.js:159:13)
at Gatt. (/var/public/node_modules/noble/lib/hci-socket/gatt.js:361:12)
at Gatt.onAclStreamData (/var/public/node_modules/noble/lib/hci-socket/gatt.js:132:26)
at AclStream.emit (events.js:164:20)
at AclStream.push (/var/public/node_modules/noble/lib/hci-socket/acl-stream.js:35:10)
at NobleBindings.onAclDataPkt (/var/public/node_modules/noble/lib/hci-socket/bindings.js:272:15)
The text was updated successfully, but these errors were encountered: