KB: Using bus powered USB peripherals with the pinephone keyboard mounted
#1
From megi: https://xnux.eu/pinephone-keyboard/faq.html#safety

Quote:Can I plug something to the phone's Type-C port?

No! When the keyboard is connected to the phone, it powers the phone by internally supplying 5V to the VBUS of the phone's Type-C port. So if you connect another USB power supply to the phone's Type-C port, it's like connecting two chargers to the phone by cutting and splicing their cables. (Likely not a good thing, or something you'd consider doing if it was presented to you that way.) If you connect some USB peripheral there that only consumes power from the port (like mouse, unpowered dock, etc.), it may work (in theory), but only if you make *absolutely sure* the phone will not enable its power output to the USB device! No distros ensure that at the moment. When you plug USB periperal it's the same as plugging in two chargers into the same port, without additional software support that doesn't exist, yet.


I'm wondering if anyone knows, or has advice where to ask around, about how to "make *absolutely sure* the phone will not enable its power output to the USB device." Is this something that can be achieved through sysfs? Or a udev rule? Or would it require hacking on the kernel? Has it already been done in any distros?

I've just installed Arch ARM (https://github.com/dreemurrs-embedded/Pine64-Arch) and am hoping to use the pinephone with a teensy 4.1 microcontroller attached via USB along with the keyboard, but I would like to avoid frying either the pinephone, teensy, or keyboard.
  Reply
#2
source (pinephone (pro) keyboard):
https://www.pine64.org/2022/05/31/may-update-worth-the-wait/

short version:
do not connect anything to the pinephone usb type-c port, when keyboard case is mounted. regardless does it draw power or insert power.

problem seems to be that pp's usb port is controlled by hardware chip, which seems to be more or less buggy. and that hardware chip starts to insert 5 volts when usb devices are connected, thus resulting dual power supply issue. maybe software can be fixed but hardware overrides are usually not possible.

this or these issues should re-thought in next pinephone.
  Reply
#3
See also https://wiki.pine64.org/wiki/PinePhone_(...ard#Safety which links to the pine64 blog post where it was discussed. No ways to "make *absolutely sure* the phone will not enable its power output to the USB device" have been identified so far.
  Reply
#4
Is this also an issue if the keyboard is turned off by double clicking the physical button on the side?
  Reply
#5
Yes - from the blog post linked above:
"To be fair, it is possible to turn the PPKB’s 5 V boost output off, both in software that talks to the battery charging IC inside the PPKB and by using the physical button on the PPKB itself, but it was concluded empirically that the inactive status of the charging part of the PPKB achieved that way simply cannot be trusted, because the charging part may become active again unexpectedly. Moreover, nothing gets electrically disconnected that way, which still ends up in a USB charger plugged into the phone’s USB port feeding power into the charging part of the PPKB, which in this case may be even worse for the health of the charging part, because there is now no power coming out of the PPKB to “fight against” the power coming in from the USB charger. Not good at all."

It seems to be a fundamental hardware problem that's going to need a redesign, unfortunately discovered after people had bought them.
  Reply
#6
Ok, so it's a hardware problem that demands a hardware solution.

If I were to e.g. remove the battery from the keyboard, or desolder the charging chip, or otherwise modify the hardware, is there some way I could continue to use the keyboard while circumventing this power issue? I would rather be able to use USB peripherals with the phone than have a backup battery in the keyboard, if it is possible to make that choice. My aim in this scenario would be to guarantee that the phone could not be damaged by the keyboard while a USB peripheral is connected to the phone.

Might it be possible to install a hardware switch somewhere inside the charger so that I could maintain both functions? E.g., naïvely considering the schematic, could I cut the trace from pins 16 and 17 of the IP5209 power management SOC to jumper 2, or intercept the trace from jumper 2 to wherever it's going, and splice in a physical switch?

Also, my sincere thanks to all who have responded. Your input is very much appreciated.

I see here for instance that it has been suggested by reddit user u/Odd-Version9895 that it should be safe to use the phone's usb port if the battery is disconnected, but I don't know on what authority that person is able to make that claim. It makes sense to me intuitively, but what do I know...
  Reply
#7
(06-30-2022, 10:46 AM)docsunset Wrote: Might it be possible to install a hardware switch somewhere inside the charger so that I could maintain both functions? E.g., naïvely considering the schematic, could I cut the trace from pins 16 and 17 of the IP5209 power management SOC to jumper 2, or intercept the trace from jumper 2 to wherever it's going, and splice in a physical switch?

I thought of the very same thing, but didn't get the chance to try it: https://forum.pine64.org/showthread.php?tid=16853

However, someone went one step further - they spliced a USB port instead of a switch, so they could charge other devices: https://forum.pine64.org/showthread.php?tid=17015 (but somehow this doesn't work anymore due to software reasons...)
  Reply
