3G Modem and MikroTik
It all started when the Internet disappeared at home. I have two wired operators connected and both have become unavailable. Later it turned out that the electricity in the neighboring house was turned off. Having missed another hour without the Internet, I remembered about the ZTE MF112 3G modem . Connected to a computer, but this was not enough, I also wanted working Wi-Fi in the apartment. For this reason, I connected it to my MikroTik RouterBoard 951g-2hnd . This is what I will tell.
In MikroTik RouterBoard 951g-2hnd one USB port. For convenience, I connected a 3G modem via a small USB extension cable and proceeded to the settings:
We look at which devices are available to us via USB:
We look at the ports, and most importantly the number of channels (3 channels from 0 to 2):
Now connect to the modem and configure its operation (we select the channel by brute force, waiting for the AT command to enter the response OK . I got the channel 1 and 2.):
First, reset to factory settings:
Let's look at our modem:
Let's check the network / SIM lock
here + ZSEC: N, X
N - Network Lock Status:
0 Encryption Initialization (Minor SEC_ITEMS)
1 Network Lock errors. (Minor SEC_ITEMS)
2 Network Lock
3 unlocked or fix MCC / MNC
X - SIM Lock Status:
0 No action
1 Network Lock
2 (U) SIM Card Lock
3 Network Lock and (U) SIM Card Lock
Signal level:
In decibels ( X = 17): -113 + X * 2 = -113 + 17 * 2 = -79 dB
Find out SIM IMSI number:
Next, turn off the virtual CDROM:
Choose the operating mode:
AT + ZSNT = 0,0, 0 (Auto) - default
AT + ZSNT = 0,0,1 Automatic network selection: GSM + WCDMA, GSM preference
AT + ZSNT = 0,0,2 Automatic network selection: GSM + WCDMA, WCDMA preference
AT + ZSNT = 1 , 0,0 Automatic network selection: only GSM
AT + ZSNT = 2,0,0 Automatic network selection: only WCDMA
AT + ZSNT = 0,1,0 Manual network selection: GSM + WCDMA
AT + ZSNT = 1,1,0 Manual network selection: only GSM
AT + ZSNT = 2.1.0Manual network selection: only WCDMA
I selected Automatic network selection: GSM + WCDMA, preference WCDMA :
Now we all save the data in the current profile:
Press Ctrl-A
and Q
To do this, we need the following initial data (example on the MTS operator):
Moreover:
A new ppp-out1 connection should appear in the interfaces :
Configure it:
and connect:
There is an interne, but you have to pay for it, and for this you need to monitor the balance. To do this, I used the SMS assistant . You can use USSD requests (# 100 # to find out the balance from MTS), but they are available only through the console, a command of the form:
We will receive a response:
And after a while the line:
Message “00420061006C0061006E00630065003A00370031002C0032003000720020” is a message in UCS-2 encoding that can be decrypt using this resource.
This approach is not very convenient, for this reason it is more appropriate to use an SMS assistant.
At MTS, to receive an SMS with a balance, you need to send a message to number 111 with the text 11. This is done like this (the channel was selected by brute force):
Next, read the incoming messages and wait for ours ( secret is equal to any line):
We get an empty message from 111. The fact is that Mikrotik can only work with SMS text messages, but there is no PDU.
You must force the SMS assistant to send messages in text form. To do this, just send an SMS to the number +79126313431 with the text Eng (This is for the MTS operator):
We look:
We are trying to get a balance again:
We look:
Now we can receive SMS messages.
I will only describe MTS. I had his SIM card (actually, like a modem - but this is fixable )
Tariff: Super MTS and most importantly it is the MiniBIT option , which allows you to pay for the Internet only on the day when we need it - 15 rubles. The minus is the daily quota of 5 MB, then the speed drops to 32 Kbps.
Tariff: Connect-4 (Switching to this tariff is not available from all tariffs) and the option "Internet for a day" , it allows you to pay for the Internet, only on the day when we need it - 30 rubles. The minus is the daily quota of 250 MB, then the speed drops to 64 Kbps.
If anyone knows more favorable similar tariffs / options, then please share.
So here I organized an emergency Internet channel just in case.
Modem Setup
In MikroTik RouterBoard 951g-2hnd one USB port. For convenience, I connected a 3G modem via a small USB extension cable and proceeded to the settings:
We look at which devices are available to us via USB:
system resource usb print
# DEVICE VENDOR NAME SPEED
1 1:2 ZTE,Incorporated ZTE WCDMA Technologies MSM 480 Mbps
In WinBox
We look at the ports, and most importantly the number of channels (3 channels from 0 to 2):
port print
Flags: I - inactive
# NAME CHANNELS USED-BY BAUD-RATE
0 usb1 3 9600
In WinBox
Now connect to the modem and configure its operation (we select the channel by brute force, waiting for the AT command to enter the response OK . I got the channel 1 and 2.):
system serial-terminal port=usb1 channel=1
[Ctrl-A is the prefix key]
AT
OK
First, reset to factory settings:
AT&F
OK
Let's look at our modem:
ATI
Manufacturer: ZTE CORPORATION
Model: MF112
Revision: BD_MF112V1.0.0B01
IMEI: 35***********54
+GCAP: +CGSM,+DS,+ES
OK
Let's check the network / SIM lock
AT+ZSEC?
+ZSEC: 3,0
OK
here + ZSEC: N, X
N - Network Lock Status:
0 Encryption Initialization (Minor SEC_ITEMS)
1 Network Lock errors. (Minor SEC_ITEMS)
2 Network Lock
3 unlocked or fix MCC / MNC
X - SIM Lock Status:
0 No action
1 Network Lock
2 (U) SIM Card Lock
3 Network Lock and (U) SIM Card Lock
Signal level:
AT+CSQ
+CSQ: 17,99
OK
In decibels ( X = 17): -113 + X * 2 = -113 + 17 * 2 = -79 dB
Find out SIM IMSI number:
AT+CIMI
25***********56
OK
Next, turn off the virtual CDROM:
AT+ZCDRUN=E
Enter download mode result(0:FAIL 1:SUCCESS):1
OK
AT+ZCDRUN=8
Close autorun state result(0:FAIL 1:SUCCESS):1
OK
Choose the operating mode:
AT + ZSNT = 0,0, 0 (Auto) - default
AT + ZSNT = 0,0,1 Automatic network selection: GSM + WCDMA, GSM preference
AT + ZSNT = 0,0,2 Automatic network selection: GSM + WCDMA, WCDMA preference
AT + ZSNT = 1 , 0,0 Automatic network selection: only GSM
AT + ZSNT = 2,0,0 Automatic network selection: only WCDMA
AT + ZSNT = 0,1,0 Manual network selection: GSM + WCDMA
AT + ZSNT = 1,1,0 Manual network selection: only GSM
AT + ZSNT = 2.1.0Manual network selection: only WCDMA
I selected Automatic network selection: GSM + WCDMA, preference WCDMA :
AT+ZSNT=0,0,2
OK
Now we all save the data in the current profile:
AT&W
OK
Press Ctrl-A
[Q - quit connection] [B - send break]
[A - send Ctrl-A prefix] [R - autoconfigure rate]
and Q
Welcome back!
In WinBox
no ability to work with serial-terminal
Connection setup
To do this, we need the following initial data (example on the MTS operator):
- APN : internet.mts.ru
- Phone : * 99 #
- User : mts
- Password : mts
Moreover:
- port the modem is connected to: usb1
- numbers of data and info channels: 2 and 1 (picked up by brute force)
A new ppp-out1 connection should appear in the interfaces :
interface print
Flags: D - dynamic, X - disabled, R - running, S - slave
# NAME TYPE MTU L2MTU MAX-L2MTU MAC-ADDRESS
12 X ppp-out1 ppp-out
Configure it:
and connect:
Receiving / Sending SMS
There is an interne, but you have to pay for it, and for this you need to monitor the balance. To do this, I used the SMS assistant . You can use USSD requests (# 100 # to find out the balance from MTS), but they are available only through the console, a command of the form:
AT+CUSD=1,#100#,15
We will receive a response:
OK
And after a while the line:
+CUSD: 0,"00420061006C0061006E00630065003A00370031002C0032003000720020",72
Message “00420061006C0061006E00630065003A00370031002C0032003000720020” is a message in UCS-2 encoding that can be decrypt using this resource.
This approach is not very convenient, for this reason it is more appropriate to use an SMS assistant.
At MTS, to receive an SMS with a balance, you need to send a message to number 111 with the text 11. This is done like this (the channel was selected by brute force):
tool sms send usb1 phone-number=111 message=11 channel=1
Next, read the incoming messages and wait for ours ( secret is equal to any line):
tool sms set channel=1 port=usb1 keep-max-sms=10 receive-enabled=yes secret=blabla
tool sms inbox print
In WinBox
We get an empty message from 111. The fact is that Mikrotik can only work with SMS text messages, but there is no PDU.
You must force the SMS assistant to send messages in text form. To do this, just send an SMS to the number +79126313431 with the text Eng (This is for the MTS operator):
tool sms send usb1 phone-number=+79126313431 channel=1 message=Eng
We look:
tool sms inbox print
# PHONE TIMESTAMP MESSAGE
0 +79126313431 Jul/30/2013 14:08:40 GMT +6 Now you are a default language user
1 111 Jul/30/2013 14:07:33 GMT +6
We are trying to get a balance again:
tool sms send usb1 phone-number=111 message=11 channel=1
We look:
tool sms inbox print
# PHONE TIMESTAMP MESSAGE
0 111 Jul/30/2013 14:09:20 GMT +6 Vash balans:117,5 rub. sms
1 +79126313431 Jul/30/2013 14:08:40 GMT +6 Now you are a default language user
2 111 Jul/30/2013 14:07:33 GMT +6
Now we can receive SMS messages.
Rate
I will only describe MTS. I had his SIM card (actually, like a modem - but this is fixable )
Tariff: Super MTS and most importantly it is the MiniBIT option , which allows you to pay for the Internet only on the day when we need it - 15 rubles. The minus is the daily quota of 5 MB, then the speed drops to 32 Kbps.
Tariff: Connect-4 (Switching to this tariff is not available from all tariffs) and the option "Internet for a day" , it allows you to pay for the Internet, only on the day when we need it - 30 rubles. The minus is the daily quota of 250 MB, then the speed drops to 64 Kbps.
If anyone knows more favorable similar tariffs / options, then please share.
So here I organized an emergency Internet channel just in case.