Constant disconnect 2x ioio on bluetooth

99 views
Skip to the first unread message

Martin Jensen

unread,
5 Sept 2016, 17:09:3605/09/2016
to ioio-users
I've got two IOIO's on bluetooth which works on my two Samsung tablets, Tab 2 7.0 (5.1.1) and Note 10.1 (6.0.1) but not on my Lenovo Tab 2 A7-10 (5.0)

It gives me this:
38.174 7938-8162/D/IOIOImpl: Waiting for IOIO connection
38.174 7938-8162/V/IOIOImpl: Waiting for underlying connection
38.174 7938-8162/D/BluetoothDevice: mAddress: XXXX
38.174 7938-8162/V/BluetoothIOIOConnection: Attempting to connect to Bluetooth device: IOIO (71:14)
38.174 7938-8162/W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
38.348 7938-8162/V/BluetoothIOIOConnection: Established connection to device IOIO (71:14) address: XXXX
38.349 7938-8162/V/IOIOImpl: Waiting for handshake
38.382 7938-8261/I/IncomingState: IOIO Connection established. Hardware ID: SPRK0020 Bootloader ID: IOIO0400 Firmware ID: IOIO0506
38.382 7938-8162/V/IOIOImpl: Querying for required interface ID
38.407 7938-8162/V/IOIOImpl: Required interface ID is supported
38.407 7938-8162/I/IOIOImpl: IOIO connection established
38.609 7938-8261/I/IOIOProtocol: IOIO disconnected
38.609 7938-8261/D/IOIOImpl: Physical disconnect.
38.609 7938-8261/V/BluetoothIOIOConnection: Client initiated disconnect

So it's basically disconnecting / connecting all the time.

I've noticed this line:
getBluetoothService() called with no BluetoothManagerCallback

this only shows on my Lenovo tablet, but it's only a warning and Stack Overflow says you can ignore this.

Will this not work on my Lenovo tablet? or could I try something to make it work universally? Tell me if you need some more information or I can turn on debugging etc.

Ytai Ben-Tsvi

unread,
10 Sept 2016, 22:51:3310/09/2016
to ioio-...@googlegroups.com
Does this happen with the precompiled apps too?

--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+unsubscribe@googlegroups.com.
To post to this group, send email to ioio-...@googlegroups.com.
Visit this group at https://groups.google.com/group/ioio-users.
For more options, visit https://groups.google.com/d/optout.

Martin Jensen

unread,
30 Sept 2016, 19:27:2930/09/2016
to ioio-users
I get this with HelloIOIO pre-compiled:

10-01 01:23:10.754 16257-16360/ioio.examples.hello V/BluetoothIOIOConnection: Attempting to connect to Bluetooth device: IOIO (71:02)
10-01 01:23:10.754 16257-16360/ioio.examples.hello W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
10-01 01:23:11.759 16257-16360/ioio.examples.hello V/BluetoothIOIOConnection: Attempting to connect to Bluetooth device: IOIO (71:02)
10-01 01:23:11.759 16257-16360/ioio.examples.hello W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
10-01 01:23:11.804 16257-16361/ioio.examples.hello V/BluetoothIOIOConnection: Attempting to connect to Bluetooth device: IOIO (71:14)
10-01 01:23:11.804 16257-16361/ioio.examples.hello W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
10-01 01:23:12.806 16257-16361/ioio.examples.hello V/BluetoothIOIOConnection: Attempting to connect to Bluetooth device: IOIO (71:14)
10-01 01:23:12.807 16257-16361/ioio.examples.hello W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
10-01 01:23:12.854 16257-16360/ioio.examples.hello V/BluetoothIOIOConnection: Attempting to connect to Bluetooth device: IOIO (71:02)
10-01 01:23:12.854 16257-16360/ioio.examples.hello W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
10-01 01:23:13.857 16257-16360/ioio.examples.hello V/BluetoothIOIOConnection: Attempting to connect to Bluetooth device: IOIO (71:02)
10-01 01:23:13.857 16257-16360/ioio.examples.hello W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
10-01 01:23:13.905 16257-16361/ioio.examples.hello V/BluetoothIOIOConnection: Attempting to connect to Bluetooth device: IOIO (71:14)
10-01 01:23:13.905 16257-16361/ioio.examples.hello W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
10-01 01:23:14.908 16257-16361/ioio.examples.hello V/BluetoothIOIOConnection: Attempting to connect to Bluetooth device: IOIO (71:14)
10-01 01:23:14.908 16257-16361/ioio.examples.hello W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
10-01 01:23:14.951 16257-16360/ioio.examples.hello V/BluetoothIOIOConnection: Attempting to connect to Bluetooth device: IOIO (71:02)
10-01 01:23:14.951 16257-16360/ioio.examples.hello W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
10-01 01:23:15.954 16257-16360/ioio.examples.hello V/BluetoothIOIOConnection: Attempting to connect to Bluetooth device: IOIO (71:02)
10-01 01:23:15.954 16257-16360/ioio.examples.hello W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
10-01 01:23:16.010 16257-16361/ioio.examples.hello V/BluetoothIOIOConnection: Attempting to connect to Bluetooth device: IOIO (71:14)
10-01 01:23:16.010 16257-16361/ioio.examples.hello W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
10-01 01:23:17.013 16257-16361/ioio.examples.hello V/BluetoothIOIOConnection: Attempting to connect to Bluetooth device: IOIO (71:14)
10-01 01:23:17.013 16257-16361/ioio.examples.hello W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
10-01 01:23:17.059 16257-16360/ioio.examples.hello V/BluetoothIOIOConnection: Attempting to connect to Bluetooth device: IOIO (71:02)
10-01 01:23:17.059 16257-16360/ioio.examples.hello W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
10-01 01:23:18.062 16257-16360/ioio.examples.hello V/BluetoothIOIOConnection: Attempting to connect to Bluetooth device: IOIO (71:02)
10-01 01:23:18.062 16257-16360/ioio.examples.hello W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
10-01 01:23:18.091 16257-16361/ioio.examples.hello V/BluetoothIOIOConnection: Attempting to connect to Bluetooth device: IOIO (71:14)
10-01 01:23:18.091 16257-16361/ioio.examples.hello W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback

Now I'm trying with a Odys 7 Rapid tablet

While I get this with my Galaxy Note 10.1:
10-01 01:26:22.850 32143-32169/? D/IOIOImpl: Waiting for IOIO connection
10-01 01:26:22.850 32143-32169/? V/IOIOImpl: Waiting for underlying connection
10-01 01:26:22.853 32143-32170/? D/IOIOImpl: Waiting for IOIO connection
10-01 01:26:22.853 32143-32170/? V/IOIOImpl: Waiting for underlying connection
10-01 01:26:22.852 32143-32171/? D/IOIOImpl: Waiting for IOIO connection
10-01 01:26:22.854 32143-32171/? V/IOIOImpl: Waiting for underlying connection
10-01 01:26:22.855 32143-32171/? V/DeviceConnectionBootstrap: waitForConnect()
10-01 01:26:22.855 32143-32169/? V/BluetoothIOIOConnection: Attempting to connect to Bluetooth device: IOIO (71:02)
10-01 01:26:22.856 32143-32169/? W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
10-01 01:26:22.860 32143-32170/? V/BluetoothIOIOConnection: Attempting to connect to Bluetooth device: IOIO (71:14)
10-01 01:26:22.860 32143-32170/? W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
10-01 01:26:23.780 32143-32169/ioio.examples.hello V/BluetoothIOIOConnection: Established connection to device IOIO (71:02) address: xxxx
10-01 01:26:23.784 32143-32169/ioio.examples.hello V/IOIOImpl: Waiting for handshake
10-01 01:26:23.790 32143-32188/ioio.examples.hello I/IncomingState: IOIO Connection established. Hardware ID: SPRK0020 Bootloader ID: IOIO0402 Firmware ID: IOIO0506
10-01 01:26:23.800 32143-32169/ioio.examples.hello V/IOIOImpl: Querying for required interface ID
10-01 01:26:23.807 32143-32169/ioio.examples.hello V/IOIOImpl: Required interface ID is supported
10-01 01:26:23.807 32143-32169/ioio.examples.hello I/IOIOImpl: IOIO connection established
10-01 01:26:24.924 32143-32170/ioio.examples.hello V/BluetoothIOIOConnection: Established connection to device IOIO (71:14) address: xxxx
10-01 01:26:24.925 32143-32170/ioio.examples.hello V/IOIOImpl: Waiting for handshake
10-01 01:26:24.933 32143-32197/ioio.examples.hello I/IncomingState: IOIO Connection established. Hardware ID: SPRK0020 Bootloader ID: IOIO0400 Firmware ID: IOIO0506
10-01 01:26:24.934 32143-32170/ioio.examples.hello V/IOIOImpl: Querying for required interface ID
10-01 01:26:24.945 32143-32170/ioio.examples.hello V/IOIOImpl: Required interface ID is supported
10-01 01:26:24.945 32143-32170/ioio.examples.hello I/IOIOImpl: IOIO connection established

To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+...@googlegroups.com.

Martin Jensen

unread,
30 Sept 2016, 19:37:2730/09/2016
to ioio-users
Now this is weird. I turn turn off and turn on bluetooth on the Odys tablet and restart the app and suddenly it succeeds in connecting to both and I can turn the lights on and off on both devices. Do you know what might be happening?

Martin Jensen

unread,
30 Sept 2016, 19:45:5030/09/2016
to ioio-users
The helloIOIO apk seems rather stable now. My own app, not so much.

I see that HelloIOIO implements IOIOActivity, while I'm using IOIOService. Might that be why?

I'm using 507 for both helloIOIO and my own app.

Martin Jensen

unread,
1 Oct 2016, 20:26:1701/10/2016
to ioio-users
I've got a lot of new info on this issue.

It has to do with using "openAnalogInput".
It works fine with both the service and the activity until I add "AnalogInput" to the setup function.

I do something like this:

protected void setup() throws ConnectionLostException,
InterruptedException {
AnalogInput analogInput1 = ioio_.openAnalogInput(31);
}

I'm also using this constructor instead to get the mac address:

public IOIOLooper createIOIOLooper(final String connectionType, final Object extra)

but that doesn't cause any problems.

However, this has not been a problem with my Samsung. I've used up to 10 Analog connections on each at the same time.

What do you think might be going on? I was thinking it's a timing issue in the setup function with AnalogInput, which makes trouble with the Odys and Lenovo tablet causing an early disconnect.
It only settles, when I'm just using the LED in setup().

Den søndag den 11. september 2016 kl. 04.51.33 UTC+2 skrev Ytai:
To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+...@googlegroups.com.

Ytai Ben-Tsvi

unread,
2 Oct 2016, 13:33:0902/10/2016
to ioio-...@googlegroups.com

When opening an analog input, the IOIO starts streaming samples to the Android at 1kHz. If the Bluetooth stack is flaky, this might load it enough to break it. I've definitely seen some Android devices with poor Bluetooth implementations. You might have encountered one. I would also try a different dongle in case this is a compatibility issue.


To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+unsubscribe@googlegroups.com.

Martin Jensen

unread,
2 Oct 2016, 14:31:4802/10/2016
to ioio-users
Yeah that must be it. I will look into the adapters first,however it seems the device is the problem. I've tried with a USB hub, but it said something about not having exactly two interfaces and worked only with one of the ioios.
I tried to look it up but came up empty what could that be?

Ytai Ben-Tsvi

unread,
2 Oct 2016, 15:05:1102/10/2016
to ioio-...@googlegroups.com

The IOIO doesn't support hubs


On Oct 2, 2016 11:31, "Martin Jensen" <xin...@gmail.com> wrote:
Yeah that must be it. I will look into the adapters first,however it seems the device is the problem. I've tried with a USB hub, but it said something about not having exactly two interfaces and worked only with one of the ioios.
I tried to look it up but came up empty what could that be?

Martin Jensen

unread,
2 Oct 2016, 15:22:4102/10/2016
to ioio-users
Okay thanks for the help I will be back

Martin Jensen

unread,
2 Oct 2016, 18:27:2702/10/2016
to ioio-users
Can I reprogram the IOIO to send much less frequently? Maybe a custom firmware?

I only need something like 1 Hz or so for my project.

Ytai Ben-Tsvi

unread,
2 Oct 2016, 20:44:3802/10/2016
to ioio-...@googlegroups.com

Should be easy. There are numerous threads on this forum about how to do this. The first and most significant step is to be able to build and install the stock firmware yourself. The rest is really easy.


--

Martin Jensen

unread,
3 Oct 2016, 12:07:0603/10/2016
to ioio-users
Thanks, I will look into it! Thank you very much for your guidance :-)


Den mandag den 3. oktober 2016 kl. 02.44.38 UTC+2 skrev Ytai:

Should be easy. There are numerous threads on this forum about how to do this. The first and most significant step is to be able to build and install the stock firmware yourself. The rest is really easy.

On Oct 2, 2016 3:27 PM, "Martin Jensen" <xin...@gmail.com> wrote:
Can I reprogram the IOIO to send much less frequently? Maybe a custom firmware?

I only need something like 1 Hz or so for my project.

