T1Modem: Never mind, got it working :)
|
T1Modem: Sorry to dig up an old thread but I am having issues applying the second patch to the source code (trying to get an MV-372 working, sends first SMS but timeout after).
The patch file contains:
--
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.
--
The output I get is:
patching file modeminit.c
patch: **** malformed patch at line 6: // To avoid error messages, first send AT and read the answer if it's available.
Any help would be appreciated :)
|