I have recently configured my home FreeBSD server as SMS gateway using Huawei E220 USB modem.
FreeBSD has built in support for this device, just add
to your /boot/loader.conf
and reboot or issue:
as root.
Here’s sample Python script to read SMS data. It uses pySerial.