hyx0329 / openstick-failsafe-guard

a bunch of systemd services for MSM8916 devices running debian
20 stars 5 forks source link

About how to change sim without a reboot #4

Closed hyx0329 closed 1 year ago

hyx0329 commented 1 year ago

I discovered this looooong before. But I don't have the motivation to push an update. I'll just write here in case someone cannot find it on the internet(I mean it's on my "blog").

Here is the procedure:

echo 0 > /sys/class/leds/esim0_select/brightness  # disable current sim, change accordingly
echo 1 > /sys/class/leds/sim0_select/brightness   # enable the other sim, change accordingly
# reload kernel module so the modem is rebooted
modprobe -r qcom-q6v5-mss
modprobe qcom-q6v5-mss
# restart related services
systemctl restart rmtfs
systemctl restart ModemManager
# On some devices, the modem will crash intentionally.
# In this case, you need to restart the ModemManager manually. (BTW the startup diagnose do it for you, but only once after boot)
ttimasdf commented 1 year ago

esim0_select is the pin name defined in kernel device tree, but different from mine (running openstick kernel) which is sim:sel. Which kernel are you running? patch the kernel to set default_trigger=default_on may be a better solution?

hyx0329 commented 1 year ago

Hi @ttimasdf

Which kernel are you running?

I was using msm8916-mainline/linux with modified device tree. When I have those sticks, I found some naming issues in device trees in openstick's repo. I decompiled dtbs from original android firmware, and figured out the actual functions of those pins.

My kernel and code should in one of my firmware distribution package at baiduyun disk.

patch the kernel to set default_trigger=default_on may be a better solution

You are right. That makes one service optional. I think a better solution would be 1 driver + 2 gpio regulators, if anyone wants to contribute.

Anyway, I don't have any "pocket WiFi dongles" now. You can ask more by opening new issues.