---
title: "IP Raw code setup arduino"
url: "https://maker.wiznet.io/forum/13159"
markdown_url: "https://maker.wiznet.io/forum/13159/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "hayabusaxps"
created: "2019-01-02T04:27:46+09:00"
last_activity: "2019-02-01T22:21:26+09:00"
language: "en"
views: 3543
replies: 11
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# IP Raw code setup arduino

## Question

Asked by hayabusaxps on 2019-01-02 in Ethernet Chips.

i have copied everything for the IPRAW and even tried UDP manual coding into the void loop, have the w5100 function in regular modes, but when i add the code in the manual. tons of variables are not initialized and many do not match the w5100.h providied in the arduino library.

i need some guidance on setting up the IPRAW listed in the
W5100_Datasheet.

5.2.3 IP raw
or
5.2.2 UDP
to get me started.

i understand whats trying to be done but in the datashet code it is incomplete.
there is alot missing, something missing for it to be complete code. either libraries or something.
and i have not worked with wiznet chips alot so i dont have the background to know exactly what is missing because variables in my arduino default libraries vs your datasheets change some variable names so it is harder to follow.

## Replies

### Reply 1 by hayabusaxps, 2019-01-02

i tried utilizing the W5100_Driver_V190 but theres still so much that doesnt match and errors, what libraries can i use that will allow me to get some compatible code, from the w5100 datasheet.

please guidance to make the code in the datasheet run, why is it so incomplete as a guide?
cant we get an example code, that already runs?

### Reply 2 by jameskim, 2019-01-03 (in reply to reply 1)

Hello hayabusaxps,

We have two kinds of informations for you.
One is our standard IPRAW example and the other is reference code for Arduino library users.
For standard example,
please refer to below link.

<https://wizwiki.net/wiki/lib/exe/fetch.php?media=products:w5100s:application:w5100s_evb_an_coide_ipraw_v100.zip.zip>

For arduino library users,
Please refer to the below links.

1. github

