Skip to content

Commit

Permalink
Update udp_multicast.rst
Browse files Browse the repository at this point in the history
docs/esp32: UDP multicast client/server example.

Signed-off-by: IhorNehrutsa <Ihor.Nehrutsa@gmail.com>
  • Loading branch information
IhorNehrutsa authored and IhorNehrutsa committed Jan 8, 2024
1 parent f5a54a4 commit 8ea5232
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/esp32/quickref.rst
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ These are working configurations for LAN interfaces of popular boards::
lan = network.LAN(id=0, mdc=Pin(23), mdio=Pin(18), power=Pin(5),
phy_type=network.PHY_IP101, phy_addr=1)

UDP MULTICAST
^^^^^^^^^^^^^

See client/server example in the :ref:`esp32_udp_multicast` tutorial.

Delay and timing
----------------

Expand Down
2 changes: 1 addition & 1 deletion docs/esp32/tutorial/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ to `<https://www.python.org>`__.

.. toctree::
:maxdepth: 1
:numbered:

intro.rst
pwm.rst
peripheral_access.rst
udp_multicast.rst
27 changes: 27 additions & 0 deletions docs/esp32/tutorial/udp_multicast.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.. _esp32_udp_multicast:

UDP MULTICAST
=============

Use UDP MULTICAST connections to communicate between two devices in different networks
with IP-addresses 172.16.55.55 and 192.168.44.44.

Run `udp_multicast_client.py <https://github.com/micropython/micropython/blob/master/examples/network/udp_multicast_client.py>`_ on one device.
Client send GET and receive ACK from the server.
Output is::

GET to ('224.0.0.111', 5555) sent "client_ip:172.16.55.55 mac:b8-d6-1a-5a-c2-e4"
ACK from ('192.168.44.44', 5555) received "server_ip:192.168.44.44 mac:24-6f-28-7a-f3-9c"
GET to ('224.0.0.111', 5555) sent "client_ip:172.16.55.55 mac:b8-d6-1a-5a-c2-e4"
ACK from ('192.168.44.44', 5555) received "server_ip:192.168.44.44 mac:24-6f-28-7a-f3-9c"
...

Run `udp_multicast_server.py <https://github.com/micropython/micropython/blob/master/examples/network/udp_multicast_server.py>`_ on another device.
Server receive GET and send ACK to the client.
Output is::

GET from ('172.16.55.55', 5555) received "client_ip:172.16.55.55 mac:b8-d6-1a-5a-c2-e4"
ACK to ('224.0.0.111', 5555) sent "server_ip:192.168.44.44 mac:24-6f-28-7a-f3-9c"
GET from ('172.16.55.55', 5555) received "client_ip:172.16.55.55 mac:b8-d6-1a-5a-c2-e4"
ACK to ('224.0.0.111', 5555) sent "server_ip:192.168.44.44 mac:24-6f-28-7a-f3-9c"
...

0 comments on commit 8ea5232

Please sign in to comment.