#8
(06-26-2022, 12:50 PM)docsunset Wrote: From megi: https://xnux.eu/pinephone-keyboard/faq.html#safety

Quote:Can I plug something to the phone's Type-C port?

No! When the keyboard is connected to the phone, it powers the phone by internally supplying 5V to the VBUS of the phone's Type-C port. So if you connect another USB power supply to the phone's Type-C port, it's like connecting two chargers to the phone by cutting and splicing their cables. (Likely not a good thing, or something you'd consider doing if it was presented to you that way.) If you connect some USB peripheral there that only consumes power from the port (like mouse, unpowered dock, etc.), it may work (in theory), but only if you make *absolutely sure* the phone will not enable its power output to the USB device! No distros ensure that at the moment. When you plug USB periperal it's the same as plugging in two chargers into the same port, without additional software support that doesn't exist, yet.


I'm wondering if anyone knows, or has advice where to ask around, about how to "make *absolutely sure* the phone will not enable its power output to the USB device." Is this something that can be achieved through sysfs? Or a udev rule? Or would it require hacking on the kernel? Has it already been done in any distros?

I've just installed Arch ARM (https://github.com/dreemurrs-embedded/Pine64-Arch) and am hoping to use the pinephone with a teensy 4.1 microcontroller attached via USB along with the keyboard, but I would like to avoid frying either the pinephone, teensy, or keyboard.

Something could be a usb bus. The manual for the keyboard says it is okay to do that. But it don't work...
  Reply
#9
(06-26-2022, 12:50 PM)docsunset Wrote: From megi: https://xnux.eu/pinephone-keyboard/faq.html#safety

Quote:Can I plug something to the phone's Type-C port?

No! When the keyboard is connected to the phone, it powers the phone by internally supplying 5V to the VBUS of the phone's Type-C port. So if you connect another USB power supply to the phone's Type-C port, it's like connecting two chargers to the phone by cutting and splicing their cables. (Likely not a good thing, or something you'd consider doing if it was presented to you that way.) If you connect some USB peripheral there that only consumes power from the port (like mouse, unpowered dock, etc.), it may work (in theory), but only if you make *absolutely sure* the phone will not enable its power output to the USB device! No distros ensure that at the moment. When you plug USB periperal it's the same as plugging in two chargers into the same port, without additional software support that doesn't exist, yet.


I'm wondering if anyone knows, or has advice where to ask around, about how to "make *absolutely sure* the phone will not enable its power output to the USB device." Is this something that can be achieved through sysfs? Or a udev rule? Or would it require hacking on the kernel? Has it already been done in any distros?

I've just installed Arch ARM (https://github.com/dreemurrs-embedded/Pine64-Arch) and am hoping to use the pinephone with a teensy 4.1 microcontroller attached via USB along with the keyboard, but I would like to avoid frying either the pinephone, teensy, or keyboard.

Does this problem persist even when the keyboard is disabled by double-clicking the physical button on its side?
  Reply
#10
Dear friend, if you have a moment of free time - please look at https://forum.pine64.org/showthread.php?tid=18586 ( " USB mouse isn't working when a PP keyboard is attached? " )
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  keyboard case charging but not typing new2pinephone 18 5,207 02-19-2024, 07:30 AM
Last Post: theResonant
  Keyboard doesn't charge my phone no matter what, so can I charge my phone directly ragreenburg 3 5,462 01-14-2024, 03:34 PM
Last Post: acid andy
  PinePhone Dock with laptop? Mikey1977Y2J 2 520 12-12-2023, 05:43 PM
Last Post: Mikey1977Y2J
  I've added an I2C connector to the PP keyboard eugenr 0 359 11-26-2023, 07:24 AM
Last Post: eugenr
  Case for Pinephone totilele 12 6,517 11-04-2023, 09:43 AM
Last Post: Negome
  Update the PinePhone keyboard driver to support missing characters? Peter Gamma 8 7,901 10-22-2023, 08:43 PM
Last Post: Peter Gamma
  key repeat with pinephone keyboard rotwang 0 392 10-22-2023, 03:39 PM
Last Post: rotwang
Exclamation USB mouse isn't working when a PP keyboard is attached? mikeb 3 1,109 10-21-2023, 08:21 PM
Last Post: Peter Gamma
  Pinephone with mini keyboard, trackpad and large power bank? Peter Gamma 0 447 10-21-2023, 07:50 AM
Last Post: Peter Gamma
  Which mini keyboard and mouse to choose for the PP? Peter Gamma 0 561 10-21-2023, 02:55 AM
Last Post: Peter Gamma

Forum Jump:


Users browsing this thread: 1 Guest(s)