How to create a simple TCP/IP connection?

After all the installation, it is the time for showing how to create a simple TCP connection

In general Software protocol, engineers needs to have a fully understanding about TCP/IP protocol to make it functional. This even required using a lot of space and workload for the processor (MCU) to work with this protocol.

WIZnet’s solution had help user to reduce this kind of pain for developing a functional network feature for you.

Users only need to simply understand the process stage of the Chip and collect the data will be fine.

For coding the Raspberry PI PICO, it required only few steps to activate this progress.

  1. Import libraries – wiznet5k and WIZnet’s socket
  2. Activate and set the GPIO pins for SPI communication and reset pin
  3. Set the network settings
  4. Set your PICO into TCP server
  5. TCP Connection and start communicate with your PICO

For more details, please refer the Git-Hub links below.

The provided example code is an Echo TCP example, the coming post will show you how the received sensor data using TCP to communicate.


  1. WIZnet Ethernet HAT library and examples –
  2. WIZnet offical blog about TCP connection on Ethernet HAT with Raspberry Pi Pico –
  3. WIZnet networking official samples – RP2040-HAT-CircuitPython/ at master · Wiznet/RP2040-HAT-CircuitPython · GitHub
  4. WIZnet HK version samples (include status identification) –
  5. How to setup WIZnet Library into Raspberry Pi Pico –

Used software:

  1. Hercules software:
  2. Thonny:
Step 1: Import Library
Step 2: GPIO setup for SPI and Reset
Step 3: Network Setting
Step 4: Create a TCP server
Step 5: Communication Procedure
Serial Display in Thonny
Received data and return it back to TCP terminal
TCP results