Author |
Post |
|
#1 Tue May 09, 2017 16:17, 91 months ago.
|
Member
Registered: May 2017
Location: Horsens, Denmark
|
I use Huawei E3372(mostly) and a few other modems. If i use all serial ports for each modem sms sending is a lot faster, but if i use more tha 2 modems, with each 2 serial ports, smstools goes bananas.. Is this intended ?
|
|
#2 Tue May 09, 2017 16:22, 91 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
What is the OS?
What is the version of smsd and how it was installed, from repository or from sources?
Please show the smsd.conf. Also show the piece of log, around those bananas.
|
|
#3 Tue May 09, 2017 17:21, 91 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
Huawei modem typically creates three interfaces, for example /dev/ttyUSB0, 1 and 2. Usually the first one is used. Do you mean that your configuration uses more than one port for single modem? Hopefully not, because that should not be done.
|
|
#4 Wed May 10, 2017 10:10, 91 months ago.
|
Member
Registered: May 2017
Location: Horsens, Denmark
Topic owner
|
Actually yes i use port 1 for GSM1 port2 for GSM2 and so on. I works great until i have more then 2 modems connected.
I use raspbian jessie 4.9.24-v7+ armv7l GNU/Linux
Have not had the sense to record the log.
Right now i only use one port per modem to get it working.
|
|
#5 Wed May 10, 2017 21:04, 91 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
I tested this issue with Raspberry Pi 3 running the same jessie as you have. Testing was made using four Huawei E353 sticks on 10-port hub with external power supply. Two modems were running properly, but with three modems remarkable delays occurred when any command was sent to the modem. It also looked like the delay was somehow synchronized. With four modems the delay was up to 100 seconds or even more for each command, and also the answer from modem was delayed. At the same time the load was very high, and X was frozen in practice. This sounds similar than you reported. Next I tested same modems with the same hub on desktop machine running Ubuntu 16.04.2 LTS. Everything worked fine with the same configuration. All processes were working at the full speed, without any delays. I then switched hub and modems back to RPi, and the worst situation happened: everything worked without any problems. No delays when four modems were running at the full speed. I disconnected modems and hub, and reconnected them in the same way as the first time, one modem at a time. But the system was still working properly. So, first I had no idea about what is causing the delay. And now I cannot reproduce the issue. Is your RPi now running properly with more than two modems?
|
|
#6 Wed May 10, 2017 22:41, 91 months ago.
|
Member
Registered: May 2017
Location: Horsens, Denmark
Topic owner
|
it works fine if i only use one port per modem. also works fine if i only have 2 modems and use all ports. There is an issue though, which i also posted in help and support.. if i use 2 modems i get same speed as with 8 modems, meaning: 2 modems send 300 sms takes 2m 37s 8 modems send 300 sms takes 2m 37s both cases i send to the all queue
|
|
#7 Wed May 10, 2017 23:02, 91 months ago.
|
Member
Registered: May 2017
Location: Horsens, Denmark
Topic owner
|
it's like i have hit a loft of sending speed with no matter how manymodems, the whole config sends max 1.88 sms per sec. ??
|
|
#8 Wed May 10, 2017 23:38, 91 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
I check that speed issue later, as now this "linux crash" is more important. Some more test results:
After rebooting RPi and then connecting the hub, and then plugging in modems one by one, problem exists. This is how I started testing at the first time. Also after reboot and connecting the hub with all modems in place, the problem exists. Right not I do not know what is the reason that previously removed the problem.
Even with two modems only, there are minor delays, about 0.5-2 seconds, but rarely.
With two Minicoms, using different modems of course, the first one works very well, but at the same time when the second one is connecting, the whole system (X) gets frozen. It sounds like there is something wrong in the USB system.
Disconnecting and reconnecting the hub sometimes helps. I do not know why, but for some reason all four modems work at full speed, and mostly without any delays. When the USB system is in this "good" state, multiple Minicoms also work without problems.
I would like to make sure if I understand your settings correctly:
- your first modem provides ports: /dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB2
- your second modem provides ports: /dev/ttyUSB3 /dev/ttyUSB4 /dev/ttyUSB5
- your configuration is: [GSM1] device = /dev/ttyUSB0 [GSM2] device = /dev/ttyUSB1 [GSM3] device = /dev/ttyUSB2 [GSM4] device = /dev/ttyUSB3 [GSM5] device = /dev/ttyUSB4 [GSM6] device = /dev/ttyUSB5
Is this how you are running smstools? It should not be a working configuration, but still I want to ask.
|
|
#9 Wed May 10, 2017 23:49, 91 months ago.
|
Member
Registered: May 2017
Location: Horsens, Denmark
Topic owner
|
Yes that is how i configured it.
i tried rebooting with the modems connected and without, makes no difference. as soon as i start smstools with the modems connected the os gets very slow and very unresponsive.
but as soon as i have only connected 2 modems it works fine and very very little delay.
i use this hw: E3372h Huawei modems RPI 3 2 x http://www.conrad.com/ce/en/product/1374256/Raspberry-Pi-add-on-PCB-Raspberry-Pi-A-B-B which i power externally
|
|
#10 Wed May 10, 2017 23:53, 91 months ago.
|
Member
Registered: May 2017
Location: Horsens, Denmark
Topic owner
|
i just tried with a tp-link usb 3 hub with ext power, same issue
|
|
#11 Thu May 11, 2017 00:13, 91 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
First fix your configuration. One modem cannot be used as three modems. Those additional ports are for other purposes. Check what is the first port of each modem, and use that, and only that, in configuration. Two modems = two ports, no more, it's easier for USB lines too.
Since RPi freezes easily with more than two modems, use only two modems so far.
You could try a modem setting rtscts = no, but it's not sure that it helps. I tried it and it seemed to help, but little bit later more than two modems were working properly without that setting.
Later I could release a patch which detects and gives alarms when delay-issue occurs. It does not fix the problem with RPi, but it can tell if the issue exists or is the system running well.
|
|
#12 Thu May 11, 2017 00:22, 91 months ago.
|
Member
Registered: May 2017
Location: Horsens, Denmark
Topic owner
|
well when i use only one port per modem, i can connect 8 modems 2 rpi without any problem, then i only have the speed issue i described.
|
|
#13 Thu May 11, 2017 15:18, 91 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
Please apply the following patch: Edit src/modeminit.c. Search for Command is sent, waiting and you are on the line 1286 where is: if (!silent) { char tmp[64] = {0};
if (log_response_time) snprintf(tmp, sizeof(tmp), "time %i ms ", (int)((put_command_sent - write_started) / 1000));
writelogfile(LOG_DEBUG, 0, "%sCommand is sent, waiting for the answer. (%i)", tmp, timeout); }
// 3.1.16beta2: Give some time to modem, before start reading (read_delay). if (DEVICE.read_delay > 0) 'c' Syntax Highlight powered by GeSHi Add highlighted lines to the code: if (!silent) { char tmp[64] = {0};
int command_is_sent_time = (int)((put_command_sent - write_started) / 1000); int DEVICE_alarm_command_is_sent_time = 100; static int command_is_sent_time_count = 0;
if (command_is_sent_time >= DEVICE_alarm_command_is_sent_time) { command_is_sent_time_count++; tb_sprintf("ALARM_COMMAND_IS_SENT_TIME EXCEEDED: %i (%i)", command_is_sent_time, command_is_sent_time_count); writelogfile0(LOG_CRIT, 1, tb); alarm_handler0(LOG_CRIT, tb); }
if (log_response_time) snprintf(tmp, sizeof(tmp), "time %i ms ", (int)((put_command_sent - write_started) / 1000));
writelogfile(LOG_DEBUG, 0, "%sCommand is sent, waiting for the answer. (%i)", tmp, timeout); }
// 3.1.16beta2: Give some time to modem, before start reading (read_delay). if (DEVICE.read_delay > 0) 'c' Syntax Highlight powered by GeSHi Save and compile. Now an alarm is generated when time to send a command exceed 100 milliseconds. Usually this time is 0 milliseconds, or other very small value. Alarmhandler is required. It could be /var/spool/sms/alarmhandler.sh: #!/bin/bash
echo "$2 $3,$4, $5: $6" >> /var/log/smsd_alarm.log 'bash' Syntax Highlight powered by GeSHi Make it executable. In the global part of smsd.conf define: log_response_time = yes alarmhandler = /var/spool/sms/alarmhandler.sh 'smsdconf' Syntax Highlight powered by GeSHi Now you can monitor /var/log/smsd_alarm.log which shows how often and how long delays occur. Small delays can be seen sometimes, but if the system is going to be frozen, long delays are seen. In the log you can also see what is the speed of each modem. If you use a modem setting logfile = /var/log/modemname.log, you can monitor each modem in different terminal which gives a clear idea of how the processes work. I still do not know what is causing the problem, but one thing I noticed is that if my modems (even one of them) are listed as network interfaces (wwan0, wwan1, wwan2 and wwan3 in ifconfig), the system goes slow and is going to be frozen. When there are none of them, system seems to run smoothly. This is not comprehensively tested, but is worth of trying.
|
|
#14 Thu May 11, 2017 18:45, 91 months ago.
|
Member
Registered: May 2017
Location: Horsens, Denmark
Topic owner
|
I will try this later tonight
|
|
#15 Fri May 12, 2017 13:42, 91 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
If network interfaces provided by the modems are up, any of them, there will be serious troubles in communication with modems. In the global part of smsd.conf define: start = /var/spool/sms/start.shThe script /var/spool/sms/start.sh #!/bin/bash
# Shut down network interfaces provided by modems: INTERFACES="wwan0 wwan1 wwan2 wwan3"
for interface in $INTERFACES do ifconfig $interface down >/dev/null 2>&1 done 'bash' Syntax Highlight powered by GeSHi Adjust INTERFACES and make the script executable.
|