Modem-stretch/en: различия между версиями

м
FuzzyBot переименовал страницу GSM/GPRS/en в Modem-stretch/en без оставления перенаправления: Часть переводимой страницы GSM/GPRS.
(Новая страница: «As a supplementary measure to improve reliability in the presence of two connections, we can offer the use of DNS servers that are independent of the provider, fo…»)
м (FuzzyBot переименовал страницу GSM/GPRS/en в Modem-stretch/en без оставления перенаправления: Часть переводимой страницы GSM/GPRS.)
 
(не показаны 22 промежуточные версии 2 участников)
Строка 5: Строка 5:
See the module description for the full list of features:
See the module description for the full list of features:
*3G modem in Wiren Board 5 and Wiren Board 6: [[SIM5300E/en|SIM5300E]]  
*3G modem in Wiren Board 5 and Wiren Board 6: [[SIM5300E/en|SIM5300E]]  
*2G modem in Wiren Board 4, 5 and 6 :[[Special:MyLanguage/SIM800|SIM800]] or [[M660A/en|M660A]];
*2G modem in Wiren Board 4, 5 and 6: SIM800  or [[M660A/en|M660A]];
*Wiren Board Smart Home 3.5, Wiren Board 4:
*Wiren Board Smart Home 3.5, Wiren Board 4:
[[SIM900R/en|SIM900R]].
[[SIM900R/en|SIM900R]].
Строка 186: Строка 186:
As a supplementary measure to improve reliability in the presence of two connections, we can offer the use of DNS servers that are independent of the provider, for example GoogleDNS (8.8.8, 8.8.4.4) and OpenDNS (208.67.222.222, 208.67.220.220). These servers are used frequently to determine the health of the network channel on a specific interface (ping -c5 -I eth0 8.8.8.8 or ping -c5 -I ppp0 8.8.4.4).
As a supplementary measure to improve reliability in the presence of two connections, we can offer the use of DNS servers that are independent of the provider, for example GoogleDNS (8.8.8, 8.8.4.4) and OpenDNS (208.67.222.222, 208.67.220.220). These servers are used frequently to determine the health of the network channel on a specific interface (ping -c5 -I eth0 8.8.8.8 or ping -c5 -I ppp0 8.8.4.4).


Обратите внимание, что при деинициализации ppp0 интерфейса все созданные маршруты, связанные с ним, будут автоматически удалены.
Note that when you deinitialize the ppp0 interface, all created associated with this interface routes will be automatically deleted.




==== Использование GPRS в качестве резервного канала ====
==== Using GPRS as a backup channel ====


Самый простой способ, обеспечить отказоустойчивость, это задать два маршрута по умолчанию с разными метриками, например:
The easiest way to ensure fault tolerance is to specify two default routes with different metrics, for example: for eth0 interface, specify metric 10:
для интерфейса eth0 указать метрику 10:
     auto eth0
     auto eth0
     iface eth0 inet dhcp
     iface eth0 inet dhcp
Строка 199: Строка 198:
     metric 10  
     metric 10  


а для интерфейса метрику 100:
and for the interface metric 100:
     auto ppp0
     auto ppp0
     iface ppp0 inet ppp
     iface ppp0 inet ppp
Строка 208: Строка 207:
     pre-up sleep 10
     pre-up sleep 10


В этом случае, если подключение через eth0 пропадет (обрыв кабеля, отключение коммутатора и т.п.), то маршрутом по умолчанию становится маршрут через интерфейс ppp0.
In this case, if the connection via eth0 is lost (cable disconnection, switch disconnection, etc.), the route via the ppp0 interface becomes the default route.


Для более сложных случаев, когда физическое соединение на интерфейсе eth0 не пропадает, рекомендуется применять скрипты, которые на основе доступности какого-либо сетевого уздла в интернете через один из интерфейсов переключают маршрут по умолчанию. В интернете предлагается множество решений решений такого рода задачи, можно выбрать одно из них.  
For more complex cases where the physical connection on the eth0 interface is not lost, it is recommended to use scripts (based on the availability of any network bridging on the Internet through one of the interfaces) that switch the default route. The Internet offers many solutions to this kind of problem, you can choose one of them.  


Если контроллер обычно подключён к Интернету через Ethernet или Wi-Fi, а GPRS должен использоваться только при неполадках основного канала, такой режим работы называется ''failover''. Обычно он работает так:
If the controller is normally connected to the Internet via Ethernet or Wi-Fi, and GPRS is to be used only in case of a main channel failure, this mode of operation is called ''failover''. It usually works like this:
# Организуется работа через основной канал.
#Work is organized through the main channel.
# Постоянно проверяется наличие доступа в Интернет через основной канал.
#The availability of Internet access through the main channel is constantly checked.
# В случае неполадок запускается запасное соединение, меняются настройки ''default gateway''.
#In case of problems, a backup connection is started and the default gateway settings are changed.
# Основное соединение постоянно проверяется, и если доступ в Интернет через него восстанавливается, система возвращается к работе через него, изменяя ''default gateway''.
#The main connection is constantly checked, and if the internet access is restored through it, the system returns to work via it, changing the ''default gateway''.


В качестве примера укажем две инструкции по организации такого режима работы:
As an example, we specify two instructions for the organization of such a mode of operation:
# http://lstein.github.io/Net-ISP-Balance/
# http://lstein.github.io/Net-ISP-Balance/
# https://serverfault.com/questions/360131/ubuntu-failover-from-ethernet-to-adsl-modem-to-usb-3g-dongle?rq=1
# https://serverfault.com/questions/360131/ubuntu-failover-from-ethernet-to-adsl-modem-to-usb-3g-dongle?rq=1
Строка 224: Строка 223:


