Sector67 / nsa-away

NSA Away Android application repository for the Hackaday prize
hackaday.io/project/1569-NSA-Away
GNU General Public License v3.0
7 stars 0 forks source link

Implement simple USB sending capability #29

Closed sphasse closed 10 years ago

sphasse commented 10 years ago

As a lead-in step to the keystroke sending function

erinzm commented 10 years ago

@sphasse Any specific libs/ strategies for doing this that you've found?

sphasse commented 10 years ago

My initial thought for a prototype was to communicate from the Android device to an Arduino using the Android as a USB host and a USB OTG (on the go) cable. I got two of these cables and bread-boarded an Arduino up before frustratingly realizing that my Android device (a Samsung Galaxy Tab 4 7") does not support USB OTG. There is already a compatibly-licensed implementation of a pure Java driver for communicating from Android to Arduino via USB OTG:

https://github.com/mik3y/usb-serial-for-android

Once basic Arduino communication was working, I have a separate USB UART that I would use for communication to the Anrdroid device, and then my plan was to configure the main Ardunio's USB to perform the HID functionality (https://github.com/ddiakopoulos/hiduino), with the separate USB adapter wired to I/O pins (e.g. http://arduino.cc/en/Main/MiniUSB) and communicating via software serial (http://arduino.cc/en/Reference/SoftwareSerial) to the Android device.

That is an awful lot of moving parts for a prototype and the design would not necessarily implement the one-way send only guarantee (although something could be done to ensure one-way communication from the separate UART to the Arduino, perhaps as simple as no TX connection as a first cut). But, that was my original plan. I'm certainly interested in feedback and potential alternative approaches.

Scott

erinzm commented 10 years ago

Couldn't the Android phone just act as the HID? On Aug 31, 2014 12:20 PM, "sphasse" notifications@github.com wrote:

My initial thought for a prototype was to communicate from the Android device to an Arduino using the Android as a USB host and a USB OTG (on the go) cable. I got two of these cables and bread-boarded an Arduino up before frustratingly realizing that my Android device (a Samsung Galaxy Tab 4 7") does not support USB OTG. There is already a compatibly-licensed implementation of a pure Java driver for communicating from Android to Arduino via USB OTG:

https://github.com/mik3y/usb-serial-for-android

Once basic Arduino communication was working, I have a separate USB UART that I would use for communication to the Anrdroid device, and then my plan was to configure the main Ardunio's USB to perform the HID functionality ( https://github.com/ddiakopoulos/hiduino), with the separate USB adapter wired to I/O pins (e.g. http://arduino.cc/en/Main/MiniUSB) and communicating via software serial ( http://arduino.cc/en/Reference/SoftwareSerial) to the Android device.

That is an awful lot of moving parts for a prototype and the design would not necessarily implement the one-way send only guarantee (although something could be done to ensure one-way communication from the separate UART to the Arduino, perhaps as simple as no TX connection as a first cut). But, that was my original plan. I'm certainly interested in feedback and potential alternative approaches.

Scott

— Reply to this email directly or view it on GitHub https://github.com/Sector67/nsa-away/issues/29#issuecomment-53994661.

sphasse commented 10 years ago

That would also work, but currently requires a custom kernel (http://stackoverflow.com/questions/4886833/android-usb-hid-device) or . Probably not a bad tradeoff for a prototype, but hard to share.

erinzm commented 10 years ago

I think V-USB has better HID support, HIDuino was designed for USB midi controllers. On Sep 1, 2014 10:39 AM, "L. Mars" shakespeares.integral@gmail.com wrote:

We could get away with using an ATtiny with hiduino, and make everything smaller that way. We could just chop a microUSB cable in half and solder a tiny SMD board in the middle. I'll design something this week.


Liam On Aug 31, 2014 12:20 PM, "sphasse" notifications@github.com wrote:

My initial thought for a prototype was to communicate from the Android device to an Arduino using the Android as a USB host and a USB OTG (on the go) cable. I got two of these cables and bread-boarded an Arduino up before frustratingly realizing that my Android device (a Samsung Galaxy Tab 4 7") does not support USB OTG. There is already a compatibly-licensed implementation of a pure Java driver for communicating from Android to Arduino via USB OTG:

https://github.com/mik3y/usb-serial-for-android

Once basic Arduino communication was working, I have a separate USB UART that I would use for communication to the Anrdroid device, and then my plan was to configure the main Ardunio's USB to perform the HID functionality ( https://github.com/ddiakopoulos/hiduino), with the separate USB adapter wired to I/O pins (e.g. http://arduino.cc/en/Main/MiniUSB) and communicating via software serial ( http://arduino.cc/en/Reference/SoftwareSerial) to the Android device.

That is an awful lot of moving parts for a prototype and the design would not necessarily implement the one-way send only guarantee (although something could be done to ensure one-way communication from the separate UART to the Arduino, perhaps as simple as no TX connection as a first cut). But, that was my original plan. I'm certainly interested in feedback and potential alternative approaches.

Scott

— Reply to this email directly or view it on GitHub https://github.com/Sector67/nsa-away/issues/29#issuecomment-53994661.

erinzm commented 10 years ago

@sphasse My first thought was this:

Phone ==> ATmega32U4 { LUFA CDC USB --> V-USB HID keyboard emulator } ==> Computer
That would be pretty simple to do at the code jam if anyone has a Leonardo or other ATmega32U4 based arduino.

erinzm commented 10 years ago

Or just a FTDI chip will work...

erinzm commented 10 years ago

I did this, but we're using something else. Closed

erinzm commented 10 years ago

We're now using USB HID again, so I'm reopening this.

erinzm commented 10 years ago

@nmeronek I'm assigning you, if you don't mind?

erinzm commented 10 years ago

Finished by @nmeronek. Not commited yet.