Author |
Post |
|
#1 Mon Mar 08, 2010 05:06, 181 months ago.
|
Member
Registered: Mar 2010
Location: depok, Indonesia
|
Operating system name and version: WinXP SP2 Version of smsd: 3.1.6 Smsd installed from: sources Name and model of a modem / phone: SE M600i Interface: USB how to run some ATcmd like AT+CUSD=1,"*111*1#",0; not in config file or cmdLine? but in external application program (with java, php, or others). Is there an API ? thanks, -alfin- « Last edit by alfinsi on Mon Mar 08, 2010 05:09, 181 months ago. »
|
|
#2 Mon Mar 08, 2010 12:21, 181 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
There is a setting regular_run = filename. This external script or program can use the modem as it's closed by smsd when the script is called. Use the setting regular_run_interval to define number of seconds between each run. By default the interval is 300 seconds.
If you need that the smsd will send your commands to the modem, you can use the following settings for a modem:
regular_run_interval = 60 regular_run_cmdfile = /var/spool/sms/regular_run_cmdfile regular_run_statfile = /var/spool/sms/regular_run_statfile regular_run_logfile = /var/log/smsd_GSM1_regular_run.log
Once per minute smsd will check if the regular_run_cmdfile exists. When it exists, all lines from it are sent to the modem, one line at a time. Empty lines and lines starting with # are ignored. Output of each command is stored to the regular_run_statfile and to the smsd_GSM1_regular_run.log. Statfile stays available until next run, in this case one minute.
|
|
#3 Tue Mar 09, 2010 02:14, 181 months ago.
|
Member
Registered: Mar 2010
Location: depok, Indonesia
Topic owner
|
thanks, very quick reply  I want to run my script of ATcmd not in periodic with some interval, but when needed. For example when even button click. what i have to do ?
|
|
#4 Tue Mar 09, 2010 08:33, 181 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
Use that second choice:
regular_run_interval = 60 regular_run_cmdfile = /var/spool/sms/regular_run_cmdfile regular_run_statfile = /var/spool/sms/regular_run_statfile regular_run_logfile = /var/log/smsd_GSM1_regular_run.log
To get a faster response in the UI, the setting regular_run_interval might be much lower, for example 5 seconds or even one second. This also causes that regular_run_statfile does exists only a few seconds, because it's removed when a new run is started (even with no more AT commands to send).
Your "event button" might do the following: - Check if regular_run_cmdfile exists. If it does, wait until it's gone away. - Read the last line from the smsd_GSM1_regular_run.log file. - Create a regular_run_cmdfile with your AT commands. - Periodically check the last line from the log. When it's changed, it contains the answer to your AT command.
Could this work with your application?
|
|
#5 Wed Mar 10, 2010 17:28, 181 months ago.
|
Member
Registered: Mar 2010
Location: depok, Indonesia
Topic owner
|
yesss... thanks a lot keke, u r brilliant 
|