---
title: "Ethernet easy plug&play Plug&play Ethernet client for Industruino"
url: "https://maker.wiznet.io/gemma/projects/ethernet-easy-plug-play-plug-play-ethernet-client-for-industruino/"
markdown_url: "https://maker.wiznet.io/gemma/projects/ethernet-easy-plug-play-plug-play-ethernet-client-for-industruino/md"
type: "UCC: User Created Content"
author: "Tom"
author_url: "https://industruino.com/blog/our-news-1/post/ethernet-easy-plug-play-38"
editor: "WIZnet"
editor_url: "https://maker.wiznet.io/"
original_author: "Tom"
original_url: "https://industruino.com/blog/our-news-1/post/ethernet-easy-plug-play-38"
published: "2023-02-28"
language: "en"
hardware: ["Arduino Industrial 101"]
likes: 4
views: 325
comments: 1
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# Ethernet easy plug&play Plug&play Ethernet client for Industruino

> This post aims to get you started with the Industruino Ethernet module with a plug&play example sketch.

Original author: Tom (source: https://industruino.com/blog/our-news-1/post/ethernet-easy-plug-play-38)

## Components

- **Arduino Industrial 101** x 1 ([docs](https://docs.arduino.cc/retired/boards/arduino-industrial-101))

## Article

This post aims to get you started with the [Industruino Ethernet module](https://github.com/Industruino/documentation/blob/master/ethernet.md) with a plug&play example sketch. It uses a common HTTP GET request that can be easily modified for any API, or any specific TCP communication. The sketch requires 3 libraries:

- [Ethernet2](https://github.com/Industruino/Ethernet2) this needs to be the Industruino version, as the SPI speed needs to be set to 4MHz

- [UC1701](https://github.com/Industruino/UC1701) for the Industruino LCD

- [Adafruit_SleepyDog](https://github.com/adafruit/Adafruit_SleepyDog) for watchdog reset functionality

The sketch does the following:

1. Enable the watchdog timer with an interval of 20 seconds: if the code hangs for some reason so the watchdog does not get reset within 20 seconds, the unit reboots

2. MAC address: the Industruino D21G has a unique MAC address stored in the EEPROM of the RTC, this 8-byte MAC is retrieved and formatted to 6 bytes for IPv4

3. Check ETH module: the Ethernet module has 8KB non-volatile FRAM memory; we use this to check whether the module is connected by writing/reading a flag at address 0 of the FRAM

4. Start Ethernet: we can use a fixed IP address, or request via DHCP, using the parameter USE_DHCP at the top of the sketch

5. Connect to server: the sketch loop makes a connection to the TCP_SERVER at port TCP_SERVER_PORT

6. HTTP GET request: if a connection is established, the sketch retrieves www.arduino.cc/latest.txt and looks for the '200 OK' reply

7. If the connection to the server fails, Ethernet is restarted

8. At the start of the loop, the watchdog timer is reset

In case the ETH module is not connected, the sketch stops, which triggers a watchdog reset after 20 seconds.

In case USE_DHCP is set to 1 but no IP address is assigned by a DHCP server, the sketch also stops, and the watchdog will trigger a reset.

Open the Serial Monitor to see diagnostics, and most info is also displayed on the LCD.

Below is the code, also on [github](https://github.com/Industruino/Ethernet2/tree/master/examples/IndustruinoEthernetClient).

![](https://maker.wiznet.io/upload/ckeditor5/691904241%5F1677568784%2Epng)

---

Source: https://maker.wiznet.io/gemma/projects/ethernet-easy-plug-play-plug-play-ethernet-client-for-industruino/
