• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 
March 29, 2024, 06:26:37 am

News:

SMF - Just Installed!


Confirm doens't work

Started by henry64, August 14, 2010, 01:29:59 pm

Previous topic - Next topic

henry64

The "confirm" option on nrgsm doesn't work.

Using this code, D2009 and the wavecom.

procedure TGSMForm.SendMessageBtnClick(Sender: TObject);
var
  aPDU : TnrPduSms;
begin
  rapstr := '';
  if GSMOpen then
  try
//    nrGsm.SmsSend(PhoneTE.Text, MessageTE.Text, False );
    aPDU := TnrPduSms.Create(False);
    aPDU.Phone := PhoneTE.Text;
    aPDU.Coding := pc7bit;
    aPDU.Confirm := True;
    aPDU.AutoCutText := True;
    aPDU.DateTime := Now;
    aPDU.Text := MessageTE.Text;
    nrGsm.SmsSend(aPDU);
    nrGsm.SmsSendWait;
    aPDU.Free;
  except on e:exception do
     begin
       ShowMessage(format('ScanAndSMS GSM %s',[ e.message]));
     end;
  end;
end;

I'm also unable to compile the GSMDemo source
procedure TForm1.Button6Click(Sender: TObject);
begin
  nrGSM1.MemoryRead :=  eMem.Text;
  nrGSM1.SmsList(False, TSmsStatus(cbStatus.ItemIndex)); <<--- gives an error too many parameters
end;

Both the source and the compiled version of GSMDemo is not available on you page
http://nrcommlib.com/nrcomm/tnrgsm.html
http://nrcommlib.com/nrcomm/GSMDemoExe.zip
http://nrcommlib.com/nrcomm/GSMDemo.zip
The webpage cannot be found  HTTP 404


If I disable "confirm" and send a SMS adding *0# in front of the text message, then I receive and "SMS" (not a report) where I can see that the SMS has been delivered!!
When I enable "confirm" it sounds like there is actually sent something back to the GSM device - but the SMS recieved event is not being fired.

Roman Novgorodov

Hello

Thank you for your information.

You can find correct link on main library page:

http://www.deepsoftware.com/nrcomm/
http://www.nrcommlib.com/nrcomm/

The correct direct links are following:

http://nrcommlib.com/nrcomm/gsmdemo.zip

Also you can find all demo sources in Demo subfolder of nrComm Lib home directory on your hard disk after instalaltion trial version of product.

Please show me diagnostic LOG file for your device.

More info you can find here:
http://forums.nrcommlib.com/index.php?topic=6.0

Roman Novgorodov
DeepSoftware.Com


DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

henry64

I have a licens, not using trial version!

Logs and a screendump attached


Roman Novgorodov

Hello

I have checked GSMDemo from Demos folder of nrComm Lib.
Delphi 2009 compiles following line without any problem:

nrGSM1.SmsList(False, TSmsStatus(cbStatus.ItemIndex)); <<--- no any errors!!!!!!

What version do you use? Possible outdated version of nrComm Lib is still visible for your Delphi?
Please check visible folder in Delphi 2009 options and your project options.

Roman Novgorodov
DeepSoftware.Com

DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

henry64

I have reinstalled 9.08 again (and deleted all files). The demo compiles correct now.

Stil have no confirm

Attached is a new log file

henry64

Do you need more information to solve this issue?  :)

Roman Novgorodov

Hello

Please try demo from attachment.
Let me know result with log file.

Roman Novgorodov
DeepSoftware.Com
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

henry64


Roman Novgorodov

Hello

Thank you for information.
We will release new nrComm Lib on this week.

Roman Novgorodov
DeepSoftware.Com
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

henry64

It seems that the fix wasn't implemented in the 9.09 release.

The gsmdemo to sent me, works, but the gsmdemo in the 9.09 release doesn't. And my applications doesn't work wither with the confirm. No report is recieved in the receivessms event.




Roman Novgorodov

Hello

Hmmm .... it is strange ...
Please compile your GSMDemo and upload here (ZIP). We will check its binary resources.

Also you show me screenshot with exception. Does exception appear always (stable) after receive confirm report?

Roman Novgorodov
DeepSoftware.Com
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

henry64

Okay, here my binary

The SNAG-0007.jps shows the "confirm" SMS which raises an exception

henry64

I have uninstalled, deleted nrCommLib directory directory, and reinstalled 9.09.

I have compiled and tested the GSMDemo and it works when using nrGsm.NewSmsMode := nsmSkipSave; when using nsmRead or nsmNotifyOnly it fails with the exception I have showed you.

What about the idsms - why it that always zero?

