<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Blog.js.gripe</title>
        <link>https://blog.js.gripe/en/</link>
        <description>Notes on technical practice, web services, writing, and observation.</description>
        <lastBuildDate>Sat, 02 May 2026 13:10:27 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en</language>
        <copyright>2026 Blog.js.gripe</copyright>
        <item>
            <title><![CDATA[Fixing SMS Reception on RM502Q-AE with OpenWrt QModem: IMS, 5G SA, and SMS Bearer Settings]]></title>
            <link>https://blog.js.gripe/en/posts/rm502q-ae-openwrt-qmodem-sms-ims-fix/</link>
            <guid>https://blog.js.gripe/en/posts/rm502q-ae-openwrt-qmodem-sms-ims-fix/</guid>
            <pubDate>Wed, 29 Apr 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[A real troubleshooting note: QModem showed no incoming SMS, and the root cause was IMS being disabled while the RM502Q-AE was registered on China Mobile NR5G SA. Enabling IMS and rebooting restored SMS reception.]]></description>
            <content:encoded><![CDATA[<p>This is a real troubleshooting note from an OpenWrt setup using QModem to manage a Quectel RM502Q-AE. QModem could not show any incoming SMS. The final cause was not the web page, not a full SMS store, and not a wrong ME/SM selection. The modem was registered on China Mobile NR5G SA with IMS disabled. After enabling IMS and rebooting the modem, SMS reception recovered.</p>
<p>Identity-related values are redacted in this note. If CIMI/IMSI needs to be mentioned, it is written only as <code>46007************</code> or as redacted. Real SMS content is not included.</p>
<h2 id="1-background-and-symptoms" tabindex="-1">1. Background and Symptoms</h2>
<p>The setup was straightforward: OpenWrt, QModem, a Quectel RM502Q-AE, and the AT port at <code>/dev/mhi_DUN</code>. The modem reported:</p>
<pre><code class="language-text">ATI
Quectel
RM502Q-AE
Revision: RM502QAEAAR13A04M4G

AT+QGMR
RM502QAEAAR13A04M4G_01.203.01.203
</code></pre>
<p>The operator was China Mobile, and the modem had been camped on NR5G SA:</p>
<pre><code class="language-text">AT+QNWINFO
+QNWINFO: &quot;TDD NR5G&quot;,&quot;46000&quot;,&quot;NR5G BAND 79&quot;,721824
</code></pre>
<p><code>NR5G BAND 41</code> also appeared during troubleshooting. 5G SA registration eventually looked normal:</p>
<pre><code class="language-text">AT+C5GREG?
+C5GREG: 2,1,...,11,...

AT+C5GREG?
+C5GREG: 0,1
</code></pre>
<p>The visible symptom was simple: the QModem SMS page did not show any message. The API response had an empty <code>msg</code> array, while the reported storage capability looked valid:</p>
<pre><code class="language-json">{
  &quot;msg&quot;: [],
  &quot;result&quot;: {},
  &quot;sms_capabilities&quot;: {
    &quot;mem1&quot;: &quot;MT&quot;,
    &quot;mem2&quot;: &quot;MT&quot;,
    &quot;mem3&quot;: &quot;MT&quot;,
    &quot;ME&quot;: { &quot;used&quot;: &quot;0&quot;, &quot;total&quot;: &quot;127&quot; },
    &quot;SM&quot;: {}
  }
}
</code></pre>
<h2 id="2-first-verify-it-is-not-just-a-qmodem-page-issue" tabindex="-1">2. First, Verify It Is Not Just a QModem Page Issue</h2>
<p>The first useful step was to check whether messages had reached any modem-readable SMS store. <code>ME</code>, <code>MT</code>, <code>SM</code>, and <code>SR</code> were all empty:</p>
<pre><code class="language-text">AT+CPMS=&quot;ME&quot;,&quot;ME&quot;,&quot;ME&quot;
+CPMS: 0,127,0,127,0,127
OK

AT+CPMS=&quot;MT&quot;,&quot;MT&quot;,&quot;MT&quot;
+CPMS: 0,127,0,127,0,127
OK

AT+CPMS=&quot;SM&quot;,&quot;SM&quot;,&quot;SM&quot;
+CPMS: 0,50,0,50,0,50
OK

AT+CPMS=&quot;SR&quot;,&quot;SR&quot;,&quot;SR&quot;
+CPMS: 0,5,0,5,0,5
OK

AT+CMGL=4
OK
</code></pre>
<p><code>AT+CMGL=4</code> returned <code>OK</code> but no <code>+CMGL</code> rows. That detail matters. When <code>ME</code>, <code>MT</code>, <code>SM</code>, and <code>SR</code> are all empty, the problem is not that QModem read the wrong ME/SM store, and it is not a full store. The SMS had not entered modem-readable storage at all.</p>
<h2 id="3-a-common-cmgl-trap-in-pdu-mode" tabindex="-1">3. A Common CMGL Trap in PDU Mode</h2>
<p>Early in the session, this command returned an error:</p>
<pre><code class="language-text">AT+CMGL=&quot;ALL&quot;
ERROR
</code></pre>
<p>That can look like an SMS subsystem failure, but it was only a mode mismatch. The modem was in PDU mode:</p>
<pre><code class="language-text">AT+CMGF?
+CMGF: 0

AT+CMGL=?
+CMGL: (0-4)
</code></pre>
<p>In PDU mode, list all messages with:</p>
<pre><code class="language-text">AT+CMGL=4
</code></pre>
<p>not with:</p>
<pre><code class="language-text">AT+CMGL=&quot;ALL&quot;
</code></pre>
<p><code>AT+CMGL=&quot;ALL&quot;</code> is appropriate after switching to text mode with <code>AT+CMGF=1</code>. For verification codes, Chinese SMS, and Unicode payloads, PDU mode is usually the safer default, so this setup stayed with <code>AT+CMGF=0</code> and <code>AT+CMGL=4</code>.</p>
<h2 id="4-sms-storage-urc-and-notification-settings" tabindex="-1">4. SMS Storage, URC, and Notification Settings</h2>
<p>The following baseline SMS settings were checked or applied during troubleshooting:</p>
<pre><code class="language-text">AT+CMEE=2
AT+QURCCFG=&quot;urcport&quot;,&quot;all&quot;
AT+CSMS=1
AT+CMGF=0
AT+CPMS=&quot;MT&quot;,&quot;MT&quot;,&quot;MT&quot;
AT+CNMI=2,1,0,0,0
</code></pre>
<p>Their roles were:</p>
<ul>
<li><code>AT+QURCCFG=&quot;urcport&quot;,&quot;all&quot;</code>: emit URCs on all available AT ports, avoiding a mismatch between QModem’s port and the manually tested AT port.</li>
<li><code>AT+CPMS=&quot;MT&quot;,&quot;MT&quot;,&quot;MT&quot;</code>: use the modem’s combined SMS view so messages do not land in <code>ME</code> or <code>SM</code> while the reader watches the other one.</li>
<li><code>AT+CNMI=2,1,0,0,0</code>: after a new SMS is stored, notify the terminal with <code>+CMTI</code>.</li>
<li><code>AT+CMGF=0</code>: keep PDU mode, which is a better fit for verification codes, Chinese text, and Unicode content.</li>
</ul>
<p>If text mode is used instead, the matching commands are:</p>
<pre><code class="language-text">AT+CMGF=1
AT+CMGL=&quot;ALL&quot;
</code></pre>
<h2 id="5-5g-sa-was-registered-but-sms-still-did-not-reach-storage" tabindex="-1">5. 5G SA Was Registered, but SMS Still Did Not Reach Storage</h2>
<p>5G SA registration was normal, yet no SMS reached any storage. The SMS bearer preference then became interesting:</p>
<pre><code class="language-text">AT+CGSMS?
+CGSMS: 1
</code></pre>
<p><code>CGSMS=1</code> can be understood as preferring the traditional CS domain. That was not a good fit for this China Mobile NR5G SA case. It was changed to:</p>
<pre><code class="language-text">AT+CGSMS=2
OK
</code></pre>
<p><code>CGSMS=2</code> can be read as Packet domain preferred / PS preferred. This should not be treated as a universal rule: behavior can vary by operator, firmware, and registration state. For this NR5G SA case, though, continuing to prefer the traditional CS domain was not the right direction.</p>
<h2 id="6-the-key-finding-ims-was-disabled" tabindex="-1">6. The Key Finding: IMS Was Disabled</h2>
<p>The decisive check was IMS:</p>
<pre><code class="language-text">AT+QCFG=&quot;ims&quot;
+QCFG: &quot;ims&quot;,0,0
</code></pre>
<p>IMS was disabled. It was then enabled:</p>
<pre><code class="language-text">AT+QCFG=&quot;ims&quot;,1
OK
</code></pre>
<p>After rebooting the modem, SMS reception recovered. In this RM502Q-AE on China Mobile NR5G SA case, the critical fix was not clearing storage or changing how QModem read messages. It was enabling IMS.</p>
<h2 id="7-fix-steps" tabindex="-1">7. Fix Steps</h2>
<p>The core fix was:</p>
<pre><code class="language-text">AT+CMEE=2
AT+QCFG=&quot;ims&quot;,1
AT+CFUN=1,1
</code></pre>
<p>After the modem rebooted, these SMS settings were applied again:</p>
<pre><code class="language-text">AT+QURCCFG=&quot;urcport&quot;,&quot;all&quot;
AT+CGSMS=2
AT+CSMS=1
AT+CMGF=0
AT+CPMS=&quot;MT&quot;,&quot;MT&quot;,&quot;MT&quot;
AT+CNMI=2,1,0,0,0
</code></pre>
<p>The actual result in this case: after IMS was enabled and the modem rebooted, QModem could receive SMS.</p>
<h2 id="8-rollback-steps" tabindex="-1">8. Rollback Steps</h2>
<p>If enabling IMS causes registration, dial-up, or network issues, roll it back with:</p>
<pre><code class="language-text">AT+QCFG=&quot;ims&quot;,0
AT+CFUN=1,1
</code></pre>
<p>In this case, however, enabling IMS was the action that restored SMS reception, so the final recommendation is to keep:</p>
<pre><code class="language-text">AT+QCFG=&quot;ims&quot;,1
</code></pre>
<p>If the SMS bearer preference needs to be rolled back:</p>
<pre><code class="language-text">AT+CGSMS=1
</code></pre>
<p>That is not recommended as the final state for this NR5G SA case, because SMS was restored while using:</p>
<pre><code class="language-text">AT+CGSMS: 2
</code></pre>
<h2 id="9-suggested-qmodem-post-init-at-commands" tabindex="-1">9. Suggested QModem Post-Init AT Commands</h2>
<p>Add this block to QModem’s post-initialization AT commands:</p>
<pre><code class="language-text">AT+QCFG=&quot;ims&quot;,1
AT+QURCCFG=&quot;urcport&quot;,&quot;all&quot;
AT+CGSMS=2
AT+CSMS=1
AT+CMGF=0
AT+CPMS=&quot;MT&quot;,&quot;MT&quot;,&quot;MT&quot;
AT+CNMI=2,1,0,0,0
</code></pre>
<p>This does not depend on <code>AT&amp;W</code>. During the actual troubleshooting, <code>AT&amp;W</code> did not reliably return <code>OK</code>, and the OpenWrt/QModem workflow is better served by replaying critical initialization commands after startup. That keeps the SMS state predictable even if profile persistence is uncertain.</p>
<h2 id="10-follow-up-how-to-tell-whether-carrier-aggregation-is-active" tabindex="-1">10. Follow-Up: How to Tell Whether Carrier Aggregation Is Active</h2>
<p>After SMS recovered, carrier aggregation was checked:</p>
<pre><code class="language-text">AT+QCAINFO
+QCAINFO: &quot;PCC&quot;,721824,6,&quot;NR5G BAND 79&quot;,347

AT+QNWINFO
+QNWINFO: &quot;TDD NR5G&quot;,&quot;46000&quot;,&quot;NR5G BAND 79&quot;,721824

AT+QENG=&quot;servingcell&quot;
+QENG: &quot;servingcell&quot;,&quot;NOCONN&quot;,&quot;NR5G-SA&quot;,&quot;TDD&quot;,460,00,...,721824,79,...

AT+QCFG=&quot;lteca&quot;
ERROR
</code></pre>
<p><code>QCAINFO</code> showed only <code>PCC</code> and no <code>SCC</code>, so carrier aggregation was not active at the moment of that query. But <code>QENG=&quot;servingcell&quot;</code> showed <code>NOCONN</code>, meaning the modem was idle or not in a connected data state. That cannot prove the modem or network does not support CA.</p>
<p>The right way to check is to run a speed test or a large download, then repeatedly query:</p>
<pre><code class="language-text">AT+QCAINFO
AT+QENG=&quot;servingcell&quot;
</code></pre>
<p>If <code>SCC</code> appears, CA is being scheduled by the network. <code>AT+QCFG=&quot;lteca&quot;</code> returning <code>ERROR</code> only means this firmware does not support or expose that QCFG item. It does not mean CA is disabled.</p>
<p>For NR CA under NR5G SA, the result usually depends more on network scheduling, base station configuration, plan policy, signal quality, band combinations, and whether bands are locked. Do not write unknown AT commands blindly just to test CA, and do not disable the IMS setting that already fixed SMS reception.</p>
<h2 id="11-conclusion" tabindex="-1">11. Conclusion</h2>
<p>The conclusion from this case is clear:</p>
<ul>
<li>The SMS store was not full.</li>
<li>QModem was not merely reading the wrong <code>ME</code> or <code>SM</code> store.</li>
<li><code>ME</code>, <code>MT</code>, <code>SM</code>, and <code>SR</code> were all empty, so SMS had not entered modem-readable storage.</li>
<li>The modem was on China Mobile NR5G SA, and 5G registration was normal.</li>
<li>The key recovery action was enabling IMS with <code>AT+QCFG=&quot;ims&quot;,1</code>, then rebooting with <code>AT+CFUN=1,1</code>.</li>
<li>After reboot, SMS reception worked.</li>
<li>IMS should stay enabled, and the SMS-related settings should be fixed in QModem’s post-init AT commands.</li>
<li>For CA: <code>QCAINFO</code> showed only <code>PCC</code>, so CA was not active at that moment; <code>AT+QCFG=&quot;lteca&quot;</code> returning <code>ERROR</code> does not mean CA cannot work. The right check is to watch whether <code>SCC</code> appears in <code>QCAINFO</code> during heavy traffic.</li>
</ul>
]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blog.js.gripe is online]]></title>
            <link>https://blog.js.gripe/en/posts/welcome/</link>
            <guid>https://blog.js.gripe/en/posts/welcome/</guid>
            <pubDate>Mon, 27 Apr 2026 00:00:00 GMT</pubDate>
            <description><![CDATA[A quiet place for technical practice, web services, writing notes, and the trail left by solved problems.]]></description>
            <content:encoded><![CDATA[<p>Blog.js.gripe is online.</p>
<p>This is where I will keep notes on technical practice, web services, tools, troubleshooting, and the occasional observation that deserves a little more room than a passing remark.</p>
<p>The first post is a marker in the ground. Future entries will be grouped by category and tagged so related threads can be followed without losing the context around them.</p>
<p>The goal is simple: write things down clearly enough that the next problem starts a little closer to the answer.</p>
]]></content:encoded>
        </item>
    </channel>
</rss>