Sphero Mini not responding to wake command

I’m following the General API docs to attempt to power on my Sphero Mini by writing to the device’s GATT command characteristic after connecting to it through BLE with an iOS device. However, after writing what I believe is the correct packet for wake ([0x8d, 0x3e, 0x11, 0x01, 0x13, 0x0d, 0x00, 0x8f, 0xd8]), the Sphero Mini doesn’t light up white and disconnects a few seconds later. I don’t receive a response on the characteristic I wrote to also.

    await bleClient.connect(peripheralID);
    const commandService = '00010001-574f-4f20-5370-6865726f2121';
    const commandChar = '00010002-574f-4f20-5370-6865726f2121';
    const dfuService = '00020001-574f-4f20-5370-6865726f2121';
    const dfuChar = '00020002-574F-4F20-5370-6865726F2121';
    await bleClient.startNotification(peripheralID, commandService, commandChar);
    await bleClient.startNotification(peripheralID, dfuService, dfuChar);
    const wake = [0x8d, 0x3e, 0x11, 0x01, 0x13, 0x0d, 0x00, 0x8f, 0xd8];
    await bleClient.write(peripheralID, service, char, wake);
    this.log('Wake initiated');

Can anyone correct me on what I’m doing wrong? Any help would be appreciated. (Using the SDK is not an option for me, as I’m connecting with an iOS device and not a Raspberry PI/Arduino/etc.)

1 Like

This is what I used on Android for power up and power down. I did not try to get a response back, so I don’t know if these return responses

byte[] powerDown = new byte[]{
            (byte) -115,
            (byte) 24,
            (byte) 1,
            (byte) 19,
            (byte) 1,
            (byte) 1,
            (byte) -47,
            (byte) -40
    };

	byte[] wakeUp = new byte[]{
			(byte) -115,
			(byte) 24,
			(byte) 0,
			(byte) 19,
			(byte) 13,
			(byte) 1,
			(byte) -58,
			(byte) -40
	};

Looking at what the hex values are (0x has been omitted):

Wakeup: 8D,18,00,13,0D,01,C6,D8
Sleep: 8D,18,01,13,01,01,D1,D8
1 Like

@btelman96 Just tried the values you suggested for wakeup and it didn’t work unfortunately :frowning: Besides starting notification on the command characteristic and the DFU characteristic, did you initialize the peripheral in any other way?

1 Like

As far as I know mine does the same that yours does based on that code, but the Android SDK does seem to differ a bit from iOS. I don’t handle the DFU service and DFU characteristic though.

1 Like

Can you share what flags you’re using for the FLAGS byte? I switched my flags byte to just 08 but it still doesn’t work. Can you also explain why you’re sending a 01 byte for the data (I presumed that the wake command would not need any message data).

Also, just to confirm, the Sphero Mini is supposed to light up white when you’ve awoken it successfully like the Play app does, or does it not have any indication besides responding to commands?

1 Like

My bad. Just realized this was Sphero mini and not Sphero RVR.

Also not sure what you mean by flags byte. Not quite sure exactly how the Sphero API works, as I pulled these commands from the python SDK for RVR.

I am assuming the platforms are probably pretty similar, but the command might be slightly different, so not sure if I can help further.

The 01 byte for the data was there when I pulled the command from the python SDK for Sphero RVR, so was not aware what it did at the time.

1 Like

Hi @blep, welcome to our forums.

One major problem will be that you’re reading Sphero API v2.1 docs intended for RVR, and Sphero Mini uses Sphero API v2. There isn’t any official public documentation of API v2, as we never published an SDK supporting the products that use it (Mini, Force Band, and to varying extents R2-D2, BB-8, and Lightning McQueen). Although I can’t point you to any comprehensive docs, I can give you some quick hints:

  • The v2 packet structure is similar, but there is no concept of a target or source address. The corresponding flag bits should be left at zero, and the target and source address bytes should be omitted.
  • Some commands are shared between RVR and Mini, but many unfortunately are not, so RVR docs at sdk.sphero.com won’t be all that helpful beyond the description of the protocol minus the addressing parts. Targeted addressing wasn’t needed on Mini because it has a single processsor.
  • There are some 3rd party SDKs floating around (I’m not sure what the policy is regarding staff linking such things, but if you use your preferred search engine and search for things like “Sphero Mini python” etc, you’ll be able to find some examples that other users have written.
  • You can also use a BLE sniffer with WireShark to capture the traffic between Mini and the EDU or Play apps and approach it that way.

It’s great to see you’re digging into it at a low level, best of luck with your project!

-Jim

1 Like