tmobile / DevEdge-IoTDevKit-ZephyrRTOS

T-Mobile Zephyr OS is a fork of zephyrproject-rtos/zephyr that is shipped on the DevKit and used for contributing upstream.
Apache License 2.0
13 stars 5 forks source link

TYPE1SC does not receive SMS #236

Open Kucmasz opened 10 months ago

Kucmasz commented 10 months ago

I am trying to receive SMS on T-Mobile Dev Edge Devkit with muRata TYPE1SC modem but it seems not to receive them. I have set the log level for "+CMTI:" message to ERR in on_cmd_unsol_sms() and I am calling modem_context->recv_sms() periodically but none of them seems to work. Were SMS tested on this modem and is that possible that I have missed some configuration switch? Once I put the SIM card in my phone the messages come, so the SIM is operational and network works, but apparently not in the configuration with this particular modem. I would appreciate any advice how to deal with TYPE1SC in this matter.

Kucmasz commented 9 months ago

Apparently there are several issues:

  1. The driver tries to read all messages in binary mode so if there is any text message on SIM it fails.
  2. The driver returns strlen(sms->msg) as the sms length, which is not helpful for PDU mode and messages containing nullbytes.
  3. The driver tries to receive all messages and then copies one of them to inout parameter sms and deletes everything with AT+CMGD command, so the user is not even aware of the fact that there might have been more than one message received and read.
jtbaumann commented 9 months ago
  1. The “binary mode” reads PDUs; storage location does not impact the functionality of PDU mode (reference: 3GPP TS 27.005)
  2. The PDU is in hex, strlen is valid for reading the length of the hex string.
  3. "The driver tries to receive all messages [...] and deletes everything"; The driver deletes all PDUs associated with the message it returns. Generally it only deletes one message, however there is handling for concatenated SMS where one “single” message is actually composed of a number of separate SMS.

As for SMS being validated, it is validated working on this modem, however I’m curious of the SIM utilized here: the SIMs provided with DevEdge are CAT-M SIMs, I would not expect them to function in a standard cell phone, so I’m curious of the exact details of this test.