Anybody connected to Teensy 3.1 over USB from an Android Phone (Nexus 5)?

Status
Not open for further replies.

dhylands

Well-known member
I have a Nexus 5.

I'd like to be able to plug in my N5 to my Teensy 3.1 and see the serial output on the phone.

I already have the requisite OTG to USB adapter cable, and I've been able to connect to an FTDI USB Adapter using one of the terminal programs, but so far no luck using the teensy.

So I though I would ask first (in case there is a simple solution) before spending a bunch of time tryng to debug this.
 
Not teensy, but we did a project where Arduino phones (Samsung S3 or S4) were able to do serial port emulation out the USB to a little PCB we did with an FTDI chip and an Xbee radio.
The magic was the somewhat recent availability of a way to do this in Android without rooting the OS.
 
Although android does, not all phones support host mode. But since you were able to connect to an FTDI adapter, yours seems to support host mode.

So let's see the code you used - are you using teensyduino? If all fails, connect Teensy UART (Serial1...Serial3)->FDTI->Phone.
 
Well, the USB OnTheGo functionality is not yet implemented in Teensyduino, although the USB OTG module inside the Freescale K20 microcontroller on the Teensy 3.0/3.1 DOES support the OnTheGo specification. I don't know about Paul, but I was already planning to add OTG functionality to the Teensyduino library in the future, when I'll finish the work on my USB Audio library.

In the meanwhile, you could get your hands dirty and add it yourself! You can find all the USB-specific functions in the directory "\hardware\teensy\cores\teensy3" inside your Arduino IDE folder, in the files usb_desc, usb_dev, usb_mem. You can find all the informations on the OTG module inside the K20 datasheet; finally, you can find informations on the OTG specifications on the USB.org page (look here: http://www.usb.org/developers/onthego/), and you might want to read the USB 2.0 specs also.

I hope that this stuff will be helpful to you :)
 
Although android does, not all phones support host mode. But since you were able to connect to an FTDI adapter, yours seems to support host mode.

So let's see the code you used - are you using teensyduino? If all fails, connect Teensy UART (Serial1...Serial3)->FDTI->Phone.
This project uses Samsung (et al) phones with the version of Android that permits that open and non-rooted OS support for USB host for serial. The USB goes to an FTDI which connects to an XBee; no Teensy or other microprocessor used.
The Android code is in Java; if you would like, I can ask if I can distribute with caveats some Java code snippets that are relevant. It's part of a very large app for the phone. Essentially, it bridges 802.15.4 wireless traffic, via cellular, to a distant host data system, via TCP. And runs an HTTPS session with that host, concurrently.

I know that this host mode was added at some version of Android in the last year. Of course, phones that have an older version of Android wouldn't have host mode. I didn't know that some cellular carriers are removing / disabling that. Is that true? We've used AT&T and Verizon with this.
 
Last edited:
Status
Not open for further replies.
Back
Top