ModemManager and modem low power with USB/QMI

Robert Colvin punk.spot9096 at skrapost.net
Mon Mar 13 13:18:14 UTC 2023


Hi!

this is a really fascinating question that has had me thinking a lot all weekend - it covers a lot of modem functionality which is an interest of mine, and I see Aleksander was hoping someone might be able to jump in on that front (which I might!) but i must be honest - I am not 100% sure of what goal Modem Modem has for these cases and it's really actually quite complex to set a boundary (yes, I have another thread that is a branch on this topic!) - it's a design choice

My assumption thus far has been that, as part of the FreeDesktop project, MM and NM are aimed more at desktop users where low power and such issues are not of primary concern. If power management is of major concern, then MM and NM might not be the best tool. A good example of this is PSM - only the application designer is really going to know what the best setup is for their use case. MM might be able to configure the modem, set the timers up etc; but the application will need to manage the actual data transfer in and around the power windows... (sorry, I know i am speaking on behalf of the developers, of which I have no idea of their intention...)

>From the Power Management Application Note: "It should be noted that when the module enters into sleep mode, the module will work in DRX mode. " - but as Alexsander points out, in stopping MM you are probably actually disconnecting from the network completely, so even DRX won't help here... now, instead if you were to use the inbuilt TCP stack, you could keep a connection to the network tower and in DRX when you wake you can get the queued data (or if possible you could get a URC when then network has data)

Generally speaking when I work with power management I avoid systems like NM as they introduce too much overhead and for low power I want everything to be as lean as possible (though I get we maybe have different use cases) - but again, for me, this is fascinating as to what use cases Network Manager intends to solve, and what it sees as out of scope

-- 
  Robert Colvin
  punk.spot9096 at skrapost.net

On Wed, Mar 1, 2023, at 10:59 AM, Aleksander Morgado wrote:
> Hey,
>
>> I'm using Quectel EC21EUX modem, connected with USB, and QMI to control it via ModemManager.
>> 
>> I have a question about going to sleep with a TCP connection kept so the device can wake up.
>> 
>> I have configured the modem to go to low power mode whenever there is no traffic (AT+QSCLK=1, AT+QURCCFG="urcport","usbat", setting DTR and AP_READY pins).
>> 
>> With this configuration, LTE modem should wake up when there is an incoming data packet.
>> The easiest way for me put modem to sleep was to stop ModemManager. Now, if I disable ModemManager, and then try to send a network packet from backend to the device, the modem never wakes up. My guess is that when I stop ModemManager, the TCP connection is lost, and this is why modem cannot wake up as it doesn't get the message from backend.
>
> The default behavior when you stop ModemManager cleanly is to stop 
> connections and disable modem, so yeah, not ideal for what you're 
> attempting to do.
>
>> My preferred way to sleep modem is to disable USB_VBUS.
>> 
>
> Wouldn't that take the modem out of the USB bus as well?
>
>> On the ModemManager side, what should I do to maintain the TCP connection when putting the modem to sleep, so it can wake up when getting a message over network?
>> 
>
> It really depends on how you're making the modem sleep, how it is 
> exposed in the system during that time, how you expect it to wake up, 
> and what is the state of the host during all that. E.g. I don't think 
> it's possible maintaining a TCP session alive between the host and a 
> remote server while the host is awake and the modem is no longer 
> exposed in the system, unless it's your modem itself the one making the 
> effort of maintaining that TCP session alive somehow. And as said it 
> also depends on the state of the host; if you're expecting both the 
> host and modem to be awaken by an incoming packet in the TCP session, 
> absolutely no idea how you're supposed to do that if the host (one of 
> the endpoints of the TCP session) is already asleep. I'm also not sure 
> how the modem in sleep mode can still receive packets from the network; 
> I guess it's not a full sleep in the radio stack? Please note, I don't 
> know much about AT+QSCLK or how Quectel does all this :) I was hoping 
> someone else would jump in this thread to reply!
>
> Cheers
>
> -- 
> Aleksander
>
> Attachments:
> * OpenPGP_0xAECE0239C6606AD5.asc
> * OpenPGP_signature


More information about the ModemManager-devel mailing list