Android apps via OTG cable, Dongle, and D2xx library
I would like to connect a 32 bit-OBCI with Google Nexus 5 through OBCI Dongle plugged-in an USB OTG adapter.
Can anyone please let me know some necessary steps to work ?
I am thinking of 2 steps. First is to get an Android FTDI driver to communicate my OBCI Dongle with my Nexus 5 via VCP. Second is to get an Android App to control my 32bit-OBCI board by sending ASCII character commands via wireless serial connection.
Can anyone please let me know some necessary steps to work ?
I am thinking of 2 steps. First is to get an Android FTDI driver to communicate my OBCI Dongle with my Nexus 5 via VCP. Second is to get an Android App to control my 32bit-OBCI board by sending ASCII character commands via wireless serial connection.
Comments
You've likely already found these, but this is what came up for me,
With Processing you could possibly use pieces of the OPENBCI_GUI. And if you had a tablet instead of a phone, perhaps the entire GUI could be adapted to run there with some screen layout changes.
https://www.google.com/search?q=processing+sketch+on+android
FTDI has a slew of tech notes and white papers, all linked from their Android page,
http://www.ftdichip.com/Android.htm
http://www.ftdichip.com/Support/Documents/White_Papers/WP_001_Connecting_ Peripherals_to_an_Android_ Platform.pdf
http://www.ftdichip.com/Support/Documents/TechnicalNotes/TN_132_Adding_FTDI_Devices_VCP_Driver_Support_to_Android.pdf
Another option might be to work with @jarek , the BioEra creator. He supports Android, OTG, and OpenBCI. In that case the FTDI VCP driver is already included when you load his app.
http://bioera.net/android.html
Keep us posted on your progress, sounds like a great project! What kind of app are you looking to develop?
William
Bluetooth is on almost all Android devices. The problem with OTG is that it is only available on some Android tablets and even fewer phones. When you try to use it on a tablet which doesn't support OTG, you will not get any error message, the device will just not be available like it wasn't connected at all. So it could be quite confusing sometimes.
I will work on supporting OpenBCI in BioEra on Android as soon as the Bluetooth communication is possible.
What kind of data rates are you seeing over the mobile Bluetooth links, in terms of bps or numbers of EEG channels?
The RFduino's (Nordic's nRF51822 SOC with RF Digital's Arduino environment) -- only do two types of radio link: Bluetooth Low Energy, OR Nordic's proprietary Gazelle protocol. The latter is what powers the current dongle and is capable of sufficient bandwidth for 8 or 16 channels.
BLE data rates are considerably lower, as that protocol was designed to support always-on type wearable devices with low power drain requirements. Nordic implements Bluetooth 4.0 (BLE) in what I guess is called single mode. Other implementations such as from Broadcom implement both low energy and the previous versions (1,2,3) of Bluetooth, which allow for data rates in the range of 2 to 3 Mbps.
William
I have not done any measurement of the data rates over Bluetooth on Android. So I can't tell at this moment. I only worked with biofeedback devices which BioEra supports and those have had no problems with the bandwidth as far as I could observe.
Yes, Bluetooth is slower. But with customizable data packet size (as proposed here), there should be no problem to transfer several channels which should be the most common use case. The option to have 16 channels is great, but I suspect it will probably be used a lot less often (it takes a long time to put all those electrodes!), especially on Android. If it is needed, the OTG option will be there too.
Jarek
@conor_obci is likely going to post your link on our https://twitter.com/OpenBCI feed.
So your D2XX code is in the OpenBCIService.java file? Can you explain a little how D2XX relates to just reading / writing from a virtual COM port? Perhaps Android doesnt provide VCPs so you have to use D2XX?
https://github.com/el1t/Drift/tree/master/app/src/main/java/com/elmz/drift/openbci
William
I'm curious now about your BioEra interface for various FTDI devices (including our dongle). Are you using this D2XX API to do that? That would make sense, since you now no longer need the VCP interface.
I see that this D2XX has the same Latency Timer settings as the VCP, but with D2XX it can be set programmatically. Vs. VCP which requires futzing with Windows control panels or Mac plist files. A big advantage.
Regards,
William
I will try to find some time and see if BioEra on Android works with OpenBCI dongle. I believe it will without any modification.
Conor tweeted your Android Drift app announcement on https://twitter.com/OpenBCI
Direct links to the tweets (which I thought Vanilla Forums would embed, but apparently not.)
William
My question is, does anyone have some simple code to translate an impulse into a click command or some other method of input?
I haven't had much of a chance to experiment with the board yet so I greatly appreciate the help.
I don't believe that Github link you provided reflects the current approach on Android. Using the D2XX library with the dongle seems the way to go at the moment. Bluetooth Low Energy (without dongle) support is likely a long ways off.
If you are just looking to generate some Windows keystrikes, BrainBay can do that, see the Keystrike element block, page 31 in,
http://www.shifz.org/brainbay/manuals/BrainBay-user_manual.pdf