---
title: "W5500 as TCP client POSTing failures"
url: "https://maker.wiznet.io/forum/13888"
markdown_url: "https://maker.wiznet.io/forum/13888/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "cellkey"
created: "2020-06-13T07:29:20+09:00"
last_activity: "2020-06-19T05:02:27+09:00"
language: "en"
views: 834
replies: 6
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# W5500 as TCP client POSTing failures

## Question

Asked by cellkey on 2020-06-13 in Ethernet Chips.

Hello all:
I have designed a custom board around W5500 for uploading data logger data to my server.
Every thing is OK until the SEND process:
I am sending a POST in order to get success response from the server as **HTTP/1 200 OK** but most of the time I see that the post string is wrapped with “endless garbage bytes” sent along with it.
The strange thing is that some times it do send the post right and server response is OK!!
I thought that handling of TX_WR is not right but when I got OK few times I got confused
Same code behave differently…

see below log:
**partial log of connection and sending:**

connecting…
.Wait for CONNECT… - waiting for connection loop
.Wait for CONNECT…
.Wait for CONNECT…
.CONNECTed…
wiz5500 connected to server…
.
.SENDing 0x0096 bytes (sending a post to server)
.ptr_WR = 0x00b8 - initiated WR pointer value
.ptr_RD = 0x00b8

.len = 0096. - data lengh
.ddrsel = b810 - writing address

Sending…

.Sn_IR_SENDOK… - data have sent ok
.
.ptr_WR = **004e** - WR pointer after sending ( **expect 0x00B8+0x0096 = 0x014E** )
.ptr_RD = 004e
.
.Socket closed…

Please explain why TX_WR value after sending is not original value + data lengh as expected. Most sig byte is 00 while should be 01…

**POST sent to the server:**

POST /update HTTP/1.1
Host: 178.62.117.121:0080
Content-Type: application/octet-stream
Accept: */*
User-Agent: Creacell/1.0. Content-Length: 0…

***Server response if success*:**

HTTP/1.1 200 OK
X-Powered-By: Express
Date: Fri, 12 Jun 2020 20:20:42 GMT
Connection: keep-alive
Content-Length: 0

Any advise will be much appreciated.
Becky?..
Dan

## Replies

### Reply 1 by bangbh, 2020-06-17

Hi
I tested TX_WR before and after sending bytes. But it works well.
I don’t think it’s a pointer problem. There must be a http protocol problem.

Please refer the link below.

[W5500 - TX_WR pointer math](https://forum.wiznet.io/t/topic/7659/2) [W5500](https://maker.wiznet.io/c/tcp-ip-chip/w5500/18)

> Hello I tested like the picture below. [image] [image] I don’t know exactly how many bytes I sent, but I seems work fine. Thanks.

Thanks.

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

HI:
Thanks for your mail.
I am sure pointer work as expected.

My first problem is that I get a lot of extra bytes when sending regular POST to my server and I wondered whether it
due to pointers handling problem…
It strange because the same code some times does send the POST ok and the server response to it as expected, but its rear…!
Any idea will be very helpful, as I am “studying” the module from scratch…!
Regards
Dan

### Reply 3 by cellkey, 2020-06-17 (in reply to reply 1)

Hi again:
I am using ATMEL uP as my embedded.

Is it possible that I have to change the data structure? (little/big-endian issue)?
Is it possible that W5500 is sending the whole buffer and wrapped to the RX pointer again?
Please advise…
Dan

### Reply 4 by cellkey, 2020-06-17 (in reply to reply 1)

Sorry, in last mail I meant TX pointer, not RX…
Dan

### Reply 5 by bangbh, 2020-06-19

Hi
I don’t think it’s a endian or pointer problem.
Before you do it with our IC, please test it with <https://reqbin.com/> ← this kind of site first.
And if it’s possible,

1. let us know about your test environment more detail.

2. share the wireshark packet capture.

Thanks.

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

Hi Peter:
Problem solved and everything works nice now…
I have recompiled with the last version of ioLibraray files and all have been settled…
Thanks
Dan

---

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