
:breadcrumbs: <a href="../../index.html">Home</a> / <a href="../../index.html#hardware">Hardware</a> / Ethernet Extension
:shoplink: ../../../shop/master-extensions/ethernet-master-extension.html

.. _ethernet_extension:

Ethernet Extension
==================

.. raw:: html

	{% from "macros.html" import tfdocstart, tfdocimg, tfdocend %}
	{{
	    tfdocstart("Extensions/extension_ethernet_tilted_350.jpg",
	               "Extensions/extension_ethernet_tilted_600.jpg",
	               "Ethernet Extension")
	}}
	{{
	    tfdocimg("Extensions/extension_ethernet_cable_100.jpg",
	             "Extensions/extension_ethernet_cable_600.jpg",
	             "Ethernet Extension with Ethernet cable")
	}}
	{{
	    tfdocimg("Extensions/extension_ethernet_side_100.jpg",
	             "Extensions/extension_ethernet_side_600.jpg",
	             "Ethernet Extension side view")
	}}
	{{
	    tfdocimg("Extensions/extension_ethernet_bottom_100.jpg",
	             "Extensions/extension_ethernet_bottom_600.jpg",
	             "Ethernet Extension bottom")
	}}
	{{
	    tfdocimg("Extensions/extension_ethernet_top_100.jpg",
	             "Extensions/extension_ethernet_top_600.jpg",
	             "Ethernet Extension top")
	}}
	{{ tfdocend() }}

Features
--------

* Communicate directly with Bricks/Bricklets without Brickd
* Supports 10/100 Mbit/s Ethernet (1000 Mbit/s compatible)
* Integrated PoE Power Supply (PD Class 0 for IEEE 802.3af)

 * Can power a Stack via Ethernet Cable



Description
-----------

With this Ethernet Extension you can control 
:ref:`Bricks <primer_bricks>` and
:ref:`Bricklets <primer_bricklets>` and integrate them into a 
`LAN <https://de.wikipedia.org/wiki/Local_Area_Network>`__. 
10BaseT/100BaseTX Ethernet is supported and the module is 1000BaseTX 
compatible. The Extension is available in two variants:
The PoE variant features a integrated 
`PoE <https://en.wikipedia.org/wiki/Power_over_Ethernet>`__
power supply. It allows to power the connected modules over industry standard
IEEE 802.3af, such that a PoE injector as well as PoE 
switches can be used to power :ref:`stacks <primer_stack>`. 
Additionally a variant without PoE is available.

Since the device itself handles TCP/IP packages generated by the API, it is 
possible to connect directly from your controlling device 
(mobile phone, tablet, (embedded) PC). A :ref:`Brick Daemon <brickd>` is not 
necessary.

To use the Ethernet Extension a :ref:`Master Brick <master_brick>` or
:ref:`RED Brick <red_brick>` is mandatory.
If you want to use other Bricks, you can build a stack and plug them also on top
of the Master Brick or RED Brick. If you want to use Bricklets you can attach them to the 
Bricks in the stack. From the programming perspective
this is completely transparent, i.e. all Bricks and Bricklets can
be used exactly the same way as if they were connected to your controlling device via USB.

You need a Master Brick with firmware version 2.1.0 or newer to use this 
extension.

The following combinations with other Extensions in a stack are possible 
(regardless of order):

* Ethernet / RS485 Master

Technical Specifications
------------------------

================================  ============================================================
Property                          Value
================================  ============================================================
Current Consumption               100mA (average), 175mA (maximum)
PoE 5V Power Supply               > 1A
--------------------------------  ------------------------------------------------------------
--------------------------------  ------------------------------------------------------------
Ethernet Support                  10BaseT/100BaseTX, 1000BaseTX compatible
Maximum Concurrent Connections    7
--------------------------------  ------------------------------------------------------------
--------------------------------  ------------------------------------------------------------
Dimensions (W x D x H)            40 x 40 x 16mm (1.57 x 1.57 x 0.63")
Weight                            22g
================================  ============================================================


Resources
---------

* W5200 Datasheet (`Download <https://github.com/Tinkerforge/ethernet-extension/raw/master/datasheets/W5200.pdf>`__)
* Schematic (`Download <https://github.com/Tinkerforge/ethernet-extension/raw/master/hardware/ethernet-extension-schematic.pdf>`__)
* Outline and drilling plan (`Download <../../_images/Dimensions/ethernet_extension_dimensions.png>`__)
* Source code and design files (`Download <https://github.com/Tinkerforge/ethernet-extension>`__)


.. _ethernet_configuration:

Ethernet Configuration
^^^^^^^^^^^^^^^^^^^^^^

The Ethernet Extension can be configured in two different modes:
DHCP or static IP. If you use a static IP you have to enter 
**IP**, **Subnet Mask** and **Gateway**.

The MAC address of the Ethernet Extension is not fixed in hardware, it will be
allocated by Tinkerforge. If it is lost in the EEPROM it can be found on the
sticker of the Ethernet Extension.

After configuring the Ethernet Extension you have to press the button
"Save Ethernet Configuration" and restart the Master Brick.

.. image:: /Images/Extensions/extension_ethernet_brickv.jpg
   :scale: 100 %
   :alt: Ethernet Extension Configuration
   :align: center
   :target: ../../_images/Extensions/extension_ethernet_brickv.jpg


.. _ethernet_configuration_websockets:

WebSockets
""""""""""

The Ethernet Extension supports `WebSockets
<http://en.wikipedia.org/wiki/WebSocket>`__ since Master Brick firmware
version 2.2.0. The "Max Connections" option allows to freely divide the seven
Sockets of the Ethernet Extension between plain and WebSockets connections.

WebSockets are used by the browser version of the :ref:`JavaScript bindings
<api_bindings_javascript>` to control Bricks and Bricklets.


.. _ethernet_configuration_authentication:

Authentication
""""""""""""""

The Ethernet Extension supports authentication since Master Brick firmware
version 2.2.0. Authentication is disabled by default. Tick the "Use
Authentication" check box and choose an authentication secret to enable it.
This secret can be 64 ASCII characters long. After saving the configuration
and restarting the Master Brick authentication is enabled.

Now every TCP/IP connection to the Ethernet Extension has to prove to the
Master Brick that it knows the authentication secret before normal communication
can occur. See the :ref:`authentication tutorial <tutorial_authentication>`
for more information.


PoE Power Supply
^^^^^^^^^^^^^^^^

PoE injectors can be used to power Bricks and Bricklets over Ethernet.
The Ethernet Extension will power the complete stack.
Activated PoE will be signaled by a green LED on the Ethernet Extension.

Servos and (stepper-) motors connected to DC-, Servo- or Stepper Bricks can not
be powered by PoE since the PoE voltage typically is too high.

The Ethernet Extension can be used together with a Step-Down Power Supply.


Programming Interface
---------------------

See :ref:`Master Brick Documentation <master_brick_programming_interface>`.
