Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 10 of 10

Thread: Teensy 3.2: Has anyone got it to interface with android in any mode?

  1. #1
    Junior Member
    Join Date
    Jun 2017
    Posts
    4

    Teensy 3.2: Has anyone got it to interface with android in any mode?

    I've tried (in Android 4.1, 5.1 and 4.4 in a VM):

    Keyboard: Shows up as a input device, but the keys do not work.
    Joystick: Show up as a input device, but no buttons work.
    RawHID: Works for a few presses with an interpreter app i wrote to listen to the HID packets, but just stalls after that. See my stack overflow post for more details (https://stackoverflow.com/questions/...r-a-few-inputs).

    All modes work perfectly fine in Windows and Linux.

    Is there any working examples out there for android? Any ideas?

  2. #2
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,679
    If I remember correctly, there were successful attempts to use the serial mode, with a terminal software.
    Maybe the VM is the problem ?

  3. #3
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,080
    adb console can be used, i use teensy uart6 to access adb root console on pioneer NEX (yeah they run android)
    Last edited by tonton81; 09-24-2017 at 06:46 PM.

  4. #4
    Junior Member
    Join Date
    Jun 2017
    Posts
    4
    Quote Originally Posted by Frank B View Post
    If I remember correctly, there were successful attempts to use the serial mode, with a terminal software.
    Maybe the VM is the problem ?
    Do you have a link to the serial examples? i tried to use a generic serial listener from the app store, but i couldn't get it to work. i only used one VM (Android 4.4), the others were a Nexus 7 (Android 5) and the actual car head unit (Android 4.1)

    Quote Originally Posted by tonton81 View Post
    adb console can be used, i use teensy uart6 to access adb root console on pioneer NEX
    You're going to need to unpack that a little for me, i'm not sure what you mean

  5. #5

  6. #6
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,080
    radios like the pioneer NEX have a uart cable/solder points on the mainboard for RX,TX, and ground (chasis)

    i was even able to get into the BT comms for caller id and pull dumpsys for current radio station/song/artist to display on my gauges

    they mostly run at 115,200baud, if you have a GPS enabled radio 6000+ series nex, you can also tap into its gps at 9600 baud for mcu integration. you'd need to get ahold of your radios service manual to check out where the signals are.

    the NEX runs 4.2.2

  7. #7
    Junior Member
    Join Date
    Jun 2017
    Posts
    4
    Yes, i did do a thorough search on the problem. Using a serial terminal is fine and all, but i really need to be able to programatically interact with the Teensy. Or ideally just get the keyboard mode working, as was originally intended.

    Quote Originally Posted by tonton81 View Post
    radios like the pioneer NEX have a uart cable/solder points on the mainboard for RX,TX, and ground (chasis)

    i was even able to get into the BT comms for caller id and pull dumpsys for current radio station/song/artist to display on my gauges

    they mostly run at 115,200baud, if you have a GPS enabled radio 6000+ series nex, you can also tap into its gps at 9600 baud for mcu integration. you'd need to get ahold of your radios service manual to check out where the signals are.

    the NEX runs 4.2.2
    Interesting! I'm using a cheap chinese head unit, but i don't feel confident enough to open it up and start tapping buses. How did you interface on the software side?

  8. #8
    Junior Member
    Join Date
    Jun 2017
    Posts
    4
    Just to close out this thread for anyone searching for the same problem: I resolved by switching to a microcontroller with native USB (Arduino pro micro, but anything ATmega32U4 based should work the same) and using the Project-HID library (https://github.com/NicoHood/HID) as a consumer device. This works fine on any device/OS I've tried.

  9. #9
    Junior Member
    Join Date
    Feb 2018
    Posts
    1
    Quote Originally Posted by Kaboom22 View Post
    I've tried (in Android 4.1, 5.1 and 4.4 in a VM):

    Keyboard: Shows up as a input device, but the keys do not work.
    Joystick: Show up as a input device, but no buttons work.
    RawHID: Works for a few presses with an interpreter app i wrote to listen to the HID packets, but app just stalls after that. See my stack overflow post for more details (https://stackoverflow.com/questions/...r-a-few-inputs).

    All modes work perfectly fine in Windows and Linux.

    Is there any working examples out there for android? Any ideas?
    @Kaboom22 by using Arduino Pro Micro and Project-HID library and got it running just fine Thank you so much for the solution bro.

  10. #10
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,080
    Kaboom, regarding the headunit (or any other type of device with ADB over uart method, reading/writing data is done over regular serial baud rate of 115200. ADB gives you more control on how to run/change things on the running system, with only RX,TX,GND hookup, you can send commands as you wish like Serial1.println(“dumpsys”); and android will dump it’s contents in your buffer that you can read with if ( Serial1.available() > 0 ) Serial.print((char)Serial1.read());

    this gave me for example, to set the date & time on the radio and teensy would automatically sync to it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •