My Goal: To run a small Debian server on my mobile device. Like a raspberry Pi, but no need for Xwindows, So no GUI needed. Like a mini-NAS.
I guess to make my goal, the idea would be to use a USB 3.1 hub with enough USB ports for the following:
1 Gbit Ethernet USB dongle.
1 (or more) SSDs attached by USB
As an extra bonus it would be great to display 'top' or 'vmstat' on the phone screen. The idea is also to use the battery as a UPS. So should the power fail, the 'server' would keep running.
My OS of choice is 'Debian'.
Some assumptions on my part:
I will need to build a custom ROM based on a kernel for my model of phone (or could I get away with a 'generic' kernel for all phones?)
It will need to use DHCP to get an IP on the USB ethernet adapter and start SSH as a minimum (as I won't have the screen working to be able to log in).
Is this possible? Is it 'easy'? Would I need to build a custom kernel? Do I need to do 'special' things to get USB support to work, or is that pretty 'standard'? Initially I don't care about Screen/mic/speakers/lights/vibrate and all of those.
Related
Hi!
I want to use my G1 to do some special measurements. For this purpose I've created a microcontroller board (Atmel ATmega8) that does that. Now I want to transfer the data the board collected to the Android phone.
Because of the high powerconsumption the G1 has while Bluetooth is on this isn't a real alternative for me - the measurements will last about 2 - 3 hours.
I'm not experienced concerning hardware access within Linux and Android but thought there might be a possibility to gain a kind of low level access to the USB port. I do neither need high bandwith nor real USB functionality - so might it be possible to create an own kind of bus using that interface? Do you have any other idea?
Thank you in advance!
If you use micro linux system, the ones that are like a usb port, a network jack and a vga connecter, you could script some adb commands and have it run every few seconds to upload the data, not an ideal solution. As far as I know the g1 doesn't support host mode. But if you have a micro linux computer in the middle, it could work.
Something like this
http://www.pcpro.co.uk/blogs/2008/08/27/a-real-space-oddity-arrives-at-pc-pro/
I'm sure there are other ways to do it, maybe check there how to make a serial port thread a few pages back in the dev section.
I'd like to connect to android powered tablet several peripherals (through micro usb I guess) like: couple of rs-232 ports, keyboard and even one rj12 port.. as I guess it's possible to create usb-hub-device to all this functions, and develop drivers for it.. I just never dealt with stuff like this before. What of it is possible and mb android have built-in support of some interfaces and devices..? goal is to make cheapest solid touch tablet based complete device.
For this to work, your Phone needs special USB-OTG-capable hardware. I doubt it has. If you don't know what it is and why it is definitely needed, google for USB OTG (on-the-go).
Of course, a simple USB host connector would do as well, but no phone has one (but some tablets do).
No android phone out now has USB host support, nor the drivers to run any peripherals.
thx for answrs, looks like its possible but I need to port usbhost module to device kernel.. and perpherals drivers modules too.
First, why:
I own two Coby Kyros tablets that I am using as a part-time car headrest entertainment system. Heck, they are so cheap, buying a dedicated car video just does not make sense.
Tablets work great for that purpose, great resolution (for a car), have games and music. There is only one piece that is missing, simultaneous video playback on both tablets.
Getting this working presents two challenges:
* A fast, stable, always ON connection between the tablets.
* A master/slave video playback software, either streaming or syncing
Glad to report, I've solved the first issue, that I'll describe here. Be warned this is not for the faint of hart and right now is fully manual. If you find it helpful I might work on automating the link.
Tested on Froyo. At least one device has to be rooted and support the USB Host mode.
Now, how:
The idea is simple - use the android debugging bridge to forward TCP ports between two systems over USB. If you do have USB tethering enabled on at least one device (I did not) you could use RNDIS to route all traffic, not just specific ports, over USB.
1. Pick a tablet to be the slave. It must be rooted. Get the adb client compiled for android from here, upload it to the slave /system/xbin ("adb push ...") and make executable (adb shell chmod 755...). Get ConnectBot from the market to access its console.
2. Put the slave into the USB Host mode, disable USB debugging on it. Put the master into the USB device mode and enable USB debugging.
3. Connect the master and the slave using a miniUSB-USBfemale and USBmale-miniUSB combination, a USB hub (make sure it is a high-speed one) or a miniUSBmale-miniUSBmale cord.
4. Now the tough part, typing shell commands on the tablet. You can make it a bit easier by using a USB hub and connecting a keyboard and a mouse together with the other tablet to the slave.
On the slave start ConnectBot for the localhost and type the following
Code:
less /proc/bus/usb/devices
Look for your master's devices BUS# and DEV#. Record both. Note, these numbers change when you re-plug USB.
Now, on the slave:
Code:
su
mkdir -p /dev/bus/usb/001/
ln -sf /proc/bus/usb/[BUS#]/[Dev#] /dev/bus/usb/001/001
5. Test. On the slave run 'adb devices'. It should show your master in the list.
6. Forward slave ports to the master as needed. Run 'adb forward tcp:123 tcp:234'. Now you can use localhost:123 on the slave to reach out to the master port 234 over USB.
If your kernel is RNDIS enabled you could route all network connections over the usb0 interface, essentially creating a one-to-one network. Stock Kyros unfortunately does not support RNDIS so I've not tested it.
The ADB USB speed is not bad, averaging 2.5MB/sec after protocol overhead.
I did some research on the second issue, went several routes (mplayer, VLC and UPNP) and, sadly, found nothing that currently works. If you know of any working video source/sink pair or a sync peer for android, let me know.
sicvolo said:
Tested on Froyo. At least one device has to be rooted and support the USB Host mode.
Click to expand...
Click to collapse
Is there a guide on getting USB Host Mode to work on this device or if there isn't could you write one?
I have two Galaxy S3. I went through steps 1-3, all fine. But in step 4, there is no '/proc/bus/usb/devices'; there are only '/proc/bus/input' and '/proc/bus/input/devices'.
Is there any other method to get dev# and bus#? Thanks.
Hi,
I'm trying to learn about serial communication with devices from an Android tablet via USB host mode. I have a tablet, I have the devices, I have the apps... they just won't talk. It's most likely something to do with the firmware on my odd tablet, or maybe I'm just missing something stupid.
The tablet:
SUPERPAD FLYTOUCH
10.2" >24GB< ANDROID 4.0 TABLET A10 1.5Ghz CPU | 1GB RAM
"About this Tablet" says:
Model: BC1003
Android 4.04
Baseband ver 1.5rc4
Kernel 3.0.8 [email protected] #2 Mon Aug 6 15:23:31 CST 2012
There are 2 USB-A ports on this device. One has a physical switch that goes from device to host mode, comes with a male-male cable for attaching to a PC. The other port is host only. I can connect a USB thumb drive and it mounts just fine, shows up in the file manager, no problems. Same for a USB keyboard. It powers any USB device I've plugged into it.
The problem:
It works well enough for most things. But, I've now run into two applications that won't use the host USB port on the thing. Both seem to want to do basic serial communication. At this point, those 2 apps are about the only things I actually want to do with it, so I'm willing to experiment.
I have a USB oscilloscope that comes with an Android app. The app installs and runs fine, but it won't recognize the hardware usb device I've plugged in. Annoying, but I don't really need it. I've recently purchased some digital scales(DROs) for my lathe/mill. There's an Android app that interfaces these scales to an Arduino device via USB. Installs fine, won't connect to the Arduino. Okay, now this is starting to get annoying. Also, for what it's worth, the Android app for doing general Arduino stuff didn't work either.
So, the USB hardware works enough to connect a USB thumb drive or keyboard but the firmware won't use said hardware to do what I want.
The questions:
Am I doing something wrong? Is there an app I can install that enables serial communication over USB host mode? Am I missing something stupid?
Is there any other firmware I can run that will allow this communication? I think I've got the Windows utility that will allow me to flash the rom. I've watched the youtube vids on dis-assembly so I can pull the internal tf/sdcard and make a full dd backup. I'm assuming it contains the roms and everything else. Actually, I'm thinking about just pulling said card and replacing it with a smaller one for experimenting. Will I still be able to flash it using the windows LiveSuite utility even with a blank card inserted?
At this point, I'm willing to play. I mean, it's still useful enough to be careful, but I'm willing to take some chances and put a little work into it. If I can get it running with the DRO software while talking over USB to the Arduino, I'd sacrifice everything else. GPS, battery life, wifi, screen rotation, sound, whatever. I'd just bolt the thing next to the mill and that's that. Failing that, I'll put it back to stock and stick it on the fridge for my wife to look up recipes, Yeah, poor tablet... motor oil and metal swarf or cooking oil and flour. No happy retirement for this tablet, sitting in a drawer gathering dust.
Any hints, links, recommendations, or directions appreciated.
David...
Hi!
I'm trying to establish a connection between an Android Virtual Device and a car. The goal is to run the AVD on a Linux laptop and connect it to the car via USB. Ideally the AVD would recognize the car's HU (and also the other way around) which should make it possible to use Android Auto.
I read a lot about the Android Open Accessory Protocol and how the connection is established. I also found posts about people tunneling USB connections from a Linux host to an Emulator using the command below:
emulator @AVDname -qemu -usb -device usb-ehci.id=ehci -device usb-host,vendorid=0x----,productid=0x----
Some also say you need to build a custom kernel beforehand so that USB on the Emulator is enabled in the first place. So far the Linux machine doesn't recognize the HU at all, which makes it impossible to use the USB tunnel since I don't know the vendor and device id.
The HU probably acts as host and expects a device, so does the Linux machine. This is somehow where my progress stopped.
Does someone know if that kind of connection is even possible with a emulated device? Do AVD's support the Accessory Mode in the first place? Is there a way around this Host to Host problem?
Any hints or ideas would mean a lot to me!