---
title: "W5500 TCP/IP client continuas connection"
url: "https://maker.wiznet.io/forum/13862"
markdown_url: "https://maker.wiznet.io/forum/13862/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "Dan1"
created: "2020-06-01T11:37:03+09:00"
last_activity: "2020-06-19T03:25:54+09:00"
language: "en"
views: 624
replies: 6
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# W5500 TCP/IP client continuas connection

## Question

Asked by Dan1 on 2020-06-01 in Ethernet Chips.

Hi all:

I have designed a data logger board based on ATMEGA644 uP and W5500 chipset.
The goal is to measure 8 temperature sensors and send the data to a server, every 1 second.
I get a connection with the server alright but not sure about the way of handling the socket for continuous SEND() commands (sending a packet of 64 bytes every second)…
Data received by the server is not “clean” and has a lot of “nonsense” material addd to it…
I am “new” with the W5500 and any advice will be appreciated…
Thanks
Dan

## Replies

### Reply 1 by amf99, 2020-06-01

Have you looked at MQTT, not sure how it will handle the every 1 second.

### Reply 2 by cellkey, 2020-06-01 (in reply to reply 1)

Hi, don’t know the term MQTT…
Please explain.
Dan

### Reply 3 by becky, 2020-06-04

[github.com](https://github.com/Wiznet/ioLibrary_Driver/blob/master/Ethernet/socket.c)

#### [Wiznet/ioLibrary_Driver/blob/master/Ethernet/socket.c](https://github.com/Wiznet/ioLibrary_Driver/blob/master/Ethernet/socket.c)

```
//*****************************************************************************
//
//! \file socket.c
//! \brief SOCKET APIs Implements file.
//! \details SOCKET APIs like as Berkeley Socket APIs. 
//! \version 1.0.3
//! \date 2013/10/21
//! \par  Revision history
//!       <2015/02/05> Notice
//!        The version history is not updated after this point.
//!        Download the latest version directly from GitHub. Please visit the our GitHub repository for ioLibrary.
//!        >> https://github.com/Wiznet/ioLibrary_Driver
//!       <2014/05/01> V1.0.3. Refer to M20140501
//!         1. Implicit type casting -> Explicit type casting.
//!         2. replace 0x01 with PACK_REMAINED in recvfrom()
//!         3. Validation a destination ip in connect() & sendto(): 
//!            It occurs a fatal error on converting unint32 address if uint8* addr parameter is not aligned by 4byte address.
//!            Copy 4 byte addr value into temporary uint32 variable and then compares it.
//!       <2013/12/20> V1.0.2 Refer to M20131220
//!                    Remove Warning.
```

This file has been truncated. [show original](https://github.com/Wiznet/ioLibrary_Driver/blob/master/Ethernet/socket.c)

I hope you refer to ioLibrary_Driver.
Implement the send() function in socket.c in your environment, and call the send() function every 1 second counts.

### Reply 4 by Dan1, 2020-06-04

Hi Becky:
I am glad to see your reply and
I would like to have a "channel " to the Wiznet team because I got stacked in developing a project to a client in which I have to send a packet of data (constant size) of sensors every 1 second!
I have designed a special board for it using the W5500 and got to have a connection with the server but data that I send (small string, once, right now) is received with “milliard” of junk bytes and the data itself appeared few times. I am using the iolibrary routines as is to handle the socket, connect, and send activities.
Is socket can be open “forever”? Keep Alive needed?

Urgent help will be much appreciated…
Regards
Dan
cellkey.tech@gmail.com

### Reply 5 by Dan1, 2020-06-12

Becky hi,
I am sending TCP string to host server (len =0x96). I am getting allot of “garbage” before seeing data on screen.
Before sending the WR pointer is ox00FD, after sending it 0x0093, but must be 0x0193 (0x00FD+0x96).
Is that my reading mistake or sending the hole buffer and wrap around to address 0x0093?
Please respond…
Regards
Dan

### Reply 6 by becky, 2020-06-19

![image](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/2/269763db9650e7aeabf8fc62ed614359b0eea33c.png)
In the case of sn_TX_WR, to read 16-bit data, addresses 0x0024 and 0x0025 must be read by 8 bits each. Is this correct?

---

Source: https://maker.wiznet.io/forum/13862
