Author |
Post |
|
#1 Wed Apr 14, 2010 13:11, 177 months ago.
|
Member
Registered: Apr 2010
Location: Portugal
|
Hello.
Instead of sending a command to the modem in a specific time interval, allow commands (like AT+CUSD=1,"*102#") to be sent whenever necessary/intended (example via smsd).
Regards, Carlos
|
|
#2 Wed Apr 14, 2010 20:42, 177 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
Carlos wrote Instead of sending a command to the modem in a specific time interval, allow commands (like AT+CUSD=1,"*102#") to be sent whenever necessary/intended (example via smsd).
You could define and use regular_run_cmdfile for this kind of operation. When you know that details of saldo are required, just create this file with AT+CUSD command and after a while you have the saldo logged. See also all regular_run* settings, they may be useful for you.
|
|
#3 Thu Apr 15, 2010 12:16, 177 months ago.
|
Member
Registered: Apr 2010
Location: Portugal
Topic owner
|
Hello Keke.
Currently I'm using the regular_run* settings. However, I think it could be interesting to run not on a regular basis interval, but on demand.
Best regards, Carlos
|
|
#4 Thu Apr 15, 2010 12:37, 177 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
Carlos wrote However, I think it could be interesting to run not on a regular basis interval, but on demand.
That's just what regular_run_cmdfile does. Interval must be used, because it defines how often regular_run_cmdfile is checked. This interval could be couple of seconds when commands are read from the regular_run_cmdfile. So, when a regular_run_cmdfile does not exist, nothing is done. And when your front-end application decides that details of saldo are required, it can create the regular_run_cmdfile and after couple of seconds smsd will do the job. After the job is done, regular_run_cmdfile is removed. Therefore a job is not repeated, your application should create this file again when it's required. Perhaps you have something that I have not understood? What kind of regular_run* setup you have currently?
|
|
#5 Fri Apr 16, 2010 09:38, 177 months ago.
|
Member
Registered: Apr 2010
Location: Portugal
Topic owner
|
Hello Keke.
I just configured regular_run* for "querying saldo. However, after the command is issue, both the result file as the command file are deleted (same problem has been reported on this forum but I have found the solution...)
Here goes my smsd.conf file:
... [MODEM1] ... regular_run_interval = 2 regular_run_cmdfile = /var/spool/sms/command/MODEM1c regular_run_statfile = /var/spool/sms/MODEM1 ...
On /var/log/smsd.log, I see the command being issued, and if I'm quick enough I see the file /var/spool/sms/MODEM1 being created, but then is deleted.
Best regards, Carlos
|
|
#6 Fri Apr 16, 2010 09:57, 177 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
Carlos wrote just configured regular_run* for "querying saldo. However, after the command is issue, both the result file as the command file are deleted (same problem has been reported on this forum but I have found the solution...)
Please read the manual . Starting from this setting, there is Regular_run for a modem explained. The regular_run_statfile is deleted, because it contains a result of last run. In your case (with interval 2) it does not exist very long time. You can use regular_run and regular_run_post_run scripts to handle regular_run_statfile, if necessary. The regular_run_cmdfile is deleted, because otherwise it is processed again and again. It's designed to be processed only once, and that's what you wanted too . You could try to define regular_run_logfile = /var/log/smsd_saldo.log. From this log you can always see what is the latest saldo and what is the history of it.
|
|
#7 Fri Apr 16, 2010 10:48, 177 months ago.
|
Member
Registered: Apr 2010
Location: Portugal
Topic owner
|
Hum.. ok... But what I was expecting has *only* the regular_run_cmdfile to be deleted... well.. I have to find "another" workaround Carlos
|
|
#8 Fri Apr 16, 2010 11:03, 177 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
Carlos wrote But what I was expecting has *only* the regular_run_cmdfile to be deleted...
The regular_run_statfile is deleted before each run, because the manual says so . Carlos wrote well.. I have to find "another" workaround
Ok, if you cannot use regular_run_post_run (because of the version of smsd), you probably have already tried the regular_run_logfile and it was not enough... In that case you really need to continue searching... You still have unread answers and questions in a topic owned by you, here, is that outdated and can be closed?
|