Squeeze the maximum Internet out of village honeycombs
On the eve of the New Year holidays, it took an early departure from the capital, leaving it in the direction of such places where the Internet is quite rare. For a period of absence from work, I promised my partners to be in touch. And since my occupation is directly related to the web, I decided to experiment with the availability of the Internet in the planned place of stay.
The essence of the task was as follows:
We had 2 modems, 750 megabytes of paid Internet, 3 laptops, several phones and a whole host of SIM cards of all sorts and colors, an access point with OpenWRT, a usb hub, a flash drive and an antenna. Not that it was a necessary supply for the trip, but if you started collecting pieces of iron, it becomes difficult to stop. The only thing that caused me concern was the antenna. Nothing in the world is more helpless, irresponsible and weak than the signal from the antenna, passed through a 3-meter usb cable. I knew that sooner or later we will move on to this rubbish.
I had several solutions:
Since I remembered too late about the possibility of connecting an antenna in my E5776, I actually did not have the first choice.
From the essentials I had:
For a complete picture, I lacked a usb modem, the choice fell on the Huawei 3372h.
I had one USB port on TP-Link, and it was already occupied by the drive for the root file system, plus the long wire at the antenna was suspicious. I was tormented by doubts that the access point could power the modem through a 3-meter wire, so connecting via a USB hub was the only solution.
As a hub I used the good old D-Link Dub-104 (a beautiful compact hub with an incredibly hefty power supply).
Intermediate option:
Since we were heading to a village where all phones barely worked in GPRS mode, I decided to install all the software while I was in a big city, so I set it to the maximum so that I could catch a minimum of adventure on the spot. I learned the tuning knowledge from this article: https://wiki.openwrt.org/doc/recipes/3gdongle .
In general, after that you can try to insert a modem and see if devices like / dev / ttyUSB * have appeared . In my case, usb_modeswitch did all the work and the devices appeared. If this is not your case, you should read the article on usb_modeswitch in detail .
Set the wan options:
In my case, the SIM was from Megaphone, so the parameters were selected specifically for him.
I also added a line in chatscript to see the signal level from the tower when connected:
Now we do ifup wan , look at the logread iii ... If you are lucky, you will see something like this:
If your operator Megaphone is not there, then move on.
I had an error while the ATD modem was executing the command . Having a little bit of forums, I discovered an interesting feature of the operator Megaphone. On one of the forums it was suggested to manually disable everything superfluous on the modem and leave only the functions of the modem itself and possibly the sd card. On the other, flash the modem with factory (non-branded) firmware (in my case, the firmware was also from Megaphone).
Surprising was the fact that when connected to a laptop with Windows, the modem worked properly. It was worth connecting to Linux - I got an error.
First, I decided to check whether this is really connected with the Megaphone. I took a SIM card from Tele2 from stocks, slightly corrected the connection configuration:
III, it worked. Right away. Okay, let's go first in the simplest way and turn off all the excess on the modem:
We exit the combination:
CTRL + A + X
Now turn off usb_modeswitch as unnecessary:
We flip the modem, wait until it boots up and raise the wan interface:
In my case, everything worked now. Hurrah!
Initial tuning was carried out without connecting an antenna, now it was interesting to see whether there would be an effect from it.
Signal strength without antenna:
And now with the antenna:
It looked so cool that I sensed a catch. And there really was a catch. It was a discovery for me that a good signal from a base station still means nothing.
Below pings for the first and second options:
1.
2.
And then a new marvelous world of mobile communications opened for me.
I discovered that my modem supports scanning the area for base stations, and not necessarily the operator whose SIM card is installed inside it.
This was done with the following command:
20 - how many towers to output
-110 - the minimum signal level is
0/1 - 0 - 2G towers, 1 - 3G towers. With LTE so far.
The list is sorted by signal strength and looks like this:
1e7e - LAC stations
250 - MCC (Russia)
02 - MNC (In this case - MTS)
-78 - signal level of this base station
8b77 - CID station
400000 - range in which the signal of the base station is received (as in ^ syscfgex command)
Now Having this data, you can go to the site http://xinit.ru/bs/ and see where these towers are located relative to themselves.
As a rule, if there is a directional antenna, then it should be sent to the nearest base station - I thought so. Then the next discovery awaited me. Even if we send an antenna at it, it’s far from the fact that registration will take place at this base station. And if it does, then it is not a fact that the data transfer rate will be higher than through a tower located twice as far from it. So I walked to the nearest stations within a radius of 1.5 kilometers to 3 and all of them, with a good signal, transmitted data with a long delay. Ping averaged ~ 300ms.
While experimenting, I accidentally got to the tower, which was at a distance of 6-7 kilometers from me. Having connected to it, the ping time dropped to ~ 90ms, despite the fact that the signal level fell with it.
For comparison, the signal level from:
nearby towers: 13-20
from the remote tower: 5-12
(measurements were performed by the gcom sig -d / dev / ttyUSB1 utility , where the value can be a digit from 0 to 99).
Nevertheless, I conducted speed tests on the best near tower and on the remote one, the results:
one of the nearest stations - 2 / 0.35 Mbit.
Remote station - 4.28 / 1.68 Mbps.
Honestly, I was stunned by two megabits as well. when using a regular phone, even the Google Play Market did not open. And here, it turns out, you can still accelerate to 4!
Such results were enough for me. I left the antenna to look in the direction of the most distant tower, hoping to always keep in touch with it, but my hopes were naive. A new and yet unresolved problem has arisen. It consists in the fact that from time to time there is registration at another base station, even if it is located in the opposite direction relative to the direction of the antenna. At such moments, delays in data transfer increase, and I have not yet found how to overcome this.
On the Internet, a question such as: “is it possible for the modem to indicate which tower to work with” is answered that you do not choose the tower, but it is you. Perhaps knowledgeable people will tell you if there are solutions for such situations?
That's all. Thanks to all those who read to the end.
PS
Then Simon Beeline came to hand, her towers are closest to us and after connecting the speed test showed as much as 20/2 Megabits. I bring the configuration for Beeline:
W3bsit3-dns.com.ru
wiki.openwrt.org
xinit.ru/bs/
The essence of the task was as follows:
- Achieve a comfortable internet speed.
- Distribute the Internet not only for yourself, but also for your spouse.
We had 2 modems, 750 megabytes of paid Internet, 3 laptops, several phones and a whole host of SIM cards of all sorts and colors, an access point with OpenWRT, a usb hub, a flash drive and an antenna. Not that it was a necessary supply for the trip, but if you started collecting pieces of iron, it becomes difficult to stop. The only thing that caused me concern was the antenna. Nothing in the world is more helpless, irresponsible and weak than the signal from the antenna, passed through a 3-meter usb cable. I knew that sooner or later we will move on to this rubbish.
I had several solutions:
- Use my Huawei 5776 modem, having bought an antenna for it.
- Collect more pieces of iron and collect something more powerful.
Since I remembered too late about the possibility of connecting an antenna in my E5776, I actually did not have the first choice.
From the essentials I had:
- TP-Link TL-WR1043ND with OpenWRT firmware 15.05
- Connect 2.0 antenna (with a 3-meter usb cable without ferrite rings).
- USB hub
For a complete picture, I lacked a usb modem, the choice fell on the Huawei 3372h.
Constructor assembly
I had one USB port on TP-Link, and it was already occupied by the drive for the root file system, plus the long wire at the antenna was suspicious. I was tormented by doubts that the access point could power the modem through a 3-meter wire, so connecting via a USB hub was the only solution.
As a hub I used the good old D-Link Dub-104 (a beautiful compact hub with an incredibly hefty power supply).
Intermediate option:
Install the necessary software on the access point
Since we were heading to a village where all phones barely worked in GPRS mode, I decided to install all the software while I was in a big city, so I set it to the maximum so that I could catch a minimum of adventure on the spot. I learned the tuning knowledge from this article: https://wiki.openwrt.org/doc/recipes/3gdongle .
ssh root@<точка доступа>
opkg update
opkg install comgt kmod-usb-serial kmod-usb-serial-option kmod-usb-serial-wwan usb-modeswitch usb-modeswitch-data
In general, after that you can try to insert a modem and see if devices like / dev / ttyUSB * have appeared . In my case, usb_modeswitch did all the work and the devices appeared. If this is not your case, you should read the article on usb_modeswitch in detail .
Configure connection settings
Set the wan options:
vim /etc/config/network
config interface 'wan'
option device /dev/ttyUSB0
option username 'gdata'
option password 'gdata'
option apn 'internet'
option service 'umts'
option maxwait '0'
option dialnumber '*99#'
option proto '3g'
In my case, the SIM was from Megaphone, so the parameters were selected specifically for him.
I also added a line in chatscript to see the signal level from the tower when connected:
vim /etc/chatscripts/3g.chat
ABORT BUSY
ABORT 'NO CARRIER'
ABORT ERROR
REPORT CONNECT
TIMEOUT 10
"" "AT+CSQ"
"" "AT&F"
OK "ATE1"
OK 'AT+CGDCONT=1,"IP","$USE_APN"'
SAY "Calling UMTS/GPRS"
TIMEOUT 30
OK "ATD$DIALNUMBER"
CONNECT ' '
Connection
Now we do ifup wan , look at the logread iii ... If you are lucky, you will see something like this:
Wed Dec 30 21:47:01 2015 local2.info chat[30352]: CONNECT
Wed Dec 30 21:47:01 2015 local2.info chat[30352]: -- got it
Wed Dec 30 21:47:01 2015 local2.info chat[30352]: send ( ^M)
Wed Dec 30 21:47:01 2015 daemon.info pppd[30347]: Serial connection established.
Wed Dec 30 21:47:01 2015 kern.info kernel: [98634.870000] 3g-wan: renamed from ppp0
Wed Dec 30 21:47:01 2015 daemon.info pppd[30347]: Using interface 3g-wan
Wed Dec 30 21:47:01 2015 daemon.notice pppd[30347]: Connect: 3g-wan <--> /dev/ttyUSB0
Wed Dec 30 21:47:02 2015 daemon.info pppd[30347]: CHAP authentication succeeded: Welcome!!
If your operator Megaphone is not there, then move on.
Dancing with a tambourine
I had an error while the ATD modem was executing the command . Having a little bit of forums, I discovered an interesting feature of the operator Megaphone. On one of the forums it was suggested to manually disable everything superfluous on the modem and leave only the functions of the modem itself and possibly the sd card. On the other, flash the modem with factory (non-branded) firmware (in my case, the firmware was also from Megaphone).
Surprising was the fact that when connected to a laptop with Windows, the modem worked properly. It was worth connecting to Linux - I got an error.
First, I decided to check whether this is really connected with the Megaphone. I took a SIM card from Tele2 from stocks, slightly corrected the connection configuration:
vim /etc/config/network
config interface 'wan'
option device /dev/ttyUSB0
option apn 'internet.tele2.ru'
option service 'umts'
option maxwait '0'
option dialnumber '*99#'
option proto '3g'
III, it worked. Right away. Okay, let's go first in the simplest way and turn off all the excess on the modem:
ssh root@<точка доступа>
picocom -b 9600 -f n -p n -d 8 -r /dev/ttyUSB1
at^setport="ff;10,12,16,a2"
We exit the combination:
CTRL + A + X
Now turn off usb_modeswitch as unnecessary:
/etc/init.d/usbmode stop
/etc/init.d/usbmode disable
We flip the modem, wait until it boots up and raise the wan interface:
ifup wan
In my case, everything worked now. Hurrah!
Optimization
Initial tuning was carried out without connecting an antenna, now it was interesting to see whether there would be an effect from it.
Signal strength without antenna:
gcom sig -d /dev/ttyUSB1
Signal Quality: 15,99
And now with the antenna:
gcom sig -d /dev/ttyUSB1
Signal Quality: 21,99
It looked so cool that I sensed a catch. And there really was a catch. It was a discovery for me that a good signal from a base station still means nothing.
Below pings for the first and second options:
1.
root@OpenWrt:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8): 56 data bytes
64 bytes from 8.8.8.8: seq=0 ttl=44 time=986.652 ms
64 bytes from 8.8.8.8: seq=1 ttl=44 time=327.628 ms
64 bytes from 8.8.8.8: seq=2 ttl=44 time=246.212 ms
64 bytes from 8.8.8.8: seq=3 ttl=44 time=265.568 ms
64 bytes from 8.8.8.8: seq=4 ttl=44 time=285.271 ms
2.
64 bytes from 8.8.8.8: seq=233 ttl=45 time=1567.306 ms
64 bytes from 8.8.8.8: seq=234 ttl=45 time=1126.106 ms
64 bytes from 8.8.8.8: seq=235 ttl=45 time=569.993 ms
64 bytes from 8.8.8.8: seq=236 ttl=45 time=1403.010 ms
64 bytes from 8.8.8.8: seq=237 ttl=45 time=428.891 ms
And then a new marvelous world of mobile communications opened for me.
I discovered that my modem supports scanning the area for base stations, and not necessarily the operator whose SIM card is installed inside it.
This was done with the following command:
AT^NETSCAN=20,-110,1
20 - how many towers to output
-110 - the minimum signal level is
0/1 - 0 - 2G towers, 1 - 3G towers. With LTE so far.
The list is sorted by signal strength and looks like this:
^NETSCAN: 10638,,,1e7e,250,02,0,-78,8b77,400000
^NETSCAN: 10687,,,1e7e,250,02,0,-79,d5c8,400000
^NETSCAN: 10662,,,1e7e,250,02,0,-82,8ade,400000
^NETSCAN: 10587,,,4cf8,250,20,0,-105,d4fc,400000
^NETSCAN: 10563,,,4cf8,250,20,0,-106,d4f9,400000
1e7e - LAC stations
250 - MCC (Russia)
02 - MNC (In this case - MTS)
-78 - signal level of this base station
8b77 - CID station
400000 - range in which the signal of the base station is received (as in ^ syscfgex command)
Now Having this data, you can go to the site http://xinit.ru/bs/ and see where these towers are located relative to themselves.
As a rule, if there is a directional antenna, then it should be sent to the nearest base station - I thought so. Then the next discovery awaited me. Even if we send an antenna at it, it’s far from the fact that registration will take place at this base station. And if it does, then it is not a fact that the data transfer rate will be higher than through a tower located twice as far from it. So I walked to the nearest stations within a radius of 1.5 kilometers to 3 and all of them, with a good signal, transmitted data with a long delay. Ping averaged ~ 300ms.
While experimenting, I accidentally got to the tower, which was at a distance of 6-7 kilometers from me. Having connected to it, the ping time dropped to ~ 90ms, despite the fact that the signal level fell with it.
For comparison, the signal level from:
nearby towers: 13-20
from the remote tower: 5-12
(measurements were performed by the gcom sig -d / dev / ttyUSB1 utility , where the value can be a digit from 0 to 99).
Nevertheless, I conducted speed tests on the best near tower and on the remote one, the results:
one of the nearest stations - 2 / 0.35 Mbit.
Remote station - 4.28 / 1.68 Mbps.
Honestly, I was stunned by two megabits as well. when using a regular phone, even the Google Play Market did not open. And here, it turns out, you can still accelerate to 4!
Total
Such results were enough for me. I left the antenna to look in the direction of the most distant tower, hoping to always keep in touch with it, but my hopes were naive. A new and yet unresolved problem has arisen. It consists in the fact that from time to time there is registration at another base station, even if it is located in the opposite direction relative to the direction of the antenna. At such moments, delays in data transfer increase, and I have not yet found how to overcome this.
On the Internet, a question such as: “is it possible for the modem to indicate which tower to work with” is answered that you do not choose the tower, but it is you. Perhaps knowledgeable people will tell you if there are solutions for such situations?
That's all. Thanks to all those who read to the end.
PS
Then Simon Beeline came to hand, her towers are closest to us and after connecting the speed test showed as much as 20/2 Megabits. I bring the configuration for Beeline:
vim /etc/config/network
config interface 'wan'
option device /dev/ttyUSB0
option username 'beeline'
option password 'beeline'
option apn 'internet.beeline.ru'
option service 'umts'
option maxwait '0'
option dialnumber '*99#'
option proto '3g'
Resources used
W3bsit3-dns.com.ru
wiki.openwrt.org
xinit.ru/bs/