Closed omasanori closed 3 months ago
I'm not sure if its the same issue, but ever since the pmOS update to v24.06 I also can't seem to get ADB working again (I'm also on Pinephone 1.2a with modem firmware EG25GGBR07A08M2G_30.006.30.006
)
It was definitely working with pmOS v23.xx (custom firmware installed), though its been a while since I last had to use it, so I don't remember the exact steps that I did previously.
I tried sending AT+QCFG="usbcfg",0x2C7C,0x125,1,1,1,1,1,1,0
followed by AT+ADBON
and both return OK
, but adb devices
still prints adb: no devices/emulators found
Some noteworthy things:
AT+QADBKEY?
and AT+QCFG="usbcfg"
just return OK
, but without any data (though I'm not sure if the latter should return anything)AT+ADBON
command definitely does something since the display brightness briefly flickers after sending it (modem restart?)android-tools
package was updated from v34.0.4 to v35.0.1, so maybe something major changed? (would be helpful to get feedback from someone using that version and having adb working, or just generally the same pmOS version)I wonder if something might be interfering with the modem restart, like in https://github.com/Biktorgj/quectel_eg25_recovery/issues/18#issuecomment-1171892213? (though I already tried applying the same steps here, with no success)
Anyway now I'm out of ideas, so I would also appreciate suggestions for further debugging.
Thanks @Zapeth, at least I realized that I am not alone...
I will try v23.12 to see if anything changes.
both AT+QADBKEY? and AT+QCFG="usbcfg" just return OK, but without any data (though I'm not sure if the latter should return anything)
Mine returns something related (the serial number and the current configuration I guess). Interesting.
Update: postmarketOS v23.12's adb detects the modem and both adb and fastboot works!
It was definitely working with pmOS v23.xx (custom firmware installed),
Did you mean https://github.com/the-modem-distro/pinephone_modem_sdk was flashed to the modem, @Zapeth?
If so, I confirmed that AT+QADBKEY?
and AT+QCFG="usbcfg"
returns nothing but OK with that firmware just now. I think it is fine.
(Reposting what I told omasanori on IRC...)
pmOS 24.06 onwards carries a udev rule added by this change to automatically restart the modem when it vanishes from USB. eg25-manager used to restart the modem itself when this happened, but that broke about a year ago, so pmOS does it itself by having udev restart eg25-manager and thus restart the modem.
So if you want to reboot the modem into fastboot, you don't want this udev rule to fire, so you have to mask it first.
Mask the udev rule.
ln -s /dev/null /etc/udev/rules.d/90-modem-eg25-openrc.rules
Run fastboot
or flashall
or whatever you wanted to do.
Unmask the rule when you're done.
rm /etc/udev/rules.d/90-modem-eg25-openrc.rules
@Arnavion Thanks for the information, unfortunately it still doesn't work for me with the rule masked, the overall behavior seems unchanged (I also tried moving the file out of /usr/lib/udev/rules.d
entirely).
I did notice that I had a 80-modem-eg25.rules
file beside the packaged 90-modem-eg25.rules
, maybe this wasn't correctly migrated during the pmOS upgrade? (I did modify the rules file at some point in v23.12, maybe thats why its still present).
To be safe I also moved this file out of the rules.d
directory, but that didn't seem to change anything either.
I assume you're also on pmOS v24.06 and adb is working for you, can you share the steps you follow to enable adb access on your device?
@omasanori Is adb working for you on v24.06 after masking 90-modem-eg25-openrc.rules
?
If so, I confirmed that AT+QADBKEY? and AT+QCFG="usbcfg" returns nothing but OK with that firmware just now. I think it is fine.
Yes I have the custom firmware installed, thanks for checking the commands.
@Zapeth Two things:
adb kill-server
) and then try to run adb devices
againOh, and I forgot, fastboot only stays for two seconds unless told otherwise, so make sure you leave fastboot oem stay
running in the background or another terminal, then send AT+QFASTBOOT. It will say [OKAY] and stay there
I did notice that I had a
80-modem-eg25.rules
file beside the packaged90-modem-eg25.rules
, maybe this wasn't correctly migrated during the pmOS upgrade?
There is nothing to migrate. Both of those files are expected to exist and do different things. The 80- file comes from aports eg25-manager
package and the 90- from pmaports device-pine64-pinephone
package.
(I did modify the rules file at some point in v23.12, maybe thats why its still present).
Modifications to files in /usr do not matter to apk. Only modifications to files in /etc are preserved. In any case you should not modify files in /usr.
I assume you're also on pmOS v24.06
I'm on Edge. (I'm the pmOS maintainer for the PinePhone.)
and adb is working for you
I just checked and it isn't. Just like you saw, sending AT+ADBON
reconnects the modem to USB but it doesn't appear reachable to adb devices -l
(and yes I did pkill adb
first to make sure the server gets restarted and redetects devices).
I haven't tried adb since I used it to switch from Quectel fw to OSS fw in 2021 or so, so I believe you that it broke between 23.12 and 24.06. The only thing I've done recently is use fastboot
as part of upgrading the OSS firmware (AT+QFASTBOOT
+ fastboot ...
) which still works fine, after the udev rule is disabled.
I posted what I posted because this part of the OP:
By issuing
AT+QFASTBOOT
, the modem disappears and then comes back after few seconds, not as a fastboot device but a normal modem.
... is because of the udev rule I mentioned.
Thanks @Arnavion and @Biktorgj for insightful explanations. I learnt many.
@omasanori Is adb working for you on v24.06 after masking 90-modem-eg25-openrc.rules?
No, on v24.06 with udev rules masking, adb does not work while fastboot does work.
Looking at the changelog of android-tools between Alpine 3.19 (what pmOS 23.12 is based on) and Alpine 3.20 (what pmOS 24.06 is based on) versions (34.0.4 -> 35.0.1), I spotted there was a change for adb to use libusb by default in 35.0.0:
35.0.0 (February 2024)
adb
- Switch to libusb as the default on Linux issue #270205252.
Reading through that issue, I spotted mention of an ADB_LIBUSB
env var. So on a hunch I did pkill adb; ADB_LIBUSB=0 adb devices -l
and now the modem shows up for me:
$ printf 'AT+ADBON\r\n' | atinout - /dev/EG25.AT -
OK
$ pkill adb; ADB_LIBUSB=0 adb devices -l
* daemon not running; starting now at tcp:5037
* daemon started successfully
List of devices attached
community_fw device usb:2-1 transport_id:1
ie disabling the use of libusb seems to make it work.
This is on Edge. Try it on 24.06
@Arnavion I confirmed that the ADB_LIBUSB workaround works on v24.06 too. (as I replied on chat)
OTOH I had built android-tools 23.0.4-r6 for v24.06 and confirmed that it works (without ADB_LIBUSB).
Yes, 34.0.4 defaults to not using libusb, so ADB_LIBUSB=0
is not needed for it. In fact, I would guess that ADB_LIBUSB=1
will break it. You can try.
I agreed but actually adb 34.0.4 does work with ADB_LIBUSB=1, I just tried. Probably libusb on v24.06 handles its job as expected.
Okay. In any case, something is wrong in android-tools or libusb or in the interaction between them, so this should be followed up in an aports issue.
Sure, would you open one on the aports issue tracker and put a link here? I will close this issue after that.
Thanks a lot! Closing.
I can also confirm that it works for me with again with ADB_LIBUSB=0
, thanks for the quick help
The situation is very similar to https://github.com/the-modem-distro/pinephone_modem_sdk/issues/99 but I decided to report anyways...
I have PinePhone 1.2a. The OS was updated to postmarketOS v24.06.
My modem had had firmware version
01.001.01.001
so I decided to update it toEG25GGBR07A08M2G_30.006.30.006
by qfirehose in EDL mode first. I had tried the ADB method first but it didn't work. The test point method works then.My expectation is that ADB and/or fastboot become working with that newer firmware, but it doesn't. By issuing
AT+QFASTBOOT
, the modem disappears and then comes back after few seconds, not as a fastboot device but a normal modem.Also, the
AT+QADBKEY
andAT+QCFG
method with qadbkey-unlock does not make ADB access available.Any suggestions are welcome.