Some time ago (I don’t remember when or under what conditions), my Fairphone 4 switched USB controlled by to This device and I cannot turn it back. Do you have any idea how to turn it back to Connected device?
What I do:
- Plug in USB cable to Fairphone
- Plug in USB cable to PC
- unlock Fairphone
- find this notification:
- after clicking it, have this settings pane open:
What happens:
I cannot switch to Connected device. After clicking it, it first says Switching…, then Couldn’t switch.
What I expect to happen:
I should be able to switch to Connected device by clicking on it.
What I’ve tried so far with no effect:
- tried on different computer (Linux)
- tried on different USB ports (USB 3.0, USB 2.0)
- tried with different USB cables (Original Fairphone cable; simple USB 2.0 A to USB-C connector)
- tried with different options of Use USB for (default: No data transfer, also tried File Transfer, USB tethering, MIDI, PTP)
- tried with WiFi and/or Bluetooth disabled
- tried across several reboots of FP4
- tried across several versions of FP4 (problem persists after system upgrade)
Version info
This problem happens with the current software release FP4.SP2G.B.079.20230624 (Patchlevel 2023-06-05) as well as at least the previous version.
The problem started happening on my phone some time between 2023-05-10 and 2023-06-09.
Additional info
Related (but already closed) topic with no solution: FP4 is no longer recognized on Windows 10 / 11 via USB
Debugging
Thanks to wireless debugging, I still can access the device via adb. An adb logcat -d
didn’t resolve much info though:
shortened extract from FP4's syslog
shortened output of adb logcat -d
:
07-28 15:17:09.048 1802 4075 I UsbPortManager: Setting USB port mode and role: portId=port0, currentMode=ufp, currentPowerRole=sink, currentDataRole=device, newMode=dfp, newPowerRole=source, newDataRole=host
07-28 15:17:09.048 1802 4075 E UsbPortManager: Trying to set the USB port mode: portId=port0, newMode=dfp
07-28 15:17:09.051 985 985 I android.hardware.usb@1.2-service-qti: filename write: /sys/class/typec/port0/port_type role:source
07-28 15:17:13.272 2831 2831 V DeviceStatisticsService: chargerType=2 batteryLevel=53 totalBatteryCapacity=3615900
07-28 15:17:13.273 2499 2499 D KeyguardUpdateMonitor: received broadcast android.intent.action.BATTERY_CHANGED
07-28 15:17:13.292 2499 2499 D KeyguardUpdateMonitor: handleBatteryUpdate
07-28 15:17:16.386 2831 2831 V DeviceStatisticsService: chargerType=2 batteryLevel=53 totalBatteryCapacity=3615900
07-28 15:17:16.387 2499 2499 D KeyguardUpdateMonitor: received broadcast android.intent.action.BATTERY_CHANGED
07-28 15:17:16.415 2499 2499 D KeyguardUpdateMonitor: handleBatteryUpdate
07-28 15:17:17.052 985 985 I android.hardware.usb@1.2-service-qti: uevents wait timedout
07-28 15:17:17.053 1802 2461 E UsbPortManager: port0 role switch failed
How to do wireless debugging without USB
- have a computer with
adb
(must be on the same wifi, preferably with no other devices on the same wifi; it seems to work stable only if your computer makes a Wifi hotspot with only the FP4 connected), open a command shell where you can executeadb
from - on FP4 settings, in Developer mode and search for “wireless debugging”
- on FP4, press Pair device with pairing code, which will open a dialog.
- on the computer, execute
adb pair [ip address]:[port]
with[ip address]:[port]
as displayed in the pairing dialog on FP4. - on the computer, you will be asked for a pairing code. Type the pairing code you see on FP4.
- on FP4, the pairing dialog will close
- on the computer, execute
adb connect [ip address]:[port]
with[ip address]:[port]
as displayed in section IP adress & Port. Please note that this is a different port than in the pairing dialog! - do something to keep the adb connection busy, otherwise wireless debugging will terminate within tens of seconds. I opened
scrcpy
and set the screensaver timeout on my FP4 to 30 minutes. I’m open for suggestions to do something else/better.