⬆️ ⬇️

3G Modem and MikroTik

It all started with the fact that the Internet was gone at home. I have two wired operators connected and both have become unavailable. Later it turned out that in the next house turned off the electricity. After bored for another hour without the Internet, I remembered the ZTE MF112 3G modem. I connected it to a computer, but this was not enough, I also wanted a working Wi-Fi in the apartment. For this reason, I connected it to my MikroTik RouterBoard 951g-2hnd . That's what I'll tell you.

image



Modem setup



MikroTik RouterBoard 951g-2hnd has one USB port. For convenience, I connected a 3G modem through a small USB extension cable and proceeded to the settings:



We look at what 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
image




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
image


')

Now let's connect to the modem and configure its operation (select the channel by searching, waiting for the AT command to respond with OK . I did it with channel 1 and channel 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



Check network / SIM lock

AT+ZSEC?

+ZSEC: 3,0

OK



here + ZSEC: N, X

N - Network lock status:

0 Initialize Encryption (Minor SEC_ITEMS)

1 network lock errors. (SEC_ITEMS Minor)

2 Network lock

3 unlocked or fix MCC / MNC



X - SIM lock status:

0 No action

1 Network Lock

2 (U) SIM Cards 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, disable 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



Select the mode of operation:

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: GSM only

AT + ZSNT = 2.0.0 Automatic network selection: WCDMA only

AT + ZSNT = 0,1,0 Manual network selection: GSM + WCDMA

AT + ZSNT = 1,1,0 Manual network selection: GSM only

AT + ZSNT = 2,1,0 Manual network selection: WCDMA only



I selected Automatic network selection: GSM + WCDMA, WCDMA preference :

AT+ZSNT=0,0,2

OK



All now save the data in the current profile:

AT&W

OK



Hit Ctrl-A

[Q - quit connection] [B - send break]

[A - send Ctrl-A prefix] [R - autoconfigure rate]



and Q

Welcome back!

In WinBox
There is no possibility to work with serial-terminal




Connection setup



To do this, we need the following source data (example on the MTS operator):





Besides:





A new connection ppp-out1 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



Set it up:

image

image



and connect:

image



Receiving / Sending SMS



Internet is, but you have to pay for it, and for this you need to follow the balance. For this, I used the SMS assistant . USSD requests can also be used (# 100 # to find out the balance from MTS), but they are only available via the console, a command like this:

AT+CUSD=1,#100#,15

In response, we get:

OK

And after a while the line:

+CUSD: 0,"00420061006C0061006E00630065003A00370031002C0032003000720020",72

The message “00420061006C0061006E00630065003A00370031002C0032003000720020” is a message in UCS-2 encoding that can be decrypted using this resource.

This approach is not very convenient, for this reason it is more appropriate to use SMS-assistant.



At MTS, in order to receive an SMS with a balance, you need to send a message to number 111 with text 11. This is done like this (the channel was selected by enumeration):

tool sms send usb1 phone-number=111 message=11 channel=1



Next, read the incoming messages and wait for ours ( secret is any line):

tool sms set channel=1 port=usb1 keep-max-sms=10 receive-enabled=yes secret=blabla

tool sms inbox print

In WinBox
image




We receive an empty message from 111. The fact is that Mikrotik can only work with text SMS messages, but there is no PDU.

It is necessary to force the SMS assistant to send messages in text form. To do this, 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



Try again to get the balance:

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 describe only MTS. I had his SIM card (actually, like the modem - but it is fixable )



Tariff: Super MTS and the main thing is the option "Minibit" , 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 (The transition to this tariff is not available from all tariffs) and the option “Internet per day” , it allows you to pay for the Internet, only on the day when we need it - 30 rubles. Minus is the daily quota of 250 MB, then the speed drops to 64Kbps.



If anyone knows more profitable similar tariffs / options, then please share.



This is how I organized an emergency Internet channel just in case.

Source: https://habr.com/ru/post/188424/



All Articles