Author Topic: nrGSM custom AT cmds in OnAfterInit event doesn't works.  (Read 689 times)


  • Newbie
  • *
  • Posts: 3
    • View Profile
nrGSM custom AT cmds in OnAfterInit event doesn't works.
« on: April 26, 2015, 07:37:53 am »
I supposed that OnAfterInit was fired after everything else, and I supposed that it was the right place to start sending our own AT commands.

Whenever I send an AT command inside this OnAfterInit, the command will just wait until the timeout and return OK.
Even nrGsm1.PINGetStatus inside this event will return a false answer (always 'unknown' when it should be 'ready').

However, If I place everything inside a new procedure and I lunch it when I press a button after the afterInit is done, everything works perfectly. It doesn't wait for the timeout and the answers are correct.

Even adding a sleep or other things in the AfterInit is not helping. It's like the input buffer is not empty when this event triggers.

The only ugly way I found to make an automatic process (and not the need to manually press a button) is to start a timer inside the onAfterInit, so it will trigger my next procedure few seconds after the onAfterInit is complete.

Is their any better way to implement an automatic process with custom AT commands (I need to read the answers) after the initialisation ?

FYI: I am using Delphi XE7.

Thank you,
« Last Edit: April 27, 2015, 07:38:34 am by ronfak »

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 1006
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: nrGSM custom AT cmds in OnAfterInit event doesn't works.
« Reply #1 on: May 02, 2015, 06:16:34 pm »

Please post here a sample code.
I do not understand what methods do you call for send AT commands.

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