Tuesday, April 29, 2014

IOIO Bluetooth and Windows 8 / 8.1

Notes on using the IOIO with Windows 8 over Bluetooth

This post describes the results of controlling various versions of the IOIO Firmware from Windows 8 over Bluetooth.  Initial content was extracted from http://joe.blog.freemansoft.com/2014/04/ioio-v1-dealing-with-firmware-versions.html and expanded with additional content.

I used the HelloIOIOConsole.jar  sample program to test connectivity between Windows 8 and an IOIO V1 running different Application firmware.  I also tested Mac OS/X Mavericks.


HelloIOIOConsole.jar results 4/2014
Java Application V1 3.03/3.23 V1 3.26/4.0 V1 ?.00/5.00
Windows 8.1
3.30
No Communication
Constant reconnects
Works Not Tested
Windows 8.1
4.00
No Communication
Constant reconnects
Fails handshake without patch

Works with patch described below

Not Tested
Windows 8.1
5.03
No Communication
Constant reconnects
Fails with Version Mismatch
(as expected)
Not Tested
OS/X Mavericks
3.30
Works Works Not Tested
OS/X Mavericks
4.00
- Works Not Tested
OS/X Mavericks
5.03
- Fails with Version Mismatch
(as expected)
Not Tested

Using HelloIOIOConsole.jar on a Mac running Mavericks

My Macbook had no trouble pairing with the IOIO V1 with Bluetooth adapter. 4545 is the pairing code. The Bluetooth connection will go idle after some time and change from "Connected" to "Not Connected".  The IOIO serial device  ports on the Mac continue to exist even if the connection has gone to sleep. Bluetooth is re-connected when a program accesses the outbound serial device tied to the IOIO.  The Mac just worked.

Determining my Application Firmware Version using a Mac

I first tried HelloIOIOConsole, version 5, the latest, application java -jar HelloIOIOConsole.jar. That failed with the following output on my device.  Eureka!  It looks like I actually have Bootloader 303 and Firmware 323


App-IOIO0500.zip HelloIOIOConsole.jar[I/IncomingState] IOIO Connection established. Hardware ID: SPRK0016 Bootloader ID: IOIO0303 Firmware ID: IOIO0323[V/IOIOImpl] Querying for required interface ID[E/IOIOImpl] Required interface ID is not supported[E/IOIOBaseApplicationHelper] Incompatible IOIO firmwareioio.lib.api.exception.IncompatibilityException: IOIO firmware does not support required firmware: IOIO0005


Then I tried HelloIOIOConsole application version 4 java -jar HelloIOIOConsole.jar. Still no love with this combination.
App-IOIO0400.zip HelloIOIOConsole.jar[I/IncomingState] IOIO Connection established. Hardware ID: SPRK0016 Bootloader ID: IOIO0303 Firmware ID: IOIO0323[V/IOIOImpl] Querying for required interface ID[E/IOIOImpl] Required interface ID is not supported[E/IOIOBaseApplicationHelper] Incompatible IOIO firmwareioio.lib.api.exception.IncompatibilityException: IOIO firmware does not support required firmware: IOIO0004


Finally, I ran HelloIOIOConsole application version  java -jar HelloIOIOConsole.jar. The program ran fine and was able to manipulate the Bluetooth attached device..
App-IOIO0330.zip HelloIOIOConsole.jar[I/IncomingState] IOIO Connection established. Hardware ID: SPRK0016 Bootloader ID: IOIO0303 Firmware ID: IOIO0323[V/IOIOImpl] Querying for required interface ID[V/IOIOImpl] Required interface ID is supported[I/IOIOImpl] IOIO connection established
This means I am running version 3.x (!)


Using HelloIOIOConsole with Windows 8 with Firmware 3.03/3.23

I was unable to run any version of HelloIOIOConsole on Windows 8 with my IOIO V1 running firmware 3.23. None of them ever got far enough to verify a version match between the app and the firmware.

The PC and IOIO pair over Bluetooth without any issues.  Virtual COM ports are created.

The IOIO bluetooth connection status never changes from "Not Connected" to "Connected" even after letting HelloIOIO run for a while. Windows 8 told me that there was a driver failure every time a COM port was (re)opened.

I tried several versions of HellloIOIOConsole. The image at right shows up every time the console app runs and connects to a serial port. This message pops up several times.  Tapping on it takes you to the Bluetooth management screen which then tells you:
Adding your device didn't work. First remove it from your PC, and then try again.
The windows event log shows the following.
The mutual authentication between the local Bluetooth adapter and a device with Bluetooth adapter address (00:15:83:44:b9:e7) failed.
It feels like some kind of driver / protocol problem I don't understand.  This is fixed with later versions of the Application Firmware


Using HelloIOIOConsole with Windows 8 with Firmware 3.11/4.00

The PC and IOIO pair over Bluetooth without any issues. Here is the success matrix for HelloIOIOConsole.jar:

  1. PC Application version 3.23 works great. It logs the IOIO hardware and firmware versions and accepts commands.
  2. PC Application version 4.00 hangs "waiting for handshake".
  3. PC Application version 5.03 connects and logs the IOIO hardware and firmware version and and correctly terminates because the app uses a later IOIOlib than allowed for the 4.00 firmware

Fixing PC IOIOLib 4.00 to work with Windows 8


SerialPortIOIOConnection.java in IOIOLibPC requres that three lines of code be commented out.  You can find the source file at:
App-IOIO0400\IOIOLib\target\pc\src\ioio\lib\pc\SerialPortIOIOConnection.java
 Comment out lines 73-75

...
...

to look like

...
...

Conclusion

OS/X and Linux are more forgiving when working with Bluetooth and IOIO

No comments:

Post a Comment