SMS Server Tools 3
This site is hosted by Kekekasvi.com
 Menu
Basic information:
Additional information:
Support:
Get SMS Server Tools 3:
Additional Options

 Sponsored links

 Search
Custom Search

 Visitor locations
 
 SMS Server Tools 3 Community
Welcome, Guest. Please login or register. Sat May 25, 2024 11:21
SMSTools3 Community » Help and support Bottom

[fixed in 3.1.9] Ubuntu 64-bit problem

  This topic is locked

Page:  1  2  Next

Author Post
Member
Registered:
May 2010
Location: Russian Federation
Operating system name and version: Ubuntu 10.04
Version of smsd: 3.1.6, 3.1.8
Smsd installed from: sources / package repository
Name and model of a modem / phone: Siemens TC35i
Interface: serial / USB Prolific

We have a stange problems with smstools. Everything worked normal on 9.04 32-bit Ubuntu, but after upgrade smstools does not working.
Tried 3.1.6 repository version, 3.1.8 compiled, USB and serial, problem exists anyway.
Tested on another machine with gentoo 32-bit - working.

Log:


Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
This problem really looks strange... :shock:

I have tried to produce this kind of problem, but with no success. Everything is just working as expected...

The compilation was tested under the previous version of Ubuntu 64bit. I now upgraded my test machine, and it has:

# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=10.04
DISTRIB_CODENAME=lucid
DISTRIB_DESCRIPTION="Ubuntu 10.04 LTS"


# uname -a
Linux AMD-64 2.6.32-22-generic #33-Ubuntu SMP Wed Apr 28 13:28:05 UTC 2010 x86_64 GNU/Linux

# gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4.3-4ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i486 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)



When there is the first error presented in the log, the communication has been working for a while. I cannot imagine where that answer "0" is coming from. Also it's coming too fast, because "OK" or "ERROR" is expected and there should be five seconds delay for the timeout. However, later when the PDU termination is sent, the timeout is spent. I therefore assume that you have not changed the setting read_timeout in the modem configuration.

The counter for timeouts is also strange, because it's always 1. It should run from 1 to 10 and then 1 - 2 - 1 - 2 etc.

And another strange issue is the PDU. It's a correct PDU of a status report, but it is not recognized as a report. In the log there is a number missing, but probably you have removed it? Anyway, there should be a message "SMS received (report x, y), From: number", not just "SMS received, From:".

Have you checked what is in the message file /var/spool/sms/incoming/SUCT.0WAI1z, is it a status report or is it an ordinary message, or perhaps broken somehow?

I'm still wondering what's going on, and have no any ideas for resolving this problem. Perhaps this problem has something to do with the libraries in your system, but I'm not sure...

Member
Registered:
May 2010
Location: Russian Federation
Topic owner
Tried to switch off modem:


Then switched on:


As you can see, we have got several reports from modem and then it returns 'O' again :)

Maybe you can advise any debug actions to do?

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Okay, several reports were received and now they were all detected as a status reports. But still, every CMGD gets "O" and also CMGF gets "O". At the same time CMGR gets a correct answer, and this is what I do not understand...

After testing 3.1.8 from sources, I have installed 3.1.6-1 from the repository, and it also did not have any problems while testing.

What is the locale of your system? It may be interesting to know.

There is one character, "ю", which may be a clue, but, it's not sure.

When you tested smsd on other systems, the same modem Siemens TC35i was used, right?

I could provide some code for debugging, but it may take a time. Perhaps it would be easier that I connect to your system using ssh, if it's possible. Let's think about this later.


You could check one thing:

- Stop the smsd if it's running.
- Start it in the communication mode:
smsd -C SUCT

- Follow the instructions on the screen.
- Type ATE1 (and Enter) to set the echo on.
- Check what character sets are available: AT+CSCS=?
- Check what is the current character set: AT+CSCS?

This information might be useful, but it's not sure because on your 32bit system everything worked without problems.


Another test which might be useful:

- Stop the smsd if it's running.
- Communicate with a modem using Minicom.
- From the log you can see what commands were sent and how.
- Send those commands manually, AT, ATE0+CMEE=1 but use ATE1+CMEE=1 instead, AT+CPIN?, AT+CSQ, AT+CREG? and AT+CMGF=0. What happens and what is received?
- Also you could test AT+CMGD=1, if possible.

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
After done those test mentioned in my previous post, the following addition to the code might give a valuable information:

Edit the file modeminit.c. Search "read data" and insert those lines shown bold and red:

   // read data
   got = read(modem_handle, answer +count, toread);

   if (got > 0)
   {
     char tmp[SIZE_LOG_LINE];
     int idx;

     sprintf(tmp, "read count=%i, got=%i:", count, got);
     for (idx = count; idx < count +got; idx++)
       sprintf(strchr(tmp, 0), " %02X[%c]", (unsigned char)answer[idx],
               ((unsigned char)answer[idx] >= ' ')? answer[idx] : '.');

      writelogfile(LOG_DEBUG, 0, tmp);
   }


   // if nothing received ...
   if (got<=0)


Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
And...
Probably it's the regexec() which causes the problem.

Insert those lines too, search "wait for the modem-answer":

   // wait for the modem-answer
   answer[0] = 0;
   timeoutcounter = 0;
   got_timeout = 1;
   do
   {
     char *saved_answer;

     read_from_modem(answer, max, 2);  // One read attempt is 200ms

     saved_answer = strdup(answer);

     // check if it's the expected answer
     if (expect && expect[0] && (regexec(&re, answer, (size_t) 0, NULL, 0) == 0))
     {
       if (strcmp(answer, saved_answer))
       {
         char tmp[SIZE_LOG_LINE];
         int idx;

         writelogfile(LOG_DEBUG, 0, "the answer was changed");

         sprintf(tmp, "answer after regexec: len=%i:", (int)strlen(answer));
         for (idx = 0; idx < (int)strlen(answer); idx++)
           sprintf(strchr(tmp, 0), " %02X[%c]", (unsigned char)answer[idx],
                   ((unsigned char)answer[idx] >= ' ')? answer[idx] : '.');

         writelogfile(LOG_DEBUG, 0, tmp);
         strcpy(answer, saved_answer);
       }
       free(saved_answer);


       got_timeout = 0;
       put_command_timeouts = 0;
       break;
     }

     free(saved_answer);

     // 3.1.1: Some modem does not give "OK" in the answer for CPMS:
     // +CPMS: "SM",0,30,"SM",0,30,"SM",0,30
     if (strstr(answer, "+CPMS:"))


Try these code changes first, before checking anything else...

Member
Registered:
May 2010
Location: Russian Federation
Topic owner
All your commands are working ok, modem is answering, Minicom also works.

We tried changing locale to "C" with no effect.
The same modem was used on all tested systems.

Giving you a log with debugging info.



Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Was there "saved_answer" change also included when creating the latest log?

I could check the code which is created by your compiler. Run make to ensure that you have executable smsd and object files in the src directory, then pack all: tar -zcf rpra.tar.gz * and send the packet to me. Details in the private block:

Hidden private text.



Member
Registered:
May 2010
Location: Russian Federation
Topic owner
keke wrote
Was there "saved_answer" change also included when creating the latest log?

Yes, it was, but never showed in log.

Quote
I could check the code which is created by your compiler. Run make to ensure that you have executable smsd and object files in the src directory, then pack all: tar -zcf rpra.tar.gz * and send the packet to me.

I sent it, but I think the problem is elsewere. Ubuntu native binary smstools package (3.1.6) have the same issue.

Member
Registered:
May 2010
Location: Germany
I got the same issue here running on Ubuntu 10.4 64bit.
After installing Ubuntu 10.4 32bit on the same machine,
the Problem was gone. But that's not a 'solution' for the
problem, we were planning to use 64bit servers.

Hardware Specs:
Server: HP ProLiant DL360 G6
Modem: Siemens TC65i connected via USB or serial cable.

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
rpra wrote
I sent it, but I think the problem is elsewere. Ubuntu native binary smstools package (3.1.6) have the same issue.

Thanks. And you are right, the problem is not in the compilation. It's exactly the same as mine, and it's running well on my hardware.

Too bad that it was not a problem with regexec... It was looking clear, because the answer from the modem is recognized (no timeout because of this), but when the answer is logged and handled, it's changed. There is not much code between those two points, and the answer did not corrupt every time.

As valeni now has reported the same problem, can you both show the /proc/cpuinfo ? I'm not sure wether it helps, but not much ideas right now... :(

As you both have Siemens modem, is it sure that nothing additional drivers were installed for it?

Member
Registered:
May 2010
Location: Germany
Hi here is the info you requested, but it's from the 32bit version, as we don't have the 64bit version around.



There were no additional drives installed it's handled by the default USB Modem Abstraction layer.
It has the same issue when it's connected with a normal serial cable.

Member
Registered:
May 2010
Location: Russian Federation
Topic owner


Member
Registered:
Jun 2010
Location: Rome, Italy
Hello,
I confirm the problem described in the first post of this thread.

It shows the "O" response instead of the "OK" response in the log file.

Linux ubuntu 2.6.32-22-server #33-Ubuntu SMP Wed Apr 28 14:34:48 UTC 2010 x86_64 GNU/Linux

Greetings,
Stefano Coletta

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
I installed 2.6.32-21-server, but "unfortunately" it was running without this problem. Then I upgraded it to 2.6.32-22-server #36-Ubuntu SMP Thu Jun 3 20:38:33 UTC 2010 x86_64 GNU/Linux, but I still do not have this problem. The machine is using single processor, and it's AMD.

As there is a dist-upgrade available, does it have any effect with your machines?

Member
Registered:
Jun 2010
Location: Rome, Italy
Hello,
I've upgraded any package installed as you suggested.

root@server:~# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

root@server:~# apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

root@server:~# uname -a
Linux server 2.6.32-22-server #36-Ubuntu SMP Thu Jun 3 20:38:33 UTC 2010 x86_64 GNU/Linux

But unfortunately the smsd.log shows always the same message:

...
2010-06-08 12:57:11,7, GSM1: <- O
2010-06-08 12:57:11,7, GSM1: -> ^Z
2010-06-08 12:57:11,7, GSM1: Command is sent, waiting for the answer
2010-06-08 12:57:16,7, GSM1: put_command expected (OK)|(ERROR), timeout occurred. 1.
2010-06-08 12:57:16,7, GSM1: <-
2010-06-08 12:57:16,7, GSM1: -> AT
2010-06-08 12:57:16,7, GSM1: Command is sent, waiting for the answer
2010-06-08 12:57:17,7, GSM1: <- O
2010-06-08 12:57:17,7, GSM1: -> ^Z
2010-06-08 12:57:17,7, GSM1: Command is sent, waiting for the answer
2010-06-08 12:57:22,7, GSM1: put_command expected (OK)|(ERROR), timeout occurred. 1.
2010-06-08 12:57:22,7, GSM1: <-
2010-06-08 12:57:22,7, GSM1: -> AT
2010-06-08 12:57:22,7, GSM1: Command is sent, waiting for the answer
2010-06-08 12:57:22,7, GSM1: <- O
2010-06-08 12:57:22,7, GSM1: -> ^Z
2010-06-08 12:57:22,7, GSM1: Command is sent, waiting for the answer

If it helps, this is my configuration:

devices = GSM1
logfile = /var/log/smsd.log
loglevel = 7
smart_logging = yes

eventhandler = /usr/local/bin/callhandlerwrapper

hangup_incoming_call = yes

failed = /var/spool/sms/failed
sent = /var/spool/sms/sent
report = /var/spool/sms/report

[GSM1]
device = /dev/ttyUSB0
incoming = yes
pin = ****
phonecalls = yes
report = yes

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
The code in post #5 shows that the answer was correct when received from the modem. It was also not modified by regexec function. Now, there is not much code which handles the answer, before the answer is broken. Running smsd with a setting detect_message_routing = no could be tried, but I do not expect it to affect.

It is very strange that some answers breaks but some not. Because I was unable to reproduce this behaviour with my server, even with the same version of Ubuntu, but running on AMD processor, I have no ideas left on how to resolve this problem.

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
When this error occurs, and the smsd is still running, does the restarting of a modem always help, or does it have any impact?

Member
Registered:
Jun 2010
Location: Rome, Italy
Hello,
I've just restarted the modem as you suggested.

Before restarting I've stopped the smsd and then started again.

The problem arises immediately, as shown in the log.

Just to make it clear, it happens ALWAYS, after upgrading from ubuntu 9 to ubuntu 10, it never happened when I was using ubuntu 9. We are always speaking of 64bit editions.

2010-06-14 12:48:44,2, smsd: Smsd mainprocess terminated. PID 6400, was started 10-06-14 00:00:02.
2010-06-14 12:54:09,2, smsd: Smsd v3.1.6 started.
2010-06-14 12:54:09,2, smsd: Running as root:root.
2010-06-14 12:54:09,7, smsd: Running startup_check (shell): /tmp/smsd_script.55IKjN /tmp/smsd_data.twEaQl
2010-06-14 12:54:09,7, smsd: Done: startup_check (shell), execution time 0 sec., status: 0 (0)
2010-06-14 12:54:09,4, smsd: File mode creation mask: 022 (0644, rw-r--r--).
2010-06-14 12:54:09,5, smsd: Outgoing file checker has started. PID: 7525.
2010-06-14 12:54:09,5, GSM1: Modem handler 0 has started. PID: 7526.
2010-06-14 12:54:09,5, GSM1: Using check_memory_method 1: CPMS is used.
2010-06-14 12:54:09,6, GSM1: Checking device for incoming SMS
2010-06-14 12:54:09,6, GSM1: Checking if modem is ready
2010-06-14 12:54:10,7, GSM1: -> AT
2010-06-14 12:54:10,7, GSM1: Command is sent, waiting for the answer
2010-06-14 12:54:10,7, GSM1: <- AT OK
2010-06-14 12:54:10,6, GSM1: Pre-initializing modem
2010-06-14 12:54:10,7, GSM1: -> ATE0+CMEE=1
2010-06-14 12:54:10,7, GSM1: Command is sent, waiting for the answer
2010-06-14 12:54:10,7, GSM1: <- ATE0+CMEE=1 OK
2010-06-14 12:54:10,6, GSM1: Checking if modem needs PIN
2010-06-14 12:54:11,7, GSM1: -> AT+CPIN?
2010-06-14 12:54:11,7, GSM1: Command is sent, waiting for the answer
2010-06-14 12:54:11,7, GSM1: <- +CPIN: SIM PIN OK
2010-06-14 12:54:11,5, GSM1: Modem needs PIN, entering PIN...
2010-06-14 12:54:11,7, GSM1: -> AT+CPIN="****"
2010-06-14 12:54:11,7, GSM1: Command is sent, waiting for the answer
2010-06-14 12:54:11,7, GSM1: <- O

Member
Registered:
Jun 2010
Location: Rome, Italy
By using

detect_message_routing = no

not helped. Same behaviour.

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
creator wrote
Just to make it clear, it happens ALWAYS, after upgrading from ubuntu 9 to ubuntu 10, it never happened when I was using ubuntu 9. We are always speaking of 64bit editions.

Thank's for the information.

The strange thing is that first three answers from the modem did not break. And in the log of rpra (post #1) there are some answers (for CMGF) which break, but after this there are answers which do not break. And later all answers break.

I was wondering if a situation in the post #3 can be reproduced repeatedly. There smsd was running when the modem was restarted, and then the problem disappeared for a while, but came back later. Can you do the reset with smsd still running?

Even better if you can apply the patch shown in the post #5, but it's not mandatory because from the log we can deduce that the answer from a modem was correct because there is no timeout. At least you could first try without the patch.

Member
Registered:
Jun 2010
Location: Rome, Italy
I've restarted the modem as requested, without restarting SMSd.

As you can see, the smsd process is not able to communicate with the modem anymore. This maybe because my modem is connected via USB instead of RS232?

This is the log:

...
2010-06-14 14:21:02,7, GSM1: Command is sent, waiting for the answer
2010-06-14 14:21:03,7, GSM1: <- O
2010-06-14 14:21:03,7, GSM1: -> ^Z
2010-06-14 14:21:03,7, GSM1: Command is sent, waiting for the answer
2010-06-14 14:21:08,7, GSM1: put_command expected (OK)|(ERROR), timeout occurred. 1.
2010-06-14 14:21:08,7, GSM1: <-

<restarted here>

2010-06-14 14:21:11,3, GSM1: Modem is not clear to send
2010-06-14 14:21:24,3, GSM1: Modem is not clear to send
2010-06-14 14:21:38,3, GSM1: Modem is not clear to send
2010-06-14 14:21:51,3, GSM1: Modem is not clear to send
2010-06-14 14:22:04,3, GSM1: Modem is not clear to send
2010-06-14 14:22:18,3, GSM1: Modem is not clear to send
2010-06-14 14:22:31,3, GSM1: Modem is not clear to send
2010-06-14 14:22:44,3, GSM1: Modem is not clear to send
2010-06-14 14:22:57,3, GSM1: Modem is not clear to send
2010-06-14 14:23:11,3, GSM1: Modem is not clear to send
2010-06-14 14:23:24,3, GSM1: Modem is not clear to send
2010-06-14 14:23:37,3, GSM1: Modem is not clear to send
2010-06-14 14:23:47,3, GSM1: Modem is not ready to answer commands (Timeouts: 1)
2010-06-14 14:23:47,6, GSM1: Reading phonecall entries
2010-06-14 14:23:51,3, GSM1: Modem is not clear to send
2010-06-14 14:24:04,3, GSM1: Modem is not clear to send
2010-06-14 14:24:14,6, GSM1: No phonecall entries
2010-06-14 14:24:24,6, GSM1: Checking device for incoming SMS
2010-06-14 14:24:24,6, GSM1: Checking if modem is ready
2010-06-14 14:24:27,3, GSM1: Modem is not clear to send
2010-06-14 14:24:41,3, GSM1: Modem is not clear to send
2010-06-14 14:24:54,3, GSM1: Modem is not clear to send
2010-06-14 14:25:07,3, GSM1: Modem is not clear to send
2010-06-14 14:25:20,3, GSM1: Modem is not clear to send
2010-06-14 14:25:34,3, GSM1: Modem is not clear to send
2010-06-14 14:25:47,3, GSM1: Modem is not clear to send
2010-06-14 14:26:00,3, GSM1: Modem is not clear to send
2010-06-14 14:26:14,3, GSM1: Modem is not clear to send
2010-06-14 14:26:27,3, GSM1: Modem is not clear to send
2010-06-14 14:26:40,3, GSM1: Modem is not clear to send
2010-06-14 14:26:54,3, GSM1: Modem is not clear to send
2010-06-14 14:27:07,3, GSM1: Modem is not clear to send
2010-06-14 14:27:20,3, GSM1: Modem is not clear to send
2010-06-14 14:27:34,3, GSM1: Modem is not clear to send
2010-06-14 14:27:47,3, GSM1: Modem is not clear to send
2010-06-14 14:28:00,3, GSM1: Modem is not clear to send
2010-06-14 14:28:13,3, GSM1: Modem is not clear to send
2010-06-14 14:28:27,3, GSM1: Modem is not clear to send
2010-06-14 14:28:40,3, GSM1: Modem is not clear to send
2010-06-14 14:28:53,3, GSM1: Modem is not clear to send
2010-06-14 14:29:07,3, GSM1: Modem is not clear to send
2010-06-14 14:29:17,3, GSM1: Modem is not ready to answer commands (Timeouts: 1)
2010-06-14 14:29:17,6, GSM1: Reading phonecall entries
2010-06-14 14:29:20,3, GSM1: Modem is not clear to send
2010-06-14 14:29:33,3, GSM1: Modem is not clear to send
2010-06-14 14:29:43,6, GSM1: No phonecall entries
2010-06-14 14:29:53,6, GSM1: Checking device for incoming SMS
2010-06-14 14:29:53,6, GSM1: Checking if modem is ready
2010-06-14 14:29:57,3, GSM1: Modem is not clear to send
2010-06-14 14:30:10,3, GSM1: Modem is not clear to send
2010-06-14 14:30:23,3, GSM1: Modem is not clear to send
2010-06-14 14:30:36,3, GSM1: Modem is not clear to send
2010-06-14 14:30:50,3, GSM1: Modem is not clear to send
...

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
creator wrote
I've restarted the modem as requested, without restarting SMSd.

As you can see, the smsd process is not able to communicate with the modem anymore. This maybe because my modem is connected via USB instead of RS232?

Yes, because the /dev/ttyUSBn was gone and after reconnect it may be even different... Damn, we still have nothing :(.

I will look forward if I can provide some test code for you.

Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Here is a source package for testing:

h t t p : / / smstools3.kekekasvi.com/test/smstools3-3.1.8-test1.tar.gz

It tries to resolve when the failure happens, and how it happens. Any logs are welcome.


« Last edit by keke on Fri Sep 03, 2010 15:32, 167 months ago. »
Member
Registered:
Jun 2010
Location: Rome, Italy
The problem is still there even with 3.1.8-test1 version you posted.

Here is the log:


Hope it helps.
:)

  This topic is locked

Page:  1  2  Next

SMSTools3 Community » Help and support Top

 
Time in this board is UTC.  

Privacy Policy   SMS Server Tools 3 Copyright © Keijo Kasvi.