Friday, April 18, 2014

IOIO V1 Dealing with Firmware Versions and Android, PC and Mac


Last updated 4/18/2013

IOIO programs run on Android devices, PCs or other types of computers. They communicate over USB or Bluetooth to firmware programmed into the IOIO Pic chip.   Control programs are built using an IOIOlib library that knows the communication protocol between the program machine and the IOIO board.  Both sides of this communication must agree on the protocol and payload of this communication.


Each version of the IOIO firmware comes with its own library that was built for that firmware. Host programs must be linked to an IOIO library whose major version number is less than or equal to the major version of the your device's firmware. This works because Ytai tries to make sure that firmware is backwards compatible with previous versions.

  • Programs compiled against any version 3 IOIOlib should be able to communicate with any 3.xx Firmware devices. EX: Programs built against 3.23 can talk with IOIO devices running Firmware 3.26.  I was able to run demo programs from the public V3.30 downloads with my V1 running firmware 3.23.
  • Programs compiled against firmware V4.xx or V5.xx will will probably not communicate with devices running Firmware 3.x.
This means that you may not be able to use the latest programs in the Google Play store when using with an IOIO board with older firmware. None of the example programs in the store (4/2014) would communicate with my IOIO V1 and its two year old v3.23 firmware.

Determining if App and Firmware Version are compatible

My PC and Mac testing where done over a Bluetooth link because IOIO V1 can only talk to PCs over Bluetooth.   The IOIO V1 can talk to Android devices directly over the USB or indirectly over Bluetooth.  My hacked Nook Simple Touch does not have a Bluetooth adapter so I tested using ADB on top of USB.  I had no idea what firmware I had when I recently tried to talk to my two year old IOIO board.

Using HelloIOIOConsole.jar on a Mac

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.  

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


Using HelloIOIOConsole.jar with Windows 8

I was unable to get any version of HelloIOIOConsole work with Windows 8 and my IOIO V1 running firmware 3.23.

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 allowing it to 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.

Using Applications with Android (V2.1)

None of the Google Play store example IOIO programs could communicate with my IOIO.  I think this was because those apps were bound to newer visions of the firmware than the 3.x in my V1.

I downloaded the App version 3.30 bundle, unpacked it, and side loaded it onto my Nook android tablet.  The 3.30 version apps ran fine which makes me suspect that the Google Play store versions were built recently against the latest code.

IOIO Bootloader and Firmware Upgrades

V2 boards can be updated using PCs or external programmers. I do not have a V2 board to test.

V1 boards can be updated using older Android devices or external programmers.  Not all Android devices work for this. Most folks do the upgrade using two IOIO boards, one as programmer and one as target. I was unable to update the Application with my Nook Simple Touch. It did look like I would have been able to update programmer style if I had a second board to act as programmer. 

Conclusion

 to be written