Hi Folks
I've created a linux system level service for use with Android to listen the UEvent Socket
It's primary goal is to handle usb modeswitching and connection initiation for Huawei USB modems on the Archos G9 tablet but It can easily be repurposed to listen/handle any event fired through the UEvent Socket, ( e.g Other type of Usb Device Insertion, Battery status change events ) hence sharing It to a wider community.
It was created because Android's on-device-added init functionality has yet to be implemented, as far a I can tell. I also couldn't find any existing system service module that did the same thing. Although I would be happy to be wrong on both points.
[EDIT]Busybox has a function called mdev which is described as a mini udev - it's suitability for my specific case I have yet to determine but it maybe an alternative option for those requiring this sort of functionality[/EDIT]
The code does nothing spectacular and is mainly based on the linux UEvent example code.
I'm not as fluent in C as I would like yet so If there's any glaring errors, things I could do better etc, let me know and I'll fix it up
If anyone wants to Hack on it then you can find it an my Github https://github.com/trevd/hotplugd
Happy Hacking People
Related
I have a problem that I hope some of the code gurus here can help me with. I have an HTC PDA that was codenamed Colorado. The Colorado is actually the Dell Axim X50 series. I have a thread on Aximsite http://www.aximsite.com/boards/showthread.php?t=140071 where I am trying to add a USB host hardware interface to the PDA. I have done quite a bit of hardware reverse engineering of the X50v device (I'm a old-time hardware hacker) and have been able to bring out the PXA270 USB host port1 interface to the outside world via two unused pins on the sync connector.
I originally noticed that the X50v A02 ROM had the OHCI driver included, so I rolled back to that release on my test PDA and have been attempting to get the interface operational. In my quest, I have determined that I need the usbd.dll driver as well as any client device drivers for HID, mass storage, etc.
I've used a number of the great utilities I've found on this site (thank you very much) to grab a copy of the Axim ROM and pull it apart. I consider myself great at working on hardware but my software skills have become rusty over the years (hey - I started by building this system a 'few' years ago: http://www.sol20.org/ )
What do I need?
I would appreciate getting some guidance on how to dissassemble the ohci.dll module so I can see if in fact, it was designed for the X50 or if it was left in by accident by HTC as the later ROM updates for the X50 series had the ohci.dll module replcaed with one named peripheral.dll which was about 1/5th the size.
Also, I'm wondering if either the ohci or usbd drivers require the irq and/or the membase of the PXA270 USB host port1 interface and if so, how do I determine those.
My original idea was to use a simple 2 port hub to bring out the interface. Unfortunately, I recently discovered that a hub requires a hub client driver. Because of that, I will settle on getting a USB flash memory key to interface directly as the drivers are already available. One of the problems I have is interfacing the 3v USB host lines on the PDA to the 5v data signals that may be present on the client device. The PXA270 USB host lines are already terminated on the PCB with 15K resistors. All that is needed is a transient protection chip and/or port driver chip.
I have installed the free Microsoft WinCE dev environments which I thought contained the source for the generic ohci driver, but I can't find it anywhere so I guessing it's not included in the free dev s/w.
Although this is only my 2nd post here, I do hope to be able to contribute technical information going forward. What I'm doing on the Aximsite is quite advanced as far as hardware hacking goes and I hope to be able to simplify it so a few others can 'play'.
Thanks in advance for any help and I wish everyone here a great New Year!
Wow. Well this is a bit over my head, but does sound great.
I will try pointing you toward a couple of useful tools:
1st is IDA probably the most powerful disassembler for ARM code. The free evaluation works fine, but won't save and closes about every 30 min. Still should do the trick if you just want to look at the code.
2nd to get sample driver code, you need Platform Builder. Not sure if that is what you downloaded, but try the provided link. Evaluation version contains all the source code MS is willing to give, it just has some limitations on ROM compilation (which you should not care about).
The only problem is, it's a real b*** to install. Takes hours even if you have a goo internet connection.
Hope this helps.
Thanks for the quick reply.
Do you know if there is anyone who knows a little on how the low level device drivers actually interact with the hardware ports?
Also, I assume that with just the ohci and usbd drivers, if the port is actually activated by pulling one of the data lines high, I should get the popup box asking for the name of the device driver. correct?
how to determine I/O base offset?
In trying to reverse engineer the ohci driver for a couple for the HTC units, I need to figure out where the I/O register base starts.
Are there any memory dump utils, like dumprom, that would indicate that?
I've installed platform builder and want to try compiling the standard ohci driver, but I need to know how to determine the start of the I/O registers on a given WM2003SE platform.
Any assistance would be greatly appreciated.
thanks
After having a quick chat with cr2 about the process of linux i was surprised to see that external usb host support on the universal is still unknown (obv it uses usb host internally for phone)
basically i have a dongle which on one end has a mini-usb plug (i.e. goes in phone) and on the other end has a usb a receptacle.. i got it with a development kit for an AVR micro-controller that has onboard usb client/host... plugging in the cable switches its mode.
now from what i understand of the pxa270 dev manual
http://www.balloonboard.org/hardware/300/ds/PXA270-dev-manual.pdf
(section 20.4) is that the chip has 3 onboard host ports. the first is dedicated (which i assume is the one used for the phone) the other 2 are shared by usb client mode and must be configured to use host mode. there also is usb-otg supported on chip which may be how things are set up.
to me this suggests that physically the external usb port we have access to can be set to host mode via setting registers (or some software based setup) however i have not looked properly at the pin layout (and electronics is only a hobby) so if someone could try and decipher from this doc
http://pdf1.alldatasheet.net/datasheet-pdf/view/82521/INTEL/PXA270/datasheet.pdf
to progress we need to see whether this is the case or whether there is a physical aspect to setting host mode (if there is then seeing if it wired up)
then we need someone with a bit of low level coding skills (prob linux based coding route) to do any initialisation then on to testing.
as i said i have a dongle but i'm not willing to risk my exec (poor student y'see) until i know a few bits... i have no intention of frying my phone due to test usb device drawing to much power from phone and melting something (i am not sure how the usb spec handles it...i know pc's shut the port down if it draws too much power but a pda i'm not so sure... especially if it isn't expecting it!)
what are other peoples thoughts on all this can anyone investigate anything or verify any of my thoughts etc
i'd like to settle the mystery which ever way it turns out...usb host mode under linux would sure be shiny
it would also be interesting to see whether the 3rd port is connected up
also see section 12 of the first pdf it covers more in depth the details regarding usb
Hi, all.
Lately I've been trying to build a linux driver to an accelerometer chipset, LIS331DL, embedded to a certain motherboard. System's BIOS has not been updated as to fit current gsensors linux drivers in (communities releases and so). We are positive that the device naturally inputs/outputs info through very specific I/O ports, namely the 0x6C and 0x68 ones. The problem is that I am able to access the device data through those ports in Windows,but not in Linux. Moreover, there's no real datasheet to help us through.
Here I have some few questions:
1) Is there, by any sort, a software kit which could possibly help us into diagnosing the motherboard as to provide more info about the device (LIS331DL accelerometer chip)?
2) Provided that there's already a windows driver that's fully functional and easily gets to send/retrieve data to/from the gsensor, under linux the management of those same I/O ports would end up into same results? In short, is there any difference between Linux and Windows I/O ports access (logical and addressing shifts perhaps)?
Any help would be much appreciated. Thanx in advance.
I managed to successfully get access to the gsensor device. Hope any other won't face the problems I had to, but just in case, I will now provide feedback to my own questions:
1) Is there, by any sort, a software kit which could possibly help us
into diagnosing the motherboard as to provide more info about the
device (LIS331DL accelerometer chip)?
Yes. A very good one called ECTOOL.
It probes the EC-RAM memory, which's quite a good start on taking notice of how bits are behaving and, later on, making decisions on that!
2) Provided that there's already a windows driver that's fully
functional and easily gets to send/retrieve data to/from the gsensor,
under linux, the management of those same I/O would end into same
results? In short, is there any difference between Linux and Windows I/
O ports access (logical and addressing shifts perhaps)?
Yes, same results. No difference. The gsensor got to output the same values (three-axial coordinates) as in windows. Hurray!
Hello everyone. I have been searching for threads all day and have not found much information about being able to hook up devices into some kinda of USB interface or serial interface on Android devices. The closest thing I can find is this: http://forum.xda-developers.com/showthread.php?t=1202082
There has to be a host controller on these phones right? I would think that if there is a micro SD read reader on the phone, there would be one. Am I the only one thinking this? What is the best way to find out?
My inspiration comes from the ArduPilot project . I think this is pretty sweet but I think it could be way more powerful with a full operating system versus a limited micro controller. An additional fun link of, what most can imagine, my final goal: http://www.wimp.com/helmetcam/
I am posting this on the Evo 4G general thread due to owning it and it would be easy to disassemble, if there is something I need to look into.
I want to look finding (or creating) a robotics application for the android OS to map *connected* servo controllers (not bluetooth connected, Arduino powered, etc..) that will also allow remote users to control the phone multiple threads to control the UV or UAV. Examples: 1: Flying the RC Plane while viewing the video stream on the phone's multiple cameras (integrated or attached). 2: Executing autopilot application and monitoring it's progress through two-way communication from a controlling "base" station (PC, Server, Tablet, etc..). Maybe executing multiple RC vehicles at once.
I have a feeling that this would help many others with other types of monitoring projects (What comes to mind: Home security, Car Security, garden monitoring, etc..) This could also help the creation of other commercial products.
Any input and direction you can give would be appreciated.
I'm working to develop an application to use a rooted Nook STR as a handheld data input platform, which then sends the data to another Android device (tablet or phone; TBD) acting as a hub. From what I've been able to determine, the options for communications between the devices are:
Bluetooth
-Possibly available using a dongle, USB OTG cable, and enabling USB host mode as described here. This doesn't seem practical within the time/budget/scale of our application.
Wi-Fi
-Wi-Fi Direct would be ideal, but requires either Android 4.x or a patch/hack to enable it, which I haven't seen anyone working on (correct me if I'm wrong about this)
-Separate Wi-Fi hub to manage communications between the devices
Is there an alternative, implementable within reasonable time and cost, to facilitate device-to-device communications wirelessly and without additional separate hardware? My research hasn't turned up any solutions that aren't extremely awkward, but I'm relatively new to this, so hopefully someone has a better idea or knows of an obvious possibility that I'm missing.