Sending SMS-messages from Dongle - G3/UMTS stick

Seasons greetings!
I’m trying to send some simple sms-text from my app. I don’t wan’t to use an sms-gateway, but i do have an umts-stick and a sim-card :slight_smile:

I connected to it using a serial-class. I found some AT-commands and managed to send a message!
I’m still a little bit troubled about the async or sync setting of the serial communications and handshaking properties. (xon, cts,…)
For the moment i’m using a series of push buttons to itinerate the proces.
I really would like to include the sending of the message in one function/method.
Anyone here already done this, and willing to share experience?

Hi Stefaan - and a belated Season’s Greetings to you too!

I haven’t used an UMTS-Stick, but I imagine it’s all a matter of getting to know the commands. Like you said, you’ve already used some simple button actions to make it work in a rudimentary way - which is great for proof of concept.

The hardest part of working with a serial interface is understanding how to work with the buffered data. If you want to build some functions and methods that handle the back and forth communications of using a serial port then you may want to consider skipping over the xon, cts stuff, it isn’t very helpful.

Do you have an example of a CMD you’d send to this device, and the anticipated response? I’d love to take a crack at helping if I can.

Best regards,

-Bill

I did that a couple of years ago using a Arduino with a GSM shield from Arduino - https://www.arduino.cc/en/Main/ArduinoGSMShield

I found out the hard way that doing serial communication directly with the GSM module was too hard since the module was not reliable to respond in time and had constant lock-ups while polling too quickly for new messages etc, etc.
I took an Arduino and connected to that over USB (emulating a serial port) and used the standard libraries available for SMS handling between the Arduino and the GSM. The computer polled the Arduino and all was well.

We have since then moved on and are solely using Twilio services for both inbound and outbound - no SIM:s to handle and no hardware. If your project allows it I’d go for that route. We are now using Arduino + Dragino Yun connected to WiFi and then Twilio to send the messages.

I already developed many solutions using GSM modems and the AT+ command via Serial.
Just this happened many years ago.

One suggestion I can give you is to download the specifications from ITU web site and follow accurately what they describe, expecially if you have to work with different hardware for the GSM. They are all different and you need to know the common minimum denominator for features.

Another suggestion is to write a serial subclass with a robust parser for the incoming data. Very often the data comes in chunks and sometimes you have to wait to get the full answer back. Again, checking the documentation will help you to determine what to expect back for every situation.