So I've tried to use the modem for the first time on the hammerhead, to test ofono patches mentioned in #231 (closed).
There is a symlink in /dev/modem pointing to /dev/rpmsg0.
But the list-modems ofono test script shows no modems, and looking at dmesg, it seems that the modem has crashed or something like that. See the attached log. Just to make sure, I've also tried it with Alpine's current ofono package, and same result (I think it crashes before ofono even talks to the modem).
@MartijnBraam, @bshah: can you check if ofono still finds the modem with a fresh postmarketOS rootfs? (It will install Alpine's ofono, without the qmi call patches, but as I understand, the modem should still get found, only calls should not work.)
I'm suspecting that I need to update the modem firmware, but I don't have time for that right now and it would be nice to know if it is still working for somebody else.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items 0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items 0
Link issues together to show that they're related.
Learn more.
I just flashed a fresh pmos to my hammerhead with plasma mobile, for some reason I can't SSH in but it looks like the modem is at least detected since I have the cell signal level icon in the plasma drawer. I also think my test sim is expired :(
FWIW, I've also had issues with logging in via ssh today. But after rebooting the device, and plugging the cable in again, and also killing dhclient, ssh worked again. Can you try again, and see if the modem works via CLI?
I had to become root. And then I don't get any modems.
rock:/home/craig/ofono/test# ./enable-modemTraceback (most recent call last): File "./enable-modem", line 14, in <module> path = modems[0][0]IndexError: list index out of rangerock:/home/craig/ofono/test# ./list-modems
I found some notes I had on using dbus-send to get more details. I also tried nmcli radio all on/off/on and that didn't change things.
craig@other:~/postmarketos$ grep -si modem 2019-05-04-hammerhead-stockrom-dmesg.log[ 0.848660] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters[ 2.469682] fs_mgr: __mount(source=/dev/block/platform/msm_sdcc.1/by-name/modem,target=/firmware,type=vfat)=0[ 4.961887] pil-q6v5-mss fc880000.qcom,mss: modem: Brought out of reset[ 5.064947] subsys-restart: subsys_err_ready_intr_handler(): Error ready interrupt occured for modem[ 5.277764] apr_tal:Modem Is Up
[ 4.961887] pil-q6v5-mss fc880000.qcom,mss: modem: Brought out of reset[ 5.028112] Notify: smsm init[ 5.064947] subsys-restart: subsys_err_ready_intr_handler(): Error ready interrupt occured for modem[ 5.065898] msm_ipc_router_send_control_msg: xprt_info not initialized[ 5.067205] msm_ipc_router_send_control_msg: xprt_info not initialized[ 5.080937] msm_ipc_router_send_control_msg: xprt_info not initialized[ 5.194296] bq24192_set_input_i_limit: input current limit = 500 setting 0x02[ 5.277764] apr_tal:Modem Is Up
On pmos I get:
rock:/home/craig/ofono/test# dmesg | grep modem[ 17.091858] qcom-q6v5-pil fc880000.modem-rproc: Looking up mx-supply from device tree[ 17.091962] qcom-q6v5-pil fc880000.modem-rproc: Looking up cx-supply from device tree[ 17.092057] qcom-q6v5-pil fc880000.modem-rproc: Looking up pll-supply from device tree[ 17.092165] qcom-q6v5-pil fc880000.modem-rproc: Looking up mss-supply from device tree[ 17.092955] remoteproc remoteproc1: fc880000.modem-rproc is available[ 17.100218] remoteproc remoteproc1: powering up fc880000.modem-rproc[ 17.187470] qcom-q6v5-pil fc880000.modem-rproc: MBA booted, loading mpss[ 19.209488] remoteproc remoteproc1: remote processor fc880000.modem-rproc is now up[ 59.255063] qcom-q6v5-pil fc880000.modem-rproc: fatal error received: dog.c:1495:Watchdog detects stalled initialization[ 59.255072] remoteproc remoteproc1: crash detected in fc880000.modem-rproc: type fatal error[ 59.255104] remoteproc remoteproc1: handling crash #1 in fc880000.modem-rproc[ 59.255111] remoteproc remoteproc1: recovering fc880000.modem-rproc[ 61.055176] qcom-q6v5-pil fc880000.modem-rproc: watchdog received: dog.c:1495:Watchdog detects stalled initialization[ 61.055183] remoteproc remoteproc1: crash detected in fc880000.modem-rproc: type watchdog[ 64.327241] qcom-q6v5-pil fc880000.modem-rproc: failed receiving QMI response[ 69.367238] qcom-q6v5-pil fc880000.modem-rproc: timed out on wait[ 69.367433] remoteproc remoteproc1: stopped remote processor fc880000.modem-rproc[ 69.457235] qcom-q6v5-pil fc880000.modem-rproc: MBA booted, loading mpss[ 70.162168] remoteproc remoteproc1: remote processor fc880000.modem-rproc is now up[ 70.162247] remoteproc remoteproc1: handling crash #2 in fc880000.modem-rproc[ 70.162254] remoteproc remoteproc1: recovering fc880000.modem-rproc[ 70.190744] remoteproc remoteproc1: stopped remote processor fc880000.modem-rproc[ 70.277235] qcom-q6v5-pil fc880000.modem-rproc: MBA booted, loading mpss[ 70.972644] remoteproc remoteproc1: remote processor fc880000.modem-rproc is now up[ 71.080337] qcom_sysmon smd:modem.sys_mon.-1.-1: sysmon device not child of rproc[ 71.080356] qcom_sysmon smd:modem.sys_mon.-1.-1: rpmsg_dev_probe: failed: -22[ 71.080388] qcom_sysmon: probe of smd:modem.sys_mon.-1.-1 failed with error -22
Thanks for your tests, @unrznbl and @MartijnBraam!
I wrote earlier, that I might need to upgrade the firmware on the device. But I've realized that this does not make much sense, since we are not using the firmware from Android's firmware partition. Instead we are shipping our own firmware files (see the firmware-lg-hammerhead package).
So it would be very interesting to figure out, why the modem is not working for @unrznbl and me, but it does work for @MartijnBraam (and for @bshah I assume, at least it had been working at some point?).
Some ideas:
@MartijnBraam: can you try to get usb network working, and post/compare the dmesg you have? (maybe try a different PC or see related troublshooting)
@unrznbl: since you have just tested, that it works with stock android, you could try to use the firmware files from stock android, instead of the ones we are shipping. (Maybe there are two sets of firmware files, that need to be used?)
basically one would mount android's firmware partition, and copy the files over the files installed by the postmarketOS package, to /lib/firmware/(src) and /lib/firmware/brcm/brcmfmac4339-sdio.txtsrc)
then restart ofono (or even reboot) and see if the modem starts working
I've followed your instructions @ollieparanoid, list-modems does not display anything. Dmesg has similar messages with error -22 https://paste.ubuntu.com/p/DTF76Hpyjn/ and the same as in @unrznbl test - empty array from org.ofono.Manager.GetModems dbus call.
About mounting firmware partition,
mount /dev/mmcblk1p1 /firmware/mount: /firmware: unknown filesystem type 'vfat'.
but firmware partitions are usually vfat (fat16 precicely)
kernel probably needs CONFIG_MSDOS_FS, CONFIG_VFAT_FS support enabled. (and also CONFIG_NLS_CODEPAGE_437 + CONFIG_NLS_ISO8859_1, otherwise FAT-fs (mmcblk1p1): codepage cp437 not found)
P.S. I've added Partition layout section to hammerhead wiki page.
Where do you get adsp and other firmware files from? modem partition (p1) contains only modem firmware, and copying files from it to /lib/firmware does not help :( same errors with -22
Ah, I found them, @unrznbl in the link to stock firmware you gave few messages above, in zip file there is a system.img, after converting it with simg2img you can mount it and find firmware files in vendor/firmware folder : image
Probably should try with those...
It should already be flashed on /system partition, but wiki page suggests to format system for some reason (because we are installing to userdata?)
Well, I've just tried to put all files from android's /system/vendor/firmware to /lib/firmware and reboot, but I still get that same dmesg and no modems.
It would be very good to know what the process is for bringing up the modem. What loads firmare? What causes the modem/baseband processor to start/load/say "I'm ready". :) Is that documented somewhere or do you have an idea where it is in the... kernel maybe? If so we could add more debugging and possibly find where things go wrong.
What causes the modem/baseband processor to start/load/say "I'm ready". :)
Uh, a combination of the kernel and ofono, I guess.
Is that documented somewhere or do you have an idea where it is in the... kernel maybe? If so we could add more debugging and possibly find where things go wrong.
Great idea! I am a bit clueless here myself, but maybe digging a bit in the ofono source code, or asking in an ofono IRC channel / on the mainling list would help. (I'd love to dig into this more myself, but right now keeping up with the backlog of issues and merge request takes up too much time.)
It should already be flashed on /system partition, but wiki page suggests to format system for some reason (because we are installing to userdata?)
yes, that is in case postmarketOS was flashed to the system partition before and then to userdata - then it is a good idea to format the old one to make sure that we boot the new one.
Looking at a device I see no /var/log/firmwareload.log file. :( I tried adding some logging there but saw nothing. I'm wondering if I need to enable some additional udev debug logging.
I did find some info on remote processor framework in linux which seems to be handling the crash of the modem processor. https://gitlab.com/postmarketOS/linux-postmarketos/tree/master/drivers/remoteproc, documentation in general seems to suggest that logs might be retrieved via that debugfs but I get nothing when I cat out resource_table. There are two rproc entries in /sys/kernel/debug/remoteproc: adsp-pil and fc880000.modem-rproc.
I poked at this a bit last night. Tried looking back to around June 9, 2018 when the blog post that stated this worked was. Tried reverting some changes in pmaports:
diff --git a/modem/modem-qcom-msm-mainline-common/udev.rules b/modem/modem-qcom-msm-mainline-common/udev.rulesindex 023320e6..b8b153d7 100644--- a/modem/modem-qcom-msm-mainline-common/udev.rules+++ b/modem/modem-qcom-msm-mainline-common/udev.rules@@ -1,7 +1,7 @@ SUBSYSTEM!="rpmsg", GOTO="qcom_rpmsg_end" # symlink rpmsg endpoints under useful names-ATTR{name}=="DATA5_CNTL", SYMLINK+="modem"+ATTR{rpmsg_name}=="DATA5_CNTL", SYMLINK+="modem" # open SMD channels when the remoteproc comes up KERNEL!="rpmsg_ctrl[0-9]*", GOTO="qcom_rpmsg_end"
Need to document "how this works". :) I will dig into this a bit since I'll need to know how linux/ofono works with firmware eventually for implementing a layer above osmocom-bb layer1/2/3.
I have tried building from git checkouts of a year ago and around Jan 6 2019 but all so far have failed to boot. :( Will try some more of that soon I hope.
Just got a Jan 3 2019 build to build but when I flashed I got the same error I was getting before during boot which prevents a full boot.
[640] use_signed_kernel=0, is_unlocked=1, is_tampered=1.[640] Loading boot image (5765120): start[850] Loading boot image (5765120): done[850] ERROR: Appended Device Tree Blob not found[850] ERROR: Could not do normal boot. Reverting to fastboot mode.
I wonder if there is some problem with the way I am building these old commits that is breaking device tree blob appending?