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.

Parents
  • Hello,

    I believe the AT monitor library is the closest thing to what you are asking for. It should be pretty straight forward to use it for XTEMP, as far as I can tell.

  • The documentation seems to imply that the reporting frequency is approximately 60 seconds and that it may report more frequently if it gets closer to a critical threshold.  I find it hard to believe that it 1) doesn't give an initial report when it is turned on, and 2) it never reports unless it changes severely.  I can believe that the update frequency is dependent on the proximity to a critical threshold.  I can try hitting it lightly with a heat gun or some freeze spray, but I would have expected in the minutes that I waited for a report that I received nothing.

    Are there periodic reports (other than +CEREG and %CESQ) that I can see?  I would have expected that by setting the filter to ANY (NULL) I would see other things that other system components were watching.

    Thanks.

  • Richard W Mincher said:
    Are there periodic reports (other than +CEREG and %CESQ) that I can see?  I would have expected that by setting the filter to ANY (NULL) I would see other things that other system components were watching.

    Have you enabled any other notifications? The modem won't send notifications unless you subscribe. That includes the AT%XTEMP=1 to subscribe to temperature notifications.

    I don't have access to equipment until Wednesday, but if you wait I can try to test this myself.

  • 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.

Reply
  • 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.

Children
  • 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