SMS sender in Lazarus (via GSM connected via USB) lazarus / 34-Windows ---------------------------------------------------------------------- skaner1900 · 2011-12-17 16:39 Hi! How send SMS from my mobile phone, connected to PC by USB, through application wrote in Lazarus ? ! I must create something like Microsoft SMS Sender. Help me! Please! ---------------------------------------------------------------------- felipemdc · 2011-12-17 16:58 Is this for Windows CE? Which version? For which phone? Do you already have any links about how this could be done in C or C++? WinCE programming tips wiki doesnt seam to have yet anything about this: http://wiki.lazarus.freepascal.org/WinCE_Programming_Tips ---------------------------------------------------------------------- ludob · 2011-12-17 17:15 TurboPower AsyncPro has a GSM component for Delphi with components for sending and reading SMS messages. AFAIK it hasn't been ported to lazarus yet. You could use synaser from the synapse library for the com port part. ---------------------------------------------------------------------- felipemdc · 2011-12-17 17:21 Aha ... so it is desktop Windows then ... I'll move to the appropriate subforum. ---------------------------------------------------------------------- avra · 2011-12-19 14:17 Your easiest path would be to connect some old Nokia phone via data cable to RS232 or via RS232<=>USB cable and send AT commands to the phone. It's very simple, and you can read about it here: http://www.developer.nokia.com/Community/Wiki/Using_AT_commands_to_sen d_and_read_SMS After hardware is connected properly, you can make a working SMS demo in an hour. Using smart phones (especially if you want it to be universal and work on most of the smartphone platforms) really complicates things a looooot and requests far more knowledge and work. ---------------------------------------------------------------------- fredycc · 2011-12-19 15:08 Quote from: avra on December 19, 2011, 03:17:32 pmYour easiest path would be to connect some old Nokia phone via data cable to RS232 or via RS232<=>USB cable and send AT commands to the phone. It's very simple, and you can read about it here: http://www.developer.nokia.com/Community/Wiki/Using_AT_commands_to_sen d_and_read_SMS After hardware is connected properly, you can make a working SMS demo in an hour. ... Yes, Is like avra said, In Lazarus I use Synapse to works with a GSM modem: download here: http://synapse.ararat.cz/doku.php/download, there are two ways for send a SMS; PDU and Text Mode, Text Mode is easy implement with AT commands, for example: Quote var   gsm:TBlockSerial;   GSMaddress : String; ...   GSMaddress := <>;   gsm:=tblockserial.Create;   gsm.config(460800,8,'N',1,false,true);   <-- Config modem values   Try      gsm.Connect(Edit1.Text);                   <-- COM Port      gsm.ATCommand('AT+CMGF=1');        <-- Text Mode      gsm.SendString('AT+CMGS="' + GSMaddress + '"'+ #$0D);      sleep(100);      gsm.SendString(Memo2.Text + #$1A);  <-- Send SMS      memo1.lines.Add('SMS sended!');      sleep(100);      gsm.CloseSocket;      gsm.Free;   except     on E : Exception do begin       gsm.free;       memo1.lines.Add(UTF8Encode(E.Message));     end;   end; PDU Mode: Quote  gsm:=tblockserial.Create;   gsm.config(460800,8,'N',1,false,true);   gsm.Connect(Edit1.Text);                    <-- COM Port   gsm.ATCommand('AT+CMGF=0');        <-- PDU format   gsm.ATCommand('AT+CMGS=25');   sleep(100);   gsm.SendString('0821134901001014F011000C9124543130857300000B0CC57362 D56C2E53072BF50D' +   #$1A);   sleep(100);   gsm.CloseSocket; http://www.developershome.com/sms/operatingMode.asp http://www.dreamfabric.com/sms/ Just check the name of COM Port where modem is detected. Regards ---------------------------------------------------------------------- avra · 2011-12-20 07:26 Quote from: fredycc on December 19, 2011, 04:08:43 pm...there are two ways for send a SMS; PDU and Text Mode, Text Mode is easy implement with AT commands... Yes, that's why I said to use old Nokia instead of an old Siemens GSM phone  That's a DIY recommended cheap approach with an old recycled phone. If you need it in a commercial project, you will probably want to buy a new GSM modem. ---------------------------------------------------------------------- padiazg · 2012-04-13 14:29 I'm working in something that uses this feature, in a couple of days I can post an example of how I handle this.