0
\$\begingroup\$

I'm experimenting a bit with a SIM900 module and a Raspberry Pi. I can communicate with it and receive/send SMS messages. However, there's a problem when a message that exceeds the 160 character limit is sent.

When a message, longer than 160 characters, is sent it's actually sent as separate messages under the hood. And then the receiving device needs to glue them together again. I've got that part working, but I can't always glue them together in the correct order.

And that's because each message has a timestamp that's only accurate up to seconds.

Is there a way to get more accurate timestamps with milliseconds? I've been looking at the datasheet but haven't really found a way.

Image

\$\endgroup\$
  • \$\begingroup\$ You might want to scrub your phone number from that image ... \$\endgroup\$ – brhans Sep 27 '16 at 11:17
  • \$\begingroup\$ @brhans: Thx, removed it! \$\endgroup\$ – wouterds Sep 27 '16 at 11:20
  • 3
    \$\begingroup\$ The PDU contains some more information in the binary part,you have to look up how its structured and then extract it \$\endgroup\$ – PlasmaHH Sep 27 '16 at 11:23
  • \$\begingroup\$ What serial terminal is that? I like the colors.. :-D \$\endgroup\$ – m.Alin Sep 27 '16 at 11:28
  • 1
    \$\begingroup\$ @m.Alin: It's just a nodejs script using node-serialport & colors.js. \$\endgroup\$ – wouterds Sep 27 '16 at 12:22
3
\$\begingroup\$

As @PlasmaHH suggested, changing the text mode to PDU mode (using AT+CMGF=0) did give me some more information. The parsed PDU string now contains a property udh which has some more information about the message. If it's a message consisting out of multiple messages it will tell me how many parts there are and what part this message is of the total message.

udh: {
    length: '05',
    iei: '00',
    reference_number: '4E',
    parts: 3,
    current_part: 1
}
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.