Power source detection - G1 Android Development

I'm not sure, but would it be possible for the G1/Android to detect what power source it's plugged into? From what I understand, a lot of wall-warts speak somewhat to the device. If minute differences could be found, they could be "labeled". Applications for this would be power based setting changes. For example, plugged into my computer-> screen on, bedside charger-> backlight off/ringer silent, Car charger-> GPS, bluetooth on, blah blah, etc. Anyone have any thoughts about this?

Sounds like a neat locale plug in if this is possible.
I know devices can tell the difference between a USB plug and an electrical outlet
Not sure about the car charger though.

doesnt the app power manager do the job?? idk about the car charger one tho

Z
The reason I think this may be possible is that I had a RAZR a few phones ago, and it would only work with Motorola power supplies, but my BB pearl I got after it would work with it as well. And if I recall, iPhones require some kind of handshake to work with a usb plug. Just an idea and was wondering about it's plausibility.

kingcliff00 said:
doesnt the app power manager do the job?? idk about the car charger one tho
Click to expand...
Click to collapse
I looked at power manager, and it does change settings depending on whether it is plugged in or not. The real point of my inquiry is not whether setting can be changed, but can power sources be ID'd. Setting change is just an application of the information. You could also have it launch an app too if plugged in, IE a navigation or music app starts when plugged into car charger.

