mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-11-03 16:11:37 +01:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
<title>ESP MODEM — esp-modem documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/alabaster.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="C API Documentation" href="api_docs.html" />
<link rel="prev" title="ESP-MODEM Programmers manual" href="index.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head><body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="esp-modem">
<h1>ESP MODEM<a class="headerlink" href="#esp-modem" title="Permalink to this headline">¶</a></h1>
<p>This component is used to communicate with modems in the command mode (using AT commands), as well as the data mode
(over PPPoS protocol).
The modem device is modeled with a DCE (Data Communication Equipment) object, which is composed of:</p>
<ul class="simple">
<li><p>DTE (Data Terminal Equipment), which abstracts the terminal (currently only UART implemented).</p></li>
<li><p>PPP Netif representing a network interface communicating with the DTE using PPP protocol.</p></li>
<li><p>Module abstracting the specific device model and its commands.</p></li>
</ul>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span> <span class="o">+-----+</span>
<span class="o">|</span> <span class="n">DTE</span> <span class="o">|--+</span>
<span class="o">+-----+</span> <span class="o">|</span> <span class="o">+-------+</span>
<span class="o">+-->|</span> <span class="n">DCE</span> <span class="o">|</span>
<span class="o">+-------+</span> <span class="o">|</span> <span class="o">|</span><span class="n">o</span><span class="o">---</span> <span class="n">set_mode</span><span class="p">(</span><span class="n">command</span><span class="o">/</span><span class="n">data</span><span class="p">)</span>
<span class="o">|</span> <span class="n">Module</span><span class="o">|--->|</span> <span class="o">|</span>
<span class="o">+-------+</span> <span class="o">|</span> <span class="o">|</span><span class="n">o</span><span class="o">---</span> <span class="n">send_commands</span>
<span class="o">+->|</span> <span class="o">|</span>
<span class="o">+------+</span> <span class="o">|</span> <span class="o">+-------+</span>
<span class="o">|</span> <span class="n">PPP</span> <span class="o">|--+</span>
<span class="o">|</span> <span class="n">netif</span><span class="o">|------------------></span> <span class="n">network</span> <span class="n">events</span>
<span class="o">+------+</span>
</pre></div>
</div>
<section id="modem-components">
<h2>Modem components<a class="headerlink" href="#modem-components" title="Permalink to this headline">¶</a></h2>
<section id="dce">
<h3>DCE<a class="headerlink" href="#dce" title="Permalink to this headline">¶</a></h3>
<p>This is the basic operational unit of the esp_modem component, abstracting a specific module in software,
which is basically configured by</p>
<ul class="simple">
<li><p>the I/O communication media (UART), defined by the DTE configuration</p></li>
<li><p>the specific command library supported by the device model, defined with the module type</p></li>
<li><p>network interface configuration (PPPoS config in lwip)</p></li>
</ul>
<p>After the object is created, the application interaction with the DCE is in</p>
<ul class="simple">
<li><p>issuing specific commands to the modem</p></li>
<li><p>switching between data and command mode</p></li>
</ul>
</section>
<section id="dte">
<h3>DTE<a class="headerlink" href="#dte" title="Permalink to this headline">¶</a></h3>
<p>Is an abstraction of the physical interface connected to the modem. Current implementation supports only UART</p>
</section>
<section id="ppp-netif">
<h3>PPP netif<a class="headerlink" href="#ppp-netif" title="Permalink to this headline">¶</a></h3>
<p>Is used to attach the specific network interface to a network communication protocol used by the modem. Currently implementation supports only PPPoS protocol.</p>
</section>
<section id="module">
<h3>Module<a class="headerlink" href="#module" title="Permalink to this headline">¶</a></h3>
<p>Abstraction of the specific modem device. Currently the component supports SIM800, BG96, SIM7600.</p>
</section>
</section>
<section id="use-cases">
<h2>Use cases<a class="headerlink" href="#use-cases" title="Permalink to this headline">¶</a></h2>
<p>Users interact with the esp-modem using the DCE’s interface, to basically</p>
<ul class="simple">
<li><p>Switch between command and data mode to connect to the internet via cellular network.</p></li>
<li><p>Send various commands to the device (e.g. send SMS)</p></li>
</ul>
<p>The applications typically register handlers for network events to receive notification on the network availability and
IP address changes.</p>
<p>Common use cases of the esp-modem are also listed as the examples:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">examples/pppos_client</span></code> – simple client which reads some module properties and switches to the data mode to connect to a public mqtt broker.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">examples/modem_console</span></code> – is an example to exercise all possible module commands in a console application.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">examples/ap_to_pppos</span></code> – this example focuses on the network connectivity of the esp-modem and provides a WiFi AP that forwards packets (and uses NAT) to and from the PPPoS connection.</p></li>
</ul>
</section>
<section id="extensibility">
<h2>Extensibility<a class="headerlink" href="#extensibility" title="Permalink to this headline">¶</a></h2>
<section id="cmux">
<h3>CMUX<a class="headerlink" href="#cmux" title="Permalink to this headline">¶</a></h3>
<p>Implementation of virtual terminals is an experimental feature, which allows users to also issue commands in the data mode,
after creating multiple virtual terminals, designating some of them solely to data mode, others solely to command mode.</p>
</section>
<section id="dte-s">
<h3>DTE’s<a class="headerlink" href="#dte-s" title="Permalink to this headline">¶</a></h3>
<p>Currently we support only UART, but modern modules support other communication interfaces, such as USB, SPI.</p>
</section>
<section id="other-devices">
<h3>Other devices<a class="headerlink" href="#other-devices" title="Permalink to this headline">¶</a></h3>
<p>Adding a new device is a must-have requirement for the esp-modem component. Different modules support different commands,
or some commands might have a different implementation. Adding a new device means to provide a new implementation
as a class derived from <code class="docutils literal notranslate"><span class="pre">GenericModule</span></code>, where we could add new commands or modify the existing ones.</p>
</section>
</section>
</section>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="index.html">esp-modem</a></h1>
<h3>Navigation</h3>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Brief intro</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#modem-components">Modem components</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#dce">DCE</a></li>
<li class="toctree-l3"><a class="reference internal" href="#dte">DTE</a></li>
<li class="toctree-l3"><a class="reference internal" href="#ppp-netif">PPP netif</a></li>
<li class="toctree-l3"><a class="reference internal" href="#module">Module</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#use-cases">Use cases</a></li>
<li class="toctree-l2"><a class="reference internal" href="#extensibility">Extensibility</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#cmux">CMUX</a></li>
<li class="toctree-l3"><a class="reference internal" href="#dte-s">DTE’s</a></li>
<li class="toctree-l3"><a class="reference internal" href="#other-devices">Other devices</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="api_docs.html">C interface</a></li>
<li class="toctree-l1"><a class="reference internal" href="cxx_api_docs.html">C++ interface</a></li>
<li class="toctree-l1"><a class="reference internal" href="advanced_api.html">Advanced use cases</a></li>
<li class="toctree-l1"><a class="reference internal" href="internal_design.html">Internal design</a></li>
<li class="toctree-l1"><a class="reference internal" href="internal_docs.html">Internal implementation</a></li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li>Previous: <a href="index.html" title="previous chapter">ESP-MODEM Programmers manual</a></li>
<li>Next: <a href="api_docs.html" title="next chapter">C API Documentation</a></li>
</ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©2016 - 2021, Espressif Systems (Shanghai) Co., Ltd.
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 4.5.0</a>
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.12</a>
|
<a href="_sources/README.md.txt"
rel="nofollow">Page source</a>
</div>
</body>
</html>