XBee3 4G - Phone number of most recent SMS message received

I feel like I’m missing something extremely simple, here.

I’m using an XBee3 4G to send and receive low level commands to a custom circuit board, which is essentially an Arduino running the TinyGSM library. It can send SMS messages using the P# command. No problems there. It can also receive texts using a stream read command: if there is data available, take it in.

For some reason it reads the SMS body well, but I can’t figure out how to get it to spit out the phone number that the SMS (or perhaps the last SMS received) is from.

I know there are a lot of variables here that make it hard for much debugging help, but google has led me to the same unanswered forum posts or info for other brand 4G boards.

For what it’s worth, it seems like switching to API mode 1 instead of 0 spits out both the sent phone number as well as the body. Now I just have to be clever about separating the two and parsing appropriately. And switching back to API mode 0 to send a text since the library I’m using to send requires that.

Why wouldn’t you just stay with the API mode? You can use API mode command 1F to send a SMS.

Simply due to the fact that the off-the-shelf library I snagged is set up to send SMS in API 0, as far as I can tell. But you’re absolutely right, and teaching myself all of this makes me want to just ditch that library and roll my own sending code.