![](https://github.githubassets.com/favicons/favicon.svg) [GitHub](https://github.com/BlakeFoster/Arduino-Ping)

![](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/b/b0848aa9423d8d3d2c15927ebd80f0e235f490dc.png)

### [GitHub - BlakeFoster/Arduino-Ping: ICMP ping library for the Arduino](https://github.com/BlakeFoster/Arduino-Ping)

ICMP ping library for the Arduino. Contribute to BlakeFoster/Arduino-Ping development by creating an account on GitHub.

1. arduino playground
   [Arduino Playground - ICMP Ping Library](https://playground.arduino.cc/Code/ICMPPing)

Thank you.

James.

### Reply 3 by hayabusaxps, 2019-01-03

this is for the w5100s
is this also compatible with the w5100?

also is there no readme for (w5100s_evb_an_coide_ipraw_v100.zip.zip) the zip on its execution?

these are alot of files for a simple IPRAW, which are required to just run a IPRAW, and is the main.c the starting file/where (i can start modifying here for my IPraw call) the code for IPRAW starts running?

### Reply 4 by irina, 2019-01-03

Hi hayabusaxps,

The start function of ping test is ping_auto() of main.c

Functionally, W5100 is very similar to W5100S, with slightly different Hardware Specification.
And Software can be shared. For example, Software written for the W5100S is compatible with Hardware for the W5100. However, there are some differences between W5100S and W5100 have in Software and Hardware.

Download

- 1. [Comparision Document(W5100 and W5100S)](https://wizwiki.net/wiki/lib/exe/fetch.php?media=products:w5100s:w5100s_cp_v100e.pdf)

- 1. [W5100S IPRAW](https://wizwiki.net/wiki/doku.php?id=products:w5100s:application:ipraw)

### Reply 5 by hayabusaxps, 2019-01-03

these are the same file links, but let me start some analysis (tomorrow night) on the code you sent, there should be an initialization of Sn_MR = …; /* sets IP raw mode */ somewhere and then i just need to start adapting the code to just read the socket register data or?

### Reply 6 by irina, 2019-01-09

Hi~
Sorry for late reply.

Download Code Link : [W5100S IPRAW code](https://wizwiki.net/wiki/doku.php?id=products:w5100s:application:ipraw)
`return_len = ping_auto(0, pDestaddr, request_flag);`
→ This code is start point of IPRAW mode

```
/* Create SOCKET */
IINCHIP_WRITE(Sn_PROTO(s), IPPROTO_ICMP); // set ICMP Protocol
if(socket(s,Sn_MR_IPRAW,port,0)!=s){ // open the SOCKET with IPRAW Mode, if fail then Error
```

### Reply 7 by hayabusaxps, 2019-01-09

thank you very much.
i was sent to new mexico to work on another project until next week. i will continue programming the wiznet when i return. that you for your help!

i was thinking about where the ipraw starts when looking over the code and thought that if we were pinging manually it must. have a control of the data ipraw somewhere.

### Reply 8 by irina, 2019-01-11

Feel free to ask any questions.
We will be waiting for you~
![:slight_smile:](https://emoji.discourse-cdn.com/twitter/slight_smile.png?v=12)

### Reply 9 by hayabusaxps, 2019-02-01

mmmmm. i have tried all of the Arduino-Ping from git hub and none of the examples are functional to test the code following their examples. it says it errors when verifying the code.

from what i have read i would have to recode your example code into arduino to function as its written in a different language. arduino has small differences from c++ i assume.

Arduino: 1.8.8 (Windows 10), Board: “Arduino Due (Programming Port)”

C:\Users\Carpenter\Documents\Arduino\libraries\icmp_ping\ICMPPing.cpp: In member function ‘Status ICMPPing::sendEchoRequest(const IPAddress&, const ICMPEcho&)’:

C:\Users\Carpenter\Documents\Arduino\libraries\icmp_ping\ICMPPing.cpp:184:11: error: ‘class W5100Class’ has no member named ‘send_data_processing’

```
 W5100.send_data_processing(_socket, serialized, sizeof(ICMPEcho));

       ^
```

C:\Users\Carpenter\Documents\Arduino\libraries\icmp_ping\ICMPPing.cpp: In member function ‘void ICMPPing::receiveEchoReply(const ICMPEcho&, const IPAddress&, ICMPEchoReply&)’:

C:\Users\Carpenter\Documents\Arduino\libraries\icmp_ping\ICMPPing.cpp:207:19: error: ‘class W5100Class’ has no member named ‘getRXReceivedSize’

```
     if (W5100.getRXReceivedSize(_socket) < 1)

               ^
```

C:\Users\Carpenter\Documents\Arduino\libraries\icmp_ping\ICMPPing.cpp:219:9: error: ‘class W5100Class’ has no member named ‘read_data’

W5100.read_data(_socket, (uint16_t) buffer, ipHeader, sizeof(ipHeader));

```
     ^
```

C:\Users\Carpenter\Documents\Arduino\libraries\icmp_ping\ICMPPing.cpp:229:9: error: ‘class W5100Class’ has no member named ‘read_data’

W5100.read_data(_socket, (uint16_t) buffer, serialized, dataLen);

```
     ^
```

exit status 1
Error compiling for board Arduino Due (Programming Port).

This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.

### Reply 10 by hayabusaxps, 2019-02-01 (in reply to reply 9)

it seems i am also not the only 1 who has issues,

[forum.pjrc.com](https://forum.pjrc.com/threads/41633-ICMP-ping-library-not-working-with-Teensy)

### [ICMP ping library not working with Teensy](https://forum.pjrc.com/threads/41633-ICMP-ping-library-not-working-with-Teensy)

I'm using the ICMP ping library on the Arduinos with W5100: https://github.com/BlakeFoster/Arduino-Ping It's not working on the Teensy with Pauls ethernet lib - it does not compile and if i don't know if it would work with the W5500. First it...

### Reply 11 by hayabusaxps, 2019-02-01

for others:

![](https://maker.wiznet.io/forum_uploads/wiznet/original/2X/5/5d55c344795dbba8393240b448a16f0b95b532eb.png) [Arduino Forum – 18 Apr 13](https://forum.arduino.cc/t/icmp-ping-library-v2-0/157411)

![](https://aws1.discourse-cdn.com/arduino/original/3X/1/f/1f6eb1c9b79d9518d1688c15fe9a4b7cdd5636ae.svg)

### [ICMP ping library v2.0](https://forum.arduino.cc/t/icmp-ping-library-v2-0/157411)

A few years ago I posted my ICMP ping library here. Motivated by a bunch of recent inquiries about it, I’ve released version 2.0 of the library. It now lives in Github: The big improvement over version 1.0 (which was geared more toward a specific...

i was able to finally get a verify code to complete after reverting to
tools> manage libraries> ender ethernet. installed version 1.0. reverting back from 2.0

compatible tested
1.0
1.0.2
1.0.4

not compatible
1.0.5
1.1.0

---

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