Moving SMS response to a usable address

I am using a Sierra Wireless HL7800 modem with the nrF52840.  I have been able to receive SMS messages and see them come through the RTT log.  Setting to text mode and then listing all incoming messages, I see the below output in the log.

rtt:~$ [00:00:05.668,609] <dbg> modem_hl7800: send_at_cmd: OUT: [AT+CMGL="ALL"]
00> rtt:~$ [00:00:05.880,706] <dbg> modem_hl7800: hl7800_rx: UNHANDLED RX
00> 2b 43 4d 47 4c 3a 20 31 2c 22 52 45 43 20 52 45 |+CMGL: 1 ,"REC RE
00> 41 44 22 2c 22 35 32 37 37 22 2c 2c 22 32 34 2f |AD","527 7",,"24/
00> 31 32 2f 30 36 2c 31 36 3a 30 38 3a 31 38 2d 33 |12/06,16 :08:18-3
00> 32 22 |2"
00> rtt:~$ rtt:~$ [00:00:05.882,232] <dbg> modem_hl7800: hl7800_rx: UNHANDLED RX
00> 21 74 74 74 70 75 63 6c 6f 63 6b 3a 31 36 30 30 |!tttpucl ock:1600

I clearly see the intended text "!tttpuclock:1600" message, but I need to know where that sms is stored or move that message from the SIM to a usable register that I can use to print the actual text.

From the AT Interface, it looks as if these are stored in "mem1" or "mem3", but I'm unclear how to access those locations,

Thanks,

Parents
  • Hi,

    Can you provide more information about your application?

    Can you provide more context to your question? How are modem and nrf52840 connected and what is the purpose of nrf52840 in your case? What do you try to achieve?

    Where did you get your RTT log from? Which action did you take when you got your log? What was your application doing?

    From the AT Interface, it looks as if these are stored in "mem1" or "mem3", but I'm unclear how to access those locations

    Can you provide a link to AT interface?

    Best regards,
    Dejan

  • Dejon,

    I am using a Pinnacle 100 from Ezurio. It has the HL7800 modem connected to UART1 on the nrf52840.  I have written the driver to send for this instance AT+CMGL which lists the received SMS messages.  You can see that I receive the actual text message expected both in hex and text, when I monitor in a JLink RTT Viewer. 

    I need to find out where I can pull that actual data that was received as a response to the AT+CMGL command (!tttpucl ock:1600) to move it to another memory location so I can compare the received message to a set of expected messages.

    Everything with the modem is working correctly, I just need to know where I can copy the actual received text from.  I know the data is there in index 1, just can't seem to get to it.

    Here is the AT Interface.  

     41111821 HL78xx AT Command Reference r23.pdf

  • Hi,

    It is difficult to give you some specific advice since you do not use our modem and SMS library. Is any of our components involved in storing SMS on the application side?

    Best regards,
    Dejan

  • Yes, the nrf52840 is getting the message.  When a SMS message comes in on UART1 of the nrf, where is it at?

  • Hi,

    You could potentially look at the HL7800 driver which determines where the incomming messages are stored. It seems that HL7800 uses Zephyr modem driver. There seems to be an unhandled Rx event in the code which prints the content of the message. You would need to look in the code where this is printed, handle event properly and copy the content to your desired location. You would need to check if driver supports what you try to do and possibly extend the driver to support unsupported feature.

    Best regards,
    Dejan

Reply
  • Hi,

    You could potentially look at the HL7800 driver which determines where the incomming messages are stored. It seems that HL7800 uses Zephyr modem driver. There seems to be an unhandled Rx event in the code which prints the content of the message. You would need to look in the code where this is printed, handle event properly and copy the content to your desired location. You would need to check if driver supports what you try to do and possibly extend the driver to support unsupported feature.

    Best regards,
    Dejan

Children
  • Thanks Dejan,  I will try to find that.  I did find a case on the forum Case ID: 246543 where someone is try to do something similar, just with a different AT+Command using a get_response() function.  I stands to reason that this has been done before.  If the nrf is processing the command to, and getting the response from the modem, the data is already there somewhere.

    Stephen

  • Hi Stephen,

    Please let me know if you have any further questions.

    Best regards,
    Dejan

  • I created a handler in the hl7800.c driver, but I need to parse the SMS.  Any tutorials or samples you know of how to to do that?

    static bool on_cmd_received_sms(struct net_buf **buf, uint16_t len)
    {
            size_t out_len;
            char value[MDM_MAX_RESP_SIZE];

            out_len = net_buf_linearize(value, sizeof(value), *buf, 0, len);
            value[out_len] = 0;

            if (strlen(value) < sizeof("#,###################")) {
                /* String size too short */
                return true;
            }

            memcpy(ictx.mdm_received_msg,
               &value[MDM_MESSAGE_INDEX_1], MDM_HL7800_SMS_MAX_STR_SIZE);
            event_handler(HL7800_EVENT_READ_MESSAGE, ictx.mdm_received_msg);

            LOG_INF("SMS: %s", ictx.mdm_received_msg);
            LOG_INF("SMS Value: %s", value);
            return true;
    }

    Once I parse that massage, where do I point to in my main.c to get it?  This zephyr is so convoluted.  

  • Hi,

    Although you do not use our modem, you might still want to look at our SMS library. Relevant parser files can be found on github in the SMS library. For tutorials and samples related to the use of your particular modem and specifics of the modem implementation, you could try to ask in the Sierra Wireless Forum.

    Best regards,
    Dejan

Related