B4A Library IOIO board library

The request in this thread here introduced me to a product called IOIO that seems to have been designed by some Google engineers in the 20% of time that Google gives them to pursue their own interests,

The blog of the main mover of the project is at Microcontrollers, Electronics & Robotics: Meet IOIO - I/O for Android

The board will be available soon from here IOIO for Android - SparkFun Electronics

As the software has just been released I took a look at it and wrapped it in a couple of libraries for use with Basic4android. I obviously cannot test it as I have no board but the Basic4android library is a very thin veneer on top of the normal Android library so, typos and idiot errors aside, it should work with no problems and the software documentation should be pretty much applicable. I have copied a lot of the library help from the software documention so a B4A help viewer should give you a good grounding in how to use it.

I don't yet know if the board will be available this side of the pond - if anyone wants to ship me one for testing .... :)

EDIT :- Version 1.1 posted with INTERNET permission. See post #11 for details.

EDIT :- Version 1.2 posted with PulseInput. See post #37 for details.

EDIT :- Version 1.2 reposted with XML error fixed. See post #39 for details.

EDIT :- Version 1.3 posted with SPI and I2C support. See post #40 for details.

EDIT :- Version 1.3a posted with IOIOlib 3.2 included. See post #42 for details.

EDIT :- Version 1.4 posted. See post #47 for details.

EDIT :- IOIOlibBT 3.10 posted. See post#58 for details.

EDIT:- IOIOBT1.4 posted See post #63 for details

EDIT:- IOIOBT1.5 posted See post #77 for details.

THESE ATTACHMENTS ARE NOW OBSOLETE. SEE POST #105 FOR THE LATEST VERSIONS BY KOLBE: http://www.b4x.com/android/forum/threads/ioio-board-library.8942/page-6#post-90731
 

Attachments

  • IOIOBT1.5.zip
    102.3 KB · Views: 2,322
  • IOIO1.4.zip
    100.5 KB · Views: 1,758
Last edited by a moderator:

pinoy_ako

Member
Licensed User
Longtime User
If it doesn't just work I can do nothing more. Does it work via USB? I assume you paired the IOIO board with the device. Did it seem to connect?
:sign0148: that is sad.

thr IOIOlibBT works with usb but with error. 1 error is when i issue led.write command, the app force close. but before issuing led.write command, there is no error.

i paired the bt ioio with the device and it connect, and was able to control led on the board using sample apps provided by ytai.

hope you could do something about it sir agraham. :sign0085:
 

agraham

Expert
Licensed User
Longtime User
IOIOBT 1.4 now posed includes IOIOBT.jar as well as IOIOlibBT.jar. Use either the original IOIO and IOIOlib together for USB connections and IOIOBT and IOIOlibBT together for a IOIO that supports Bluetooth connections. The object in the IOIOBT library is called IOIOBT.

If this IOIOBT doesn't work with IOIOlibBT then there is nothing more that I can do as I have compiled the original IOIO library source, that works, against the Bluetooth capable sources provided by ytai.
 

pinoy_ako

Member
Licensed User
Longtime User
thanks for the quick update sir agraham. 'appreciate that.

but for my first try with ioiobt and ioiolibbt, still, the application hungs. :(:(:(
 

pinoy_ako

Member
Licensed User
Longtime User
i dont know how to check that logs sir agraham. :sign0089:
can you give me tip how to do that? if it is just a short instruction to do. but if too many things to do for that, i'll find away to get those logs. and get back to you as soon as i get it.

thank you sir agraham.
 

pinoy_ako

Member
Licensed User
Longtime User
thanks agraham.

this is the from the unfiltered logs after i run the app.:

"** Activity (main) Create, isFirst = true **"
"** Activity (main) Resume **"

then when i issue connect to ioio:

"Waiting for IOIO connection"
"Waiting for underlying connection"
"Creating server socket"
"Waiting for TCP connection"

after that no more related to ioio app. and the app hungs.

for filtered logs, no exceptions.
 

agraham

Expert
Licensed User
Longtime User
Try this. Select Project -> Do Not Overwrite Manifest File and add the Bluetooth permission to the manifest after the INTERNET one. If it works I'll change IOIOBT to add the permission automatically.
B4X:
 <uses-permission android:name="android.permission.BLUETOOTH" />
 

pinoy_ako

Member
Licensed User
Longtime User
thanks sir agraham.

yes sir, i remember ytai mention to add the bluetooth permission in the manifest in his bluetooth wiki. i'll try to do your instruction now.
 

pinoy_ako

Member
Licensed User
Longtime User
thanks erel.

sir agraham, i included bluetooth permission in the manifest, checked do not overwrite manifest, but still the same. app hungs up.
i also tried IOIO + IOIObtLib combination with bluetooth permission, same hung up.

after it hung up, i close the app and run the sample app provided by ytai, it connected quickly.

i also tried erel's advice, and added serial lib, but still the same.

hope you can help me with this. :sign0013:

i even thinking of sending my ioio with bluetooth module to you now just to help you make this works.

thanks thanks.
 

pinoy_ako

Member
Licensed User
Longtime User
another thing i noticed. when i changed the firmware to display the bluetooth name as "b4a" instead of "ioio", the sample app provided by ytai doesnt work anymore. it may mean the app is looking for the "ioio" bluetooth name paired to the device.

is it also true with the b4a sample provided sir agraham, that it is looking for the name "ioio" in the list of paired devices in the phone?

thanks
 
Last edited:

ytai

New Member
:sign0087:
glad to see you're keeping up with the latest and greatest.
great work Andrew!
you're all welcome to post IOIO related questions on the ioio-users list. I'll try to help as much as I can and can probably save you some pain and struggling (and time) sometimes...
keep it up!
Btw, would be happy to hear your ideas and wishes for the next features. OpenAccessory? Wifi dongle? More I/O features? Other?
 

pinoy_ako

Member
Licensed User
Longtime User
WoW! The master musketeer is here. Good to you know you are now here Ytai. Great!

People are doing great here with your IOIO, especially sir andrew. Hope you could support us here, with the updates on IOIO.

Thanks Ytai!
 

agraham

Expert
Licensed User
Longtime User
IOIOBT version 1.5 now posted. This now sets the Bluetooth permission correctly. Initialize has a "Bluetooth" parameter, set it False for USB and True for Bluetooth.

B4X:
i changed the firmware to display the bluetooth name as "b4a" instead of "ioio",
The IOIOlibBT library is hardcoded to look for the name "IOIO".
 
Top