|
| 1 | +ESP MODEM |
| 2 | +========= |
| 3 | + |
| 4 | +This component is used to communicate with modems in the command mode |
| 5 | +(using AT commands), as well as the data mode (over PPPoS protocol). The |
| 6 | +modem device is modeled with a DCE (Data Communication Equipment) |
| 7 | +object, which is composed of: |
| 8 | + |
| 9 | +- DTE (Data Terminal Equipment), which abstracts the terminal (currently only UART implemented). |
| 10 | +- PPP Netif representing a network interface communicating with the DTE using PPP protocol. |
| 11 | +- Module abstracting the specific device model and its commands. |
| 12 | + |
| 13 | +:: |
| 14 | + |
| 15 | + +-----+ |
| 16 | + | DTE |--+ |
| 17 | + +-----+ | +-------+ |
| 18 | + +-->| DCE | |
| 19 | + +-------+ | |o--- set_mode(command/data) |
| 20 | + | Module|--->| | |
| 21 | + +-------+ | |o--- send_commands |
| 22 | + +->| | |
| 23 | + +------+ | +-------+ |
| 24 | + | PPP |--+ |
| 25 | + | netif|------------------> network events |
| 26 | + +------+ |
| 27 | + |
| 28 | +Modem components |
| 29 | +---------------- |
| 30 | + |
| 31 | +DCE |
| 32 | +~~~ |
| 33 | + |
| 34 | +This is the basic operational unit of the esp_modem component, |
| 35 | +abstracting a specific module in software, which is basically configured |
| 36 | +by |
| 37 | + |
| 38 | +- the I/O communication media (UART), defined by the DTE configuration |
| 39 | +- the specific command library supported by the device model, defined with the module type |
| 40 | +- network interface configuration (PPPoS config in lwip) |
| 41 | + |
| 42 | +After the object is created, the application interaction with the DCE is |
| 43 | +in |
| 44 | + |
| 45 | +- issuing specific commands to the modem |
| 46 | +- switching between data and command mode |
| 47 | + |
| 48 | +DTE |
| 49 | +~~~ |
| 50 | + |
| 51 | +Is an abstraction of the physical interface connected to the modem. |
| 52 | +Current implementation supports only UART |
| 53 | + |
| 54 | +PPP netif |
| 55 | +~~~~~~~~~ |
| 56 | + |
| 57 | +Is used to attach the specific network interface to a network |
| 58 | +communication protocol used by the modem. Currently implementation |
| 59 | +supports only PPPoS protocol. |
| 60 | + |
| 61 | +Module |
| 62 | +~~~~~~ |
| 63 | + |
| 64 | +Abstraction of the specific modem device. Currently the component |
| 65 | +supports SIM800, BG96, SIM7600. |
| 66 | + |
| 67 | +Use cases |
| 68 | +--------- |
| 69 | + |
| 70 | +Users interact with the esp-modem using the DCE’s interface, to |
| 71 | +basically |
| 72 | + |
| 73 | +- Switch between command and data mode to connect to the internet via cellular network. |
| 74 | +- Send various commands to the device (e.g. send SMS) |
| 75 | + |
| 76 | +The applications typically register handlers for network events to |
| 77 | +receive notification on the network availability and IP address changes. |
| 78 | + |
| 79 | +Common use cases of the esp-modem are also listed as the examples: |
| 80 | + |
| 81 | +- ``examples/pppos_client`` – simple client which reads some module properties and switches to the data mode to connect to a public mqtt broker. |
| 82 | +- ``examples/modem_console`` – is an example to exercise all possible module commands in a console application. |
| 83 | +- ``examples/ap_to_pppos`` – this example focuses on the network |
| 84 | +connectivity of the esp-modem and provides a WiFi AP that forwards |
| 85 | +packets (and uses NAT) to and from the PPPoS connection. |
| 86 | + |
| 87 | +Extensibility |
| 88 | +------------- |
| 89 | + |
| 90 | +CMUX |
| 91 | +~~~~ |
| 92 | + |
| 93 | +Implementation of virtual terminals is an experimental feature, which |
| 94 | +allows users to also issue commands in the data mode, after creating |
| 95 | +multiple virtual terminals, designating some of them solely to data |
| 96 | +mode, others solely to command mode. |
| 97 | + |
| 98 | +DTE’s |
| 99 | +~~~~~ |
| 100 | + |
| 101 | +Currently, we support only UART (and USB as a preview feature), but |
| 102 | +modern modules support other communication interfaces, such as USB, SPI. |
| 103 | + |
| 104 | +Other devices |
| 105 | +~~~~~~~~~~~~~ |
| 106 | + |
| 107 | +Adding a new device is a must-have requirement for the esp-modem |
| 108 | +component. Different modules support different commands, or some |
| 109 | +commands might have a different implementation. Adding a new device |
| 110 | +means to provide a new implementation as a class derived from |
| 111 | +``GenericModule``, where we could add new commands or modify the |
| 112 | +existing ones. |
| 113 | + |
| 114 | +Configuration |
| 115 | +------------- |
| 116 | + |
| 117 | +Modem abstraction is configurable both compile-time and run-time. |
| 118 | + |
| 119 | +Component Kconfig |
| 120 | +~~~~~~~~~~~~~~~~~ |
| 121 | + |
| 122 | +Compile-time configuration is provided using menuconfig. Please check |
| 123 | +the description for the CMUX mode configuration options. |
| 124 | + |
| 125 | +Runtime configuration |
| 126 | +~~~~~~~~~~~~~~~~~~~~~ |
| 127 | + |
| 128 | +Is defined using standard configuration structures for ``DTE`` and |
| 129 | +``DCE`` objects separately. Please find documentation of |
| 130 | + |
| 131 | +- :cpp:class:``esp_modem_dte_config_t`` |
| 132 | +- :cpp:class:``esp_modem_dce_config_t`` |
0 commit comments