<span id="низкоуровневая-работа с модулем через at-команды"></span>
<span id="низкоуровневая-работа с модулем через at-команды"></span>
=== Низкоуровневая работа с модулем через AT-команды ===
=== Low-level work with the module via AT-commands===


Ознакомьтесь с инструкцией - [[Special:MyLanguage/Работа с последовательным портом из Linux|Работа с последовательным портом из Linux]].
Read the instructions - [[Работа с последовательным портом из Linux/en|Working with a serial port from Linux]]. Note the settings: 115200, 8N2, '''no hardware flow control'''.
Обратите внимание на настройки: 115200, 8N2, '''no hardware flow control'''.


Для интерактивного режима:
For interactive mode:
* запускаем '''minicom''' с ключём, создающим профиль работы с портом (скорость передачи данных, чётность, и т.д.):
*run '''minicom''' with the following key that creats the job profile to the port (transmission speed, parity, etc.):
<pre>
<pre>
  $ minicom -s /dev/ttyGSM
  $ minicom -s /dev/ttyGSM
</pre>
</pre>
[[Special:MyLanguage/Файл:Minicom_settings.png|Настройки Minicom]]
[[Файл:Minicom_settings.png|Minicom Settings]]


* Зайти в настройки (нажать ''Ctrl+A'', затем ''O''), выбрать пункт ''Serial port setup'', там установить порт ''/dev/ttyGSM'', скорость и чётность - ''115200, 8N1'', ''Hardware flow control - No'', ''Software flow control - No''
* Go to settings (press ''Ctrl+A'', then ''O''), select ''Serial port setup'', set port ''/dev/ttyGSM'',set speed and parity - ''115200, 8N1'', ''Hardware flow control - No, Software flow control - No''
* Сохранить настройки: ''Save setup as _dev_ttyGSM''
* Save settings: ''Save setup as _dev_ttyGSM''
* Далее запускать как '''minicom /dev/ttyGSM''' (все параметры будут сразу браться из профиля с названием ''/dev/ttyGSM'', который мы ранее создали)
* Then run as '''minicom /dev/ttyGSM''' (all settings will be taken from the profile name ''/dev/ttyGSM'' that we previously created)
* Первой вашей командой должна стать ''AAAAAAAAAT'' - с её помощью модуль распознает скорость, с которой мы к нему обращаемся (смотрите [[Special:MyLanguage/SIM900R|SIM900R]])
* Your first command should be ''AAAAAAAAAT'' - the module automatically detects the communication speed (see [[Special:MyLanguage/SIM900R|SIM900R]])
* Второй командой выполните просто ''AT''. Вам должен прийти ответ '''OK'''
* With the second command, simply run ''AT''. You should get the answer '''OK'''.




==== Примеры команд ====
==== Command examples ====


(некоторые команды могут различаться в разных модулях, смотрите подробнее в документации на модуль)
(some commands may vary for some modules, see the module documentation for details)


* Синхронизовать скорость порта (не совсем команда)
* To synchronize the speed of the port (not a real command)
<pre>
<pre>
AAAAAAAAAAAAAT
AAAAAAAAAAAAAT
</pre>
</pre>
Список всех сетей
All networks list
<pre>
<pre>
AT+COPS=?
AT+COPS=?
</pre>
</pre>
Уровень сигнала (см. [http://m2msupport.net/m2msupport/atcsq-signal-quality/ здесь])
Signal strength  (see [http://m2msupport.net/m2msupport/atcsq-signal-quality/ here])
<pre>
<pre>
AT+CSQ
AT+CSQ
</pre>
</pre>
* Звонок на номер +79154816102
* Dialing +79154816102
<pre>
<pre>
ATD+79154816102;
ATD+79154816102;
</pre>
</pre>
* Установка baud rate порта в фиксированное значение 115200
* Set baud rate port to a fixed value 115200
<pre>
<pre>
AT+IPR=115200
AT+IPR=115200
</pre>
</pre>


* Запрос времени со встроенных в модуль часов реального времени (RTC)
* Request time from the built-in real-time clock (RTC) module
<pre>
<pre>
AT+CCLK?
AT+CCLK?
Строка 274: Строка 272:
</pre>
</pre>


* Получить IMEI-код модуля (xxxxxx - уникальный номер)
* Get module IMEI-code (xxxxxx is a unique number)
<pre>
<pre>
AT+GSN
AT+GSN
Строка 286: Строка 284:




===Мультиплексирование===
===Multiplexing ports===


Модем поддерживает режим мультиплексирования - создание виртуальных портов, через которые можно одновременно работать с модемом.
The modem supports multiplexing mode which creates virtual ports,you can simultaneously work with the modem via these ports. For example, one port can be used to open a PPP session for GPRS, another - to receive and send SMS, check the balance, etc. see [[Special:MyLanguage/CMUX|CMUX]] for details. This mode is not supported for 2G modems.
Например, через один порт можно открыть сессию PPP для GPRS, а через другой получать и отправлять SMS, проверять баланс и т.д.
Подробнее смотрите [[Special:MyLanguage/CMUX|CMUX]]. Этот режим не поддерживается для 2G-модемов.
wb_editors
14 355

правок