babca / python-gsmmodem

Maintained fork of a Python module to control GSM modems attached to the system: send/receive SMS messages in your scripts, handle calls, and more.
GNU Lesser General Public License v3.0
174 stars 106 forks source link

How to send in HEX format? #78

Open therawk opened 5 years ago

therawk commented 5 years ago

My GSM Modem doesn't support UCS-2 but HEX. I have been using a C# app, converted it to PDU and then sent used AT commands to send SMS through serial port.

This library seems more reliable but I can't seem to get this working with HEX. When I try to send like emojis the application dies.

I guess I was close but this library always tries to encode the messages as UCS-2

Am I missing something here?

tomchy commented 3 years ago

Hi @therawk ! If you look at the pdu.py (e.g. lines 299-307), you will see that only two modes are used and that the HEX format is not listed there, so it is likely that it will not even set the input mode of the modem properly.

Since you were using the third format - do you have some code/samples/tests to include into the library?