Is there some mechanism to subscribe to unsolicited modem responses?

SDK 2.0.0, nrf9160, modem fw 1.3.2

We are effectively running the GNSS sample and the MQTT sample in separate threads.  We are interested in seeing the modem temperature (via AT%XTEMP=1 command).  This command seems to enable periodic notifications of the form %XTEMP: N,M

Is there a way for one of my threads to register a "callback" that is executed when the %XTEMP string is received from the modem and delivers that %XTEMP: N,M to me?

We saw the nrf_modem_at_cmd_filter_set, but that looks like it is intercepting commands going to the modem rather than processing responses from the modem.

Thank you.

  • I would love to see what you find.  We did send  AT%XTIME=1 and did get one single response from that.  I would expect that it would get this at some infrequent rate as well -- or maybe each time the LTE network connects at a minimum.  Still nothing with AT%XTEMP=1.

    If we were to poll the battery and temperature, what is a reasonable rate to do this without interfering with performance?  Is that too often if I send a %TEMP every minute?  Clearly, under normal circumstances, the temperature would not move quickly.  2 minutes?  Thirty seconds?  5 minutes?  I would like to have a relatively current reading to report whenever the client application requests it but don't want to unnecessarily choke the modem pipe.

    Thank you.

  • The modem should send notifications also if the modem stays in RRC connected mode for more than 60 seconds, so if you can find a way for it to stay connected that long then you should receive a notification.

    You can also try setting XTEMPHIGHLVL, to change the level at which the temperature sensor triggers. Also this might require RRC connected, the documentation wasn't very clear about this. I tested this with RRC idle and didn't receive anything, but it's worth trying. You can just use the mqtt simple application and continuously publish data to stay in RRC connected. Or try something like this.

    Richard W Mincher said:
    I would like to have a relatively current reading to report whenever the client application requests it but don't want to unnecessarily choke the modem pipe.

    I doubt you would be able to choke the modem by sending XTEMP repeatedly, unless you send REALLY frequently. Once every five seconds or something like that should be fine I believe.

Related