Detecting the difference between the USB cable and wall/car charger should be simple enough - only one of those has a computer on the other end, and the phone already detects that. It even shows up in the spare parts app on CyanogenMod as "charging (AC)" and "charging (USB)".
Not sure if there is a way to differentiate between car and wall charger. (Though you could always hack something together using the GPS and define the car charger as "any non-USB charger outside a set location". If you're not travelling much, that is.)

If you use "Spare Parts" and bring up the battery info screen, it will indicate (AC) or (USB) when the phone is charging...
Using the AC charger makes a big difference on these phones. I run Wifi Tether on 3G all day long at work. Using the USB charger, the phone will die. Using AC, it will stay on 100 charge even if I'm streaming music all day...
I think the max output on a USB cable is 0.5 amps. The HTC charger is labeled as max output 1 amp. I'm no electrician, but the AC cable could in fact be twice as good as USB charging.

Related

Touch Pro and tethering woes(battery)

i recently recieved the touch pro as upgrade from my mogul. to be clear the only internet options i have are dial up or tethering and i prefer the ladder. however im finding i cant stay tethered long without running out of battery. where with the mogul i could tether for 12 hrs straight i cant stay on more than 3hrs. i know its power consumption to charhe and it all runs through the battery. my question is would the cradle with seperate charger and usb plugs do anything? would wifi router software work better than tethering? can i bypass the battery and draw power from the cable itself? any help or tips/suggestions from people with similar situations would be great as i have seached here and ppcgeeks with no luck(thus far,im still looking)
60 views and no ideas? Ouch
when you tether your phone, are you using usb cable to connect the phone to your computer? if so, why not set it to charge the phone while it's connected by usb cable? that way u'll just keep drawing power out of the computer and won't have to worry about phone battery draining quickly
it is set that way. the problem is, with the radio running to stay on the internet and with it sending data through the cable, it seems the load on the phone is too great for the charger to keep up sot aht the battery doesnt die down. And since it seems (correct me if i'm wrong) that the way power flow works is all through the battery (charger -> battery -> device) there is no way that i am aware of to keep a charge on it greater than the power consumption. This is why i was asking of docks such as the expansys one http://www.expansys-usa.com/d.aspx?i=169488 where it has seperate data and power plugs on the bottom would work.
Couple of things to clarify
1. That expansys cradle does have two ports on the bottom, but only one is USB/Power the other is a line out for audio, so that will not help you at all, accept to hold your phone up when you're using it.
2. A wifi router option will consume more power than tethering alone, and in my experience tethering, it does infact keep my battery charged. Are you sure that your usb cable is charging your phone? Do you have the option disabled that allows it to charge whilst connected to a computer?
Thx!
Kewlj1313
r u at home when you are tethering and do you have Bluetooth on your laptop
the option is checked, as i have double checked since you all have suggested this. yes i have bluetooth on my desktop but i would prefer to stay away fromt that option as its slower than usb tethering. the only thing i think may be effecting me that i just htought of was that i have had the usb cable plugged in the front side not on the direct Mobo connection. i will try this tonight and report back any success
I have the same problem, I've tried using the cable that it came with, the cable that came with my htc-6700, and my girlfriends Blackberry cable. It will usually begin to charge while tethered(PDANet) but quickly will revert to the battery. I'm using my girlfriends laptop as mine has a fried harddrive, her power cable jack is loose as if someone pulled the cord hard to the side, this causes it to switch from external power to battery very quckly sometimes. I thought that this caused the problem I had so I didn't bring it up before. I have my phone set to charge when USB is connected and I do not use any USB hubs. I've tried tethering over Wifi but I don't seem to get as high quality of a connection.(Bittorrent speeds extremely slow, although a speed test showed 2134kbps downspeed) I hope this can provide more information to figureout what is causing it.
Try this! Make sure it isn't causing your phone to get to warm and causing this issue, I had a similar problem with wifi and gps usage hmhm,
Open your keyboard whilst it is tethered and see if that makes any difference, and I'm not sure if it is possible to turn the screen off on the phone while tethered, but if you can do it!
Let us know what happens!
Kewlj1313
hmm...i wonder what's causing the power consumption to revert to battery source instead of usb cable. have you tried the dongle that came with the device? It supposedly allows you to charge while saving another usb port for headset...etc. Maybe it's possible to charge via wall charger and tether through usb cable at the same time?
or like previously mentioned, charge via usb cable when it's connected to the computer, but tether using bluetooth. I suspect the data tethering through usb is causing the "charge" to drop.
here is what i have found. First the power source must be sufficent ie 1 amp or 1000 ma use an ipod usb charger for moble htc one for home. Second the dongle will only let you charge on the mini port not the e-mini on the side. Problems iam working on is reducing battery drain by shunting off screen but it doesnt work with usb dun. it does work with wmwifirouter but i think there is a heat issue because it stops charging after awhile. Best sessions i have are usb with battery all way charged bthen watch it with battery window open same time.
criddlem,
THanks for doing the footwork on this one.
Shouldn't the bluetooth 2.0 network connection be capable of up to 3Mbit data rates in one direction? I wonder out loud if anyone on this forum has tested connectivity over BT? I don't know how this is handled in the hardware and it could be that the BT only gets a fraction of that in the real world. Of course, the laptop would have to be BT2.0+EDR as well to get that kind of rate in the first place.
Of course, running yet another device at full pace may just drain the battery that much faster!
Have you tested data rates over both BT and USB?
Thanks!
I tether quite frequently using a USB cable as well and I have found my phone always maintains a charging state. It does seem odd that yours isn't. I do know that I am not using the cable that came with the phone............
baboola said:
hmm...i wonder what's causing the power consumption to revert to battery source instead of usb cable. have you tried the dongle that came with the device? It supposedly allows you to charge while saving another usb port for headset...etc. Maybe it's possible to charge via wall charger and tether through usb cable at the same time?
or like previously mentioned, charge via usb cable when it's connected to the computer, but tether using bluetooth. I suspect the data tethering through usb is causing the "charge" to drop.
Click to expand...
Click to collapse
I was going to suggest something similar.
A couple of years ago I had a sub-notebook that, for lack of a better term, had "sucky" usb ports. When I measured the current supplied was ~100mA. Enough to trickle charge my old TyTN, so it's amber charge light lit up, and I thought all was good.. till it gave me the ugly "Place on charge to prevent data loss message."
Do you have anything there to measure with?
Eirikr88 said:
the option is checked, as i have double checked since you all have suggested this...
Click to expand...
Click to collapse
On my Fuze if the option is checked it means Do Not charge while
connected to a pc...
re
Hi, sorry I may have misunderstood what you are trying to do, but I bought this cradle on ebay http://cgi.ebay.co.uk/HTC-Touch-Pro...photoQQcmdZViewItemQQ_trksidZp1742.m153.l1262
It has a seperate power in line for charging (including a 3 pin UK plug) and a USB sync line in the back of the device.
I belive this device charges from the mains while being connected via USB to the PC. Of course it could be charging through the USB but for me it charges quickly and is connected to PC at the same time so does what I need.
The swivel to use in landscape is an awesome feature too. Battery for me does run down pretty quick, away from cradle, but then I have been used to previous poor battery performance WM devices.
Cheers, Blair
well Erikr88, u said that u have the option check (to allow a charge while connected to your pc) and that u double checked to make sure. well go back and uncheck it as their is no option to check a box and charge while connected to ur pc. the option u can check is to NOT allow a charge, so uncheck it and c if that corrects the problem.

[Q] USB fast charging for Nexus?

Hello everyone, I just have a question in regards to USB fast charging for the Galaxy Nexus.
I'm about to install a JVC head unit in my car (model KD-R810) and it proclaims to have 500ma available for charging Apple devices. My fear from my research is this will not be enough power to charge my Nexus while using GPS, so I am looking into other methods.
What I am thinking to do is use a Sirius car charger that is no longer needed (that puts out 5v 2a charging capability) and use this to keep the phone charged.
Now my question is, if I have the data portion of the USB cable connected to the above mentioned car stereo head unit and the power portion of the USB cable connected to the Sirius charger, can anyone suggest any reason why this is not a good idea?
Also, will I need to trick my nexus into charging "AC" rather than "USB" even while connected to a USB charger that can supply 2a?
I've read articles about having to short the data lines on a USB to get it to charge in AC..?
I am wondering if doing something like this is needed? I currently have a rocketfish charger rated at 600ma that charges the nexus in "AC" mode, however I'm wondering if having 2a available using the Sirius charger will charge the phone that much faster, or if this is dangerous for some reason? I did read somewhere that the nexus will only draw as much power as needed and should be safe with higher rated chargers, however I wish to confirm before risking frying anything.
So my question is, if I wanted to use my Nexus with GPS and with my above mentioned JVC stereo as a storage place for music, would I benefit from using a hacked cable on a switch for example to be able to switch between GPS charging mode and "Data" mode for use with the head unit?
Perhaps a switch for the data portion of the USB to switch between going to the headunit and being shorted for fast charging?
Any guidance would be appreciated!
There is a kernel patch know as Fast-charging. It's implemented in Matr1x and air kernel i believe. This should do the trick.
Sorry i didn't see this before, don't know how i missed it. Here is the rundown:
-Data mode uses 500mA
-AC mode exceeds this, stock charger rated at 750mA
-Excess amperage should be limited by the Nexus S with no problem
-FastCharge forces AC mode, so the phone will attempt to draw the max current it can handle. NO DATA TRANSFER is available in this mode, so can't use it as a USB for your deck
Essentially, i would be using a kernel with FastCharge with the 2A charger and get the Nexus S to decode and output music through a 3.5mm jack to the AUX input on the deck. I hear it can get quite hot while charging and using GPS, so make sure to check it's heat every so often just in case. Decoding music will put practically no extra strain in comparison to everything else it'll be doing, it won't slow the charging by any noticable amount.
Heat can be a problem when using GPS and charging at a high current, my NS gets hot doing these two things at same time!
Try putting the device near a cold air flow inside the car.

[Q] Can't charge off PC USB?

My Photon Q won't charge off a PC USB port, or my laptop. Is this common? Thanks.
Are you using the usb cable that came with the phone? Reason I ask....I've discovered this phone is extremely picky about the cables you use. So far of the ones I have on hand, I can only consistently charge while in the car using my Belkin usb charging adapter with the Motorola cable that came with the phone. That includes a fairly nice ferrite core 6ft usb cable I got from Monoprice...which it works fine at home on AC, but in the car it stutters back and forth between charging and not charging.
Just today I used a cheap USB cable I bought off of ebay to charge my PQ using my laptop.
Its one of the ones sold as "HTC OEM USB Charger + cable" on ebay for like 3 bucks.
I also charge it at home using a green 3m cable from ebay, also bought for like 3 bucks lol.
Does it require that drivers be installed on the PC to get a charge? I've tried a few cables that I have laying around. I'll see if I can find other cables to try. The weird thing is if the phone is off, and plugged in, the LED lights up green, as if it's charging. But using the same cable, if the phone is on, it won't acknowledge that it is plugged in.
tcrimsonk said:
Does it require that drivers be installed on the PC to get a charge? I've tried a few cables that I have laying around. I'll see if I can find other cables to try. The weird thing is if the phone is off, and plugged in, the LED lights up green, as if it's charging. But using the same cable, if the phone is on, it won't acknowledge that it is plugged in.
Click to expand...
Click to collapse
No, I wouldn't think so...
I've been able to charge off of many different USB cables on my Q. Not sure... Only thing it's been picky on so far is the wall wart - cable it hasn't seemed too picky about.
If its an old desktop with USB 1.1 it may not charge, and many laptops won't allow charging via USB if the laptop itself is not plugged into AC. Just a thought.
Sent from my XT897 using xda app-developers app
bryanfritz1 said:
If its an old desktop with USB 1.1 it may not charge, and many laptops won't allow charging via USB if the laptop itself is not plugged into AC. Just a thought.
Sent from my XT897 using xda app-developers app
Click to expand...
Click to collapse
Very good point ^^^. I've heard some laptops, even when plugged in, still don't provide enough juice to charge (some) devices. Perhaps your laptop is one of these low-power USB port devices.
ive noticed that this phone is picky about what charger you use. i have a hard time charging on my pc as well. and certain micro usb's i have dont seem to charge it well either. needs to be the stock plug it came with.
I've basically given up at this point. Blackberry AC chargers work well for me, so I'll try and track down a few more of them. Otherwise, nothing is consistent. The desktop I've used has a plenty big enough power supply, and it charges my Epic with no problem. My personal laptop and work laptop both charged the Epic, but not the Photon Q. I guess I'll just have to carry around a charger instead of a MicroUSB cable when I'm on the road with my laptop.
Thanks, all.
tcrimsonk said:
I've basically given up at this point. Blackberry AC chargers work well for me, so I'll try and track down a few more of them. Otherwise, nothing is consistent. The desktop I've used has a plenty big enough power supply, and it charges my Epic with no problem. My personal laptop and work laptop both charged the Epic, but not the Photon Q. I guess I'll just have to carry around a charger instead of a MicroUSB cable when I'm on the road with my laptop.
Thanks, all.
Click to expand...
Click to collapse
All,
For what little it's worth, I just noticed that the words "Not Charging" come up on the lock screen whenever I connect to the USB port of my laptop or desktop. So the PQ knows it's plugged in; it just refuses to accept the charge.
Also, whenever the battery completely dies, the phone will start to charge. It will charge for a few minutes until it has enough battery to turn itself on. As soon as it turns on, it stops charging, and a minute later, shuts down because of the dead battery. Then it starts charging again. This basically gives me an endless loop of the phone charging, starting, discharging, and shutting back off. I can't even get it to stay off long enough to get a useful charge without turning on automatically.
Yeah, the only issue I've had with this phone at all is the extreme 'quirkiness' it has in regards to charging on anything other than the stock usb cord & power adapter it plugs into. Even using the Moto vehicle dock for the Q, its completely hit/miss on charging. It will *often* go into that 'Not Charging' state where its kind of keeping sort of a baseline/'stalemate' of the current charge level for me, not really going down but not charging back up either. Not really sure what's up with that. With my vehicle dock for the longest I kept thinking maybe my cig lighter port on my car is bad, but I don't have issues with my radar detector at all.
Had the same problem with the not charging a few days back. I was leaving the phone in Mass Storage mode because just getting it into Mass Storage was a headache originally.
Hooked it up to it's original cable and woke up with 65% battery. Switched from mass storage to charge only and it started charging.
Not sure if it was caused by being in Mass Storage and wouldn't charge but now I put in Charge Only before bed.
It always works (in my experience) with the original cable that comes with it regardless, its anything else where its quirky.
PythonFanTN said:
It always works (in my experience) with the original cable that comes with it regardless, its anything else where its quirky.
Click to expand...
Click to collapse
Isn't there a setting in ##3282# that enables and disables USB charging? Y'all have probably thought of this already. Anyways just thought if throw that out there. This is my first android that was not a low usage device. I know very little about it. I seriously think xda should make tee shirts that say "everything I have learned in life I learned from xda".
My phone was not charging in debugging mode yesterday.
Sent from my XT897 using xda premium

What would happen if I wirelessly charge AND AC/USB charge at the same time?

I was just curious, lol. Would the phone break or something? Thanks.
patsimeon said:
I was just curious, lol. Would the phone break or something? Thanks.
Click to expand...
Click to collapse
Oops, wrong section...Sorry! I don't know how to move or delete this. Anyway, my curiosity stays.
I think qi charging overrides USB charging, but it could be the other way around. Either way, the phone knows to deactivate one.
According to the battery monitor, wired charging (USB or A/C) overrides wireless charging. So, if you plug it in, it doesn't matter if you place it on the wireless charger or not.
I seem to recall someone at Google (on one of their product QA's for this phone) that even though it makes logical sense for the AC charger to take precedence (faster, less heat generation) but the QI charger is the one actually doing the charger.
I realize this contradicts what the battery status would indicate, but it is plausible that the indicator does not report it correctly.
Either way, the only time I can really see this being a factor for me even REMOTELY, is in the extremely rare event I have the phone plugged into my computer via USB, and sitting on my qi charger. But that almost never happens, I sync data to/from the phone over wifi just because, well, it's easier. It's not faster, but since it happens automatically it takes less effort.
In that case, I'd actually prefer the qi charger to work, since it's a faster charge than my USB port.
imagine the hilarity if both charging circuits worked though...sounds good in theory but I think we'd all have broken phones
I've plugged in my USB cable (hooked up to my computer via USB 3.0), while my phone was sitting on my Qi charger (nokia, 750mah), and the usb cable takes priority over the charge.
When wireless charging is in effect, you hear the NFC tone from the phone. Also the light on the charger turns on when its charging. It doesn't play when you lay a phone with USB plugged in, and the light doesn't turn on in front of the charger, so.
I'm pretty sure this would disrupt the space-time continuum.
xybur said:
I've plugged in my USB cable (hooked up to my computer via USB 3.0), while my phone was sitting on my Qi charger (nokia, 750mah), and the usb cable takes priority over the charge.
When wireless charging is in effect, you hear the NFC tone from the phone. Also the light on the charger turns on when its charging. It doesn't play when you lay a phone with USB plugged in, and the light doesn't turn on in front of the charger, so.
Click to expand...
Click to collapse
I can confirm that while setting on the wireless charger, the "charging" light is on on the charger, but if I plug the cable in, the light goes out. The wired charger is DEFINITELY overriding the wireless charger.
For people using OTG cables or external storage adapters on the microUSB slot they do require wireless charging to work while being "plugged in".
awesome question...I have a S5, which has a galaxy charging current app
does one exist for the nexus? if so, you could tell by the amps it is charging at

[Q] Quick Car Charger that will charge the phone while GPS is on?

Trying to find a car charger and cable that will charge the phone while GPS is on.
Currently using: Incipio Auto Charger 2.0 Quick Charge
...and an HTC branded coiled charging cable that came with my One M8's HTC branded car charging adapter. (My M8 had no problem charging while the GPS was in use. Bluetooth too.)
It DOES say "charging by AC" when connected but still drops as I drive. No other apps running, not even bluetooth.
Not interested in having the screen dim between directions because I like to see what's coming before the GPS announces it (and I typically run the GPS muted anyway.)
I am also confused by the charging cable comments. I've read the cable has to be "charge only, no data" and also that it DOES need to be a data cable so the phone can identify the "quick" charger. Which is correct?
Help?
TIA!
kjarrett said:
Trying to find a car charger and cable that will charge the phone while GPS is on.
Currently using: Incipio Auto Charger 2.0 Quick Charge
...and an HTC branded coiled charging cable that came with my One M8's HTC branded car charging adapter. (My M8 had no problem charging while the GPS was in use. Bluetooth too.)
It DOES say "charging by AC" when connected but still drops as I drive. No other apps running, not even bluetooth.
Not interested in having the screen dim between directions because I like to see what's coming before the GPS announces it (and I typically run the GPS muted anyway.)
I am also confused by the charging cable comments. I've read the cable has to be "charge only, no data" and also that it DOES need to be a data cable so the phone can identify the "quick" charger. Which is correct?
Help?
TIA!
Click to expand...
Click to collapse
Hi I had the same problem. In the end, I made my own being an electrical engineer, I was tired of having charging problems. You need a regulated 12V to 5V DC power supply capable of at least 1A continous charging. What i find helps too is put the phone in battery saving mode when charging continuously . This is the sort of thing I made:
http://i00.i.aliimg.com/wsphoto/v0/557345118/DC-Step-Down-Converter-DC-8-22V-12V-to-5V-Auto-Car-Power-Supply-Waterproof-USB.jpg
Thank you so much for your reply.
I might even be able to build something like you describe, I have friends with the requisite skills.
Question is, will that hack allow me to charge the phone while the GPS is on? Charging while the phone is off or not in use is just fine.
I have my M8 here, dusting it off, in case I need to return the M9...
Mine charges ok with the screen and GPS running whist I have igo primo running

Categories

Resources