repete: These are the changes I made, and they where made to the source including the patch from this forum - I believe that is where you are right now :)
--
diff -rupN smstools3.norberg1/src/modeminit.c smstools3.norberg2/src/modeminit.c
--- smstools3.norberg1/src/modeminit.c 2012-10-22 08:27:36.438510611 +0200
+++ smstools3.norberg2/src/modeminit.c 2012-10-22 08:59:58.870484409 +0200
@@ -1254,6 +1254,11 @@ int initmodem(char *new_smsc, int receiv
// To avoid error messages, first send AT and read the answer if it's available.
if (DEVICE.needs_wakeup_at)
{
+ //Portech doesn't alway respond properly to AT commands
+ writelogfile0(LOG_ERR, 1, tb_sprintf("Device wake up needed...") );
+
+ put_command( DEVICE.portech_module_name, 0, 0, 1, 0);
+ usleep_until(time_usec() + 100000);
put_command("AT\r", 0, 0, 1, 0);
usleep_until(time_usec() + 100000);
read_from_modem(answer, sizeof(answer), 2);
diff -rupN smstools3.norberg1/src/smsd_cfg.c smstools3.norberg2/src/smsd_cfg.c
--- smstools3.norberg1/src/smsd_cfg.c 2012-10-22 08:28:15.270510069 +0200
+++ smstools3.norberg2/src/smsd_cfg.c 2012-10-22 08:32:22.930506732 +0200
@@ -1677,6 +1677,9 @@ int readcfg()
if (strcasecmp(name,"telnet_cmd_prompt")==0)
strcpy2(NEWDEVICE.telnet_cmd_prompt, ask_value(NEWDEVICE.name, name, value));
else
+ if (strcasecmp(name,"portech_module_name")==0)
+ strcpy2(NEWDEVICE.portech_module_name, ask_value(NEWDEVICE.name, name, value));
+ else
if (strcasecmp(name,"signal_quality_ber_ignore")==0)
{
if ((NEWDEVICE.signal_quality_ber_ignore = yesno_check(ask_value(NEWDEVICE.name, name, value))) == -1)
diff -rupN smstools3.norberg1/src/smsd_cfg.h smstools3.norberg2/src/smsd_cfg.h
--- smstools3.norberg1/src/smsd_cfg.h 2012-10-22 08:28:26.710509912 +0200
+++ smstools3.norberg2/src/smsd_cfg.h 2012-10-22 08:32:16.570506814 +0200
@@ -233,6 +233,7 @@ typedef struct
int verify_pdu; // 3.1.14.
int loglevel_lac_ci; // 3.1.14.
int log_not_registered_after; // 3.1.14.
+ char portech_module_name[8];
} _device;
// NOTE for regular run intervals: effective value is at least delaytime.
--
I added a cfg option called portech_module_name, if the portech sits a long time without any activity, the telnet 'session' times out, and it has to receive the modulename you want to contact, before you can send it any more AT commands.
This is a copy of my cfg for one of the devices
---
[GSM1SIM1]
device = @10.0.0.51:8023
telnet_crlf = yes
incoming=no
telnet_login = mylogin
telnet_password = mypassword
telnet_login_prompt = username:
telnet_password_prompt = password:
telnet_cmd_prompt = module1, module2, state1, state2, info.
telnet_cmd = module1
init = ATV1
needs_wakeup_at=yes
portech_module_name=module1
hangup_incoming_call = yes
rtscts=no
---
The telnet_cmd_prompt I is from my testing but didn't work, so it can be skipped, but somehow it survived - so I left it there. The most important is the 'nedds_wakeup_at' and 'portech_module_name'
I have not succeded in using 2 sims per module, so we only have 2 sims - one per module. Maybe if the need arises for us, I'll look into it ..
Good luck :)
|
repete: Hi slink,
This was the exact same problem we had, I'll clean up the code some time during the weekend and produce a diff file (if I can figure out how), and then post it here :)
Regards
Peter
|
repete: Hi Adam,
Wondered if you still have problems, I have setup a SC-495 which (as far as I can read) is similar to the portech 574. I also applied the patch, and it's working fine.
I had one small problem that required a change in the source code, we are setting up a 'send-only' SMS server, and after a while the command interface times out, and it needs an extra 'moduleX' command to get into command mode again.
I have not included a patch, since it needs cleanup .. and we are not done implementing yet :)
|