From the receivedSMS  event
20-08-2010 16:25:34 [SMS/GSM event     ] SMS Sent 4520102200 Test SMS idsms: 0
20-08-2010 16:25:37 [Printing          ] Printscan started
20-08-2010 16:25:37 [Printing          ] Printscan done
20-08-2010 16:25:45 [SMS/GSM event     ] SMS Report 4520102200 REPORT: Sms is Delivered to 4520102200 at 20-08-2010 16:25:34 idsms: 0

From the log file
[20-08-2010 16:25:30] nrGsm: send:0031000A9154020122000008AA10005400650073007400200053004D0053\1Ah
[20-08-2010 16:25:34] nrGsm: Sms Sent Notify:  155
[20-08-2010 16:25:34] nrGsm: 0031000A9154020122000008AA10005400650073007400200053004D0053\1Ah
[20-08-2010 16:25:34] nrGsm: OK Returned !!!  155\0Dh\0Ah\0Dh\0AhOK\0Dh\0Ah
[20-08-2010 16:25:34] nrGsm: Queue finished
[20-08-2010 16:25:42] nrGsm: Sms Direct Notify:  24\0Dh\0Ah00069B0A915402012200018002615243800180026152838000\0Dh
[20-08-2010 16:25:45] nrGsm: cmd: AT+CPMS=<q><SMSrmem><q><cr>

It





Roman Novgorodov

Hello

After success send sms you get reply

nrGsm: Sms Sent Notify:  155

155 is ID of submitted sms.

Then you received status report

[20-08-2010 16:25:42] nrGsm: Sms Direct Notify:  24\0Dh\0Ah00069B0A915402012200018002615243800180026152838000\0Dh

This report has RefId property (as PDU). Its value is 155.


Now about exception when report is stored into device memory and component read it from memory by index.

[19-08-2010 21:50:44] nrGsm: Sms Notify:  "SR",5 mem: SR, id: 5
...
[19-08-2010 21:50:45] nrGsm: OK Returned !!! \0Dh\0Ah+CMGR: 1,,24\0Dh\0Ah000000FF0006880A9154020122000180911205838001809112\0Dh\0Ah\0Dh\0AhOK\0Dh\0Ah


It is strange problem. Your device adds unexpected header to PDU form of report: '000000FF'
Without these strange chars '00068...' report can be decoded correctly.
We will investigate more and possible think up something useful for resolve this trouble.

Roman Novgorodov
DeepSoftware.Com
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

henry64

Thanks for your reply.

The ID 155 is not available in any nrGSM events as far as I have seen.
21-08-2010 12:12:25 [SMS/GSM event     ] SMS Sent 4520102200 Test SMS idsms: 0, 021-08-2010 12:12:30 [SMS/GSM event     ] SMS started
21-08-2010 12:12:30 [SMS/GSM event     ] SMS done
21-08-2010 12:12:33 [SMS/GSM event     ] SMS Report 4520102200 REPORT: Sms is Delivered to 4520102200 at 21-08-2010 12:12:25 idsms: 0, 0, 0

procedure TGSMForm.nrGsmSmsReceived(Sender: TObject; aMem: string;
  idSms: Integer; aSms: TnrPduSms);
var
  msg : string;
begin
  //
  if not Assigned(aSms) then exit;

  if aSms.Report then
  begin
    msg := 'SMS Report %s %s idsms: %d, %d, %d';
    msg := format(msg,[asms.Phone, asms.ReportText, idsms, asms.Tag, asms.PID]);

  end else
    begin
      msg := 'SMS Recieved %s %s idsms: %d';
      msg := format(msg,[asms.Phone, asms.Text, idsms, asms.Tag, asms.PID]);
    end;
  LogError(lcSMSEvents, msg);

  with SetupRec, MainData do
  try
    if EnableSMSAckAcustic then
    begin
{ TODO 2 -oHEN -cNext version : Check if responder is allowed to silence alarm acustic signaling and if respons is correct }
      if SameText(aSms.Text, 'ok') then
        PostMessage(TForm(Owner).Handle, WM_SMS_ACTION, 1, 0);
    end;
  finally
    nrGsm.SmsDelete(idSms);
  end;
end;

procedure TGSMForm.nrGsmSmsSent(Sender: TObject; aMem: string; idSms: Integer;
  aSms: TnrPduSms);
var
  msg : string;
begin
  if aSms.Report then
  begin
    msg := 'SMS Report %s %s idsms: %d, %d';
    msg := format(msg,[asms.Phone, asms.ReportText, idsms, asms.Tag]);
  end else
      begin
        msg := 'SMS Sent %s %s idsms: %d, %d';
        msg := format(msg,[asms.Phone, asms.Text, idsms, asms.Tag]);
      end;
  LogError(lcSMSEvents, msg);
  ProgramErrors := ProgramErrors - [peGSMError];
end;