1
votes

I am trying to create a text msg/sms gateway using a USB-HSDPA Modem from Huawei (E122-1). I have done this with an older Modem some time ago. After some troubles installing the driver and receiving the correct comPort of the new device I have finally established to communicate with the device.

comPort Check and PIN-Check are already done. Now I'm switching to textmode (CMGF) and write the message (CMGS):

comPort.Write("AT+CMGF=1\r\n");
Thread.Sleep(1000);
comPort.Write("AT+CMGS=\"" + "some tel no" + "\"" + Environment.NewLine);
comPort.Write("text content" + (char)26 + Environment.NewLine);
Thread.Sleep(2000);
response = comPort.ReadExisting();

everything works fine, i get proper responses and everything.

BUT, here is the problem: the sent text message can't be read on all mobile phones/smart phones:
- my old Nokia 6300 says 'unsupported message type'.
- HTC Desire shows an empty message.
- Samsung Galaxy S2 'content is not supported'.
- Samsung Galaxy S shows the message just fine.

Now here is the weird thing, if i use the application which comes with the modem (t-mobile austria internet manager) to send a text message, all of the listed devices can display it correctly.

am I missing something with the encoding or some kind of a header? (which the 't-mobile internet manager' apparently is using for correct displaying of the text message at the receiver side)

any suggestions or ideas?

thanks, Sise

2
You use Environment.NewLine in some locaions and '\r\n' in others I would start there. Are you able to snoop wach is sent using the application that comes with the modem by chance?Security Hound
lol that's correct, some of the code is copied from a coworker and i didn't really bother about the syntax. afaik the return/new line is for the serial communication only, just as pressing enter in a shell? currently i'm looking for the right tool to sniff the serial communication of the application which comes with the modem but didn't have luck to find a proper one so far. as soon as i get some logged data from there i will post it!Sise

2 Answers

0
votes

somehow, the receiver devices are expecting PDU format and not ascii. something like: http://www.dreamfabric.com/sms/

but the receiver device i'm requiring this method for is a gps-tracking box and it does understand ascii, so pdu is not required and the application is working fine.

thanks anyways! :)

0
votes