Sending sms with 3g/4g base Hat

I have a 3g/4g base Hat with a EC25 Mini installed in a Raspberry 4 with Rasbian (buster). Works fine but how can I send an SMS?

Found these python scripts:

but they don’t work or give any error. Just hang in “Sending SMS to …”.


How did you run the script? Could you please share the output/log when you run it?


Like this:

 (venv) **pi@raspberrypi** : **~/experiments/new_tests/bots $** sudo python ttyUSB3 +351917168525 "Hello World!"
 Sending SMS to +351917168525

There is no error. It just does nothing.

@saeed ,

I have a slightly different issue with the script. I’m getting the obvious error that ttyUSB3 is in use/busy. so, how do you overcome this situation?

pi@raspberrypi:~/sixfab-GSM-GPRS $ python ./ ttyUSB3 +1xxxxxxxxxx "Hello there"
Traceback (most recent call last):
  File "./", line 14, in <module>
    ser = serial.Serial(SERIAL_PORT,SERIAL_RATE)
  File "/usr/lib/python2.7/dist-packages/serial/", line 240, in __init__
  File "/usr/lib/python2.7/dist-packages/serial/", line 268, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 16] could not open port /dev/ttyUSB3: [Errno 16] Device or resource busy: '/dev/ttyUSB3'

quick update. i stopped the reconnect service, and the sms seems to be sent, and i see the number of sent sms increasing on the operator portal, but it is never reaching the destination.


The SIM has a non-geo MSISDN associated which are basically non routable to oustide the MNO network. i was able to send an SMS to the same network.