Den søndag den 2. oktober 2016 kl. 21.22.41 UTC+2 skrev Martin Jensen:
Okay thanks for the help I will be back

--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+...@googlegroups.com.

Martin Jensen

unread,
3 Oct 2016, 16:11:4503/10/2016
to ioio-users
I've managed to build an ioioapp succesfully, now can you point me to the source which controls the frequency for analog signals on bluetooth? I would be much obliged! Now that I'm at it, I think the guides are rather out of date for the most part and certain things have changed with microchip's software and compiler. I ran into a few obstacles on the way, I must say. Should I do a quick writeup for doing this 2016 or is it abundant?


Den mandag den 5. september 2016 kl. 23.09.36 UTC+2 skrev Martin Jensen:

Martin Jensen

unread,
5 Oct 2016, 11:40:5705/10/2016
to ioio-users
I've got a new tablet Huawei Mediatab T1 with Android 4.4.1

It runs, somewhat. 

Every now and then I get this:

E/IOIOProtocol: Protocol error:
                ioio
.lib.impl.IOIOProtocol$ProtocolError: Received unexpected command: 0x9
                    at ioio
.lib.impl.IOIOProtocol$IncomingThread.run(IOIOProtocol.java:928)
D
/IOIOImpl: Physical disconnect.
V
/BluetoothIOIOConnection: Client initiated disconnect


Den mandag den 5. september 2016 kl. 23.09.36 UTC+2 skrev Martin Jensen:
I've got two IOIO's on bluetooth which works on my two Samsung tablets, Tab 2 7.0 (5.1.1) and Note 10.1 (6.0.1) but not on my Lenovo Tab 2 A7-10 (5.0)

It gives me this:
38.174 7938-8162/D/IOIOImpl: Waiting for IOIO connection
38.174 7938-8162/V/IOIOImpl: Waiting for underlying connection
38.174 7938-8162/D/BluetoothDevice: mAddress: XXXX
38.174 7938-8162/V/BluetoothIOIOConnection: Attempting to connect to Bluetooth device: IOIO (71:14)
38.174 7938-8162/W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback
38.348 7938-8162/V/BluetoothIOIOConnection: Established connection to device IOIO (71:14) address: XXXX
38.349 7938-8162/V/IOIOImpl: Waiting for handshake
38.382 7938-8261/I/IncomingState: IOIO Connection established. Hardware ID: SPRK0020 Bootloader ID: IOIO0400 Firmware ID: IOIO0506
38.382 7938-8162/V/IOIOImpl: Querying for required interface ID
38.407 7938-8162/V/IOIOImpl: Required interface ID is supported
38.407 7938-8162/I/IOIOImpl: IOIO connection established
38.609 7938-8261/I/IOIOProtocol: IOIO disconnected
38.609 7938-8261/D/IOIOImpl: Physical disconnect.
38.609 7938-8261/V/BluetoothIOIOConnection: Client initiated disconnect


Then I get this:
E/IOIOProtocol: Protocol error: 
                ioio.lib.impl.IOIOProtocol$ProtocolError: java.lang.ArrayIndexOutOfBoundsException: length=47; index=110
                    at ioio.lib.impl.IOIOProtocol$IncomingThread.run(IOIOProtocol.java:941)
                 Caused by: java.lang.ArrayIndexOutOfBoundsException: length=47; index=110
                    at ioio.lib.impl.IncomingState.handleAnalogPinStatus(IncomingState.java:288)
                    at ioio.lib.impl.IOIOProtocol$IncomingThread.run(IOIOProtocol.java:762)

Furthermore:

E/IOIOProtocol: Protocol error: 
                ioio.lib.impl.IOIOProtocol$ProtocolError: java.lang.NullPointerException
                    at ioio.lib.impl.IOIOProtocol$IncomingThread.run(IOIOProtocol.java:941)
                 Caused by: java.lang.NullPointerException
                    at ioio.lib.impl.IncomingState$DataModuleState.dataReceived(IncomingState.java:120)
                    at ioio.lib.impl.IncomingState.handleUartData(IncomingState.java:297)
                    at ioio.lib.impl.IOIOProtocol$IncomingThread.run(IOIOProtocol.java:790)
D/IOIOImpl: Physical disconnect.
V/BluetoothIOIOConnection: Client initiated disconnect


 I'm not sure I figured out how to turn the speed down on ADC, but I found Timer3 or something and set it from 1999 to 1999999 for 1 second instead, I might be wrong. 
Also I get:
ioiodude --port=COM6 --reset --force write myioioApp.ioioapp
Writing image...
Caught IOException. Exiting.

When trying to write it with IOIOdude. Maybe I'm not building right? 
I use make-all all with j8 for speed and then I use:
tools/make-ioio-bundle firmware/app_layer_v1/dist MyOutputBundle.ioioapp IOIO0030

to build it with.

Ytai Ben-Tsvi

unread,
5 Oct 2016, 12:41:1205/10/2016
to ioio-...@googlegroups.com

1. The errors you're seeing are a symptom of data corruption between the IOIO and the phone. I works suspect the dongle or the phone.
2. The timer value you're setting is limited to 16 bit, so 65535 is your max. You can slow down the timer or use a different one, but this will have other implications, since those timers are used for other things too.
3. Are you seeing the ioiodude errors with the official ioioapp files or only with yours? If the latter, try to assess their validity by unzipping them (they're really just zip archives) and examining their contents for reasonable size etc.


--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+unsubscribe@googlegroups.com.

Martin Jensen

unread,
9 Oct 2016, 15:20:2909/10/2016
to ioio-users
I think I'm gonna go with 65535 which will give about 30Hz instead. Should be much easier to handle.

I have a file of 50 kb with a 50 kb file inside called ioio0030 after using tools/make-ioio-bundle firmware/app_layer_v1/dist MyOutputBundle.ioioapp IOIO0030
Maybe that's not what I need?
Do I need a new bootloader too? Sorry for my ignorance, I don't play with the lower levels that often.
To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+...@googlegroups.com.

Ytai Ben-Tsvi

unread,
9 Oct 2016, 17:27:5309/10/2016
to ioio-...@googlegroups.com

You shouldn't need to change the bootloader. Not sure what the issue is. Does flashing the stock bundles such as the application firmware or blink work OK for you?


To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+unsubscribe@googlegroups.com.

Martin Jensen

unread,
10 Oct 2016, 14:21:4810/10/2016
to ioio-users
I managed to put the standard firmware on it just fine with ioiodude103. I'm gonna see if I can get the dump from the ioexception on ioiodude

Ytai Ben-Tsvi

unread,
10 Oct 2016, 14:30:4810/10/2016
to ioio-...@googlegroups.com
Yeah, you should be able to build ioiodude yourself from source. It's on GitHub as part of the IOIO repository.

To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+unsubscribe@googlegroups.com.

Martin Jensen

unread,
10 Oct 2016, 14:42:1910/10/2016
to ioio-users
There you go:

Writing image...
java.io.IOException                      ]
        at purejavacomm.PureJavaSerialPort$1.write(PureJavaSerialPort.java:642)
        at ioio.dude.IOIODudeMain.writeImage(IOIODudeMain.java:213)
        at ioio.dude.IOIODudeMain.writeCommand(IOIODudeMain.java:179)
        at ioio.dude.IOIODudeMain.main(IOIODudeMain.java:124)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.simontuffs.onejar.Boot.run(Boot.java:313)
        at com.simontuffs.onejar.Boot.main(Boot.java:161)
Caught IOException. Exiting.null

Martin Jensen

unread,
10 Oct 2016, 14:44:0510/10/2016
to ioio-users
Since that's not very informative, here's the file.


Den mandag den 5. september 2016 kl. 23.09.36 UTC+2 skrev Martin Jensen:
myioioApp.ioioapp

Ytai Ben-Tsvi

unread,
10 Oct 2016, 14:47:1410/10/2016
to ioio-...@googlegroups.com
After this failure, is the IOIO bootloader still responsive, i.e. if you run ioiodude versions, what do you get?

To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+unsubscribe@googlegroups.com.

Martin Jensen

unread,
10 Oct 2016, 14:52:0010/10/2016
to ioio-users
It's still responsive. With same program I can write the standard firmware right after. 
Versions output:

IOIO Bootloader detected.

Hardware version: SPRK0020
Bootloader version: IOIO0400
Platform version: IOIO0030

Ytai Ben-Tsvi

unread,
10 Oct 2016, 16:40:5210/10/2016
to ioio-...@googlegroups.com
OK. I will try to use your bundle and see if I can figure it out. Might be a few days.

To unsubscribe from this group and stop receiving emails from it, send an email to ioio-users+unsubscribe@googlegroups.com.

Martin Jensen

unread,
10 Oct 2016, 16:51:3510/10/2016
to ioio-users
Okay thank you very much :)
Reply all
Reply to author
Forward
0 new messages