# Arduino \> photon library

**URL:** <https://community.particle.io/t/arduino-photon-library/18622>\
**Category:** Libraries\
**Created:** [December 29, 2015, 4:44pm UTC](https://community.particle.io/t/arduino-photon-library/18622 "2015-12-29T16:44:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lindstrom1989](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/lindstrom1989/32/8212_2.png) [@lindstrom1989](https://community.particle.io/u/lindstrom1989)\
**Post date:** [December 29, 2015, 4:44pm UTC](https://community.particle.io/t/arduino-photon-library/18622/1 "2015-12-29T16:44:14Z")

</div>

Hi there I’m new to particle.  
I am trying to convert a library that’s for the Arduino to be used by the photon.  
In the library it includes the Arduino ethernet and or wifi library, obviously the photon does not use/require this so how would I replace with a photon equivalent?

```auto
#if defined(PubNub_Ethernet)
#include <Ethernet.h>
#define PubNub_BASE_CLIENT EthernetClient

```

What should the PubNub\_BASE\_CLIENT be equal to?

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [December 29, 2015, 5:04pm UTC](https://community.particle.io/t/arduino-photon-library/18622/2 "2015-12-29T17:04:41Z")

</div>

You won’t need them 😉

---

<div class="post-metadata">

**Author:** ![lindstrom1989](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/lindstrom1989/32/8212_2.png) [@lindstrom1989](https://community.particle.io/u/lindstrom1989)\
**Post date:** [December 29, 2015, 5:08pm UTC](https://community.particle.io/t/arduino-photon-library/18622/3 "2015-12-29T17:08:26Z")

</div>

Sure I Kinda get that but PubNub\_BASE\_CLIENT is referenced throughout the current library so surely I need to point that at something on the photon end?

---

<div class="post-metadata">

**Author:** ![bko](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bko/32/20704_2.png) [@bko](https://community.particle.io/u/bko)\
**Post date:** [December 29, 2015, 5:17pm UTC](https://community.particle.io/t/arduino-photon-library/18622/4 "2015-12-29T17:17:41Z")

</div>

Hi @lindstrom1989

There is no Particle class that is a direct substitute for `EthernetClient`. The `TCPClient` class or the `TCPServer` class are probably what you want to use but I would look at each method call and see if it makes sense.

---

<div class="post-metadata">

**Author:** ![lindstrom1989](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/lindstrom1989/32/8212_2.png) [@lindstrom1989](https://community.particle.io/u/lindstrom1989)\
**Post date:** [December 29, 2015, 5:26pm UTC](https://community.particle.io/t/arduino-photon-library/18622/5 "2015-12-29T17:26:16Z")

</div>

Ok I’ll give it a try, where does that class come from? is it an external library? thanks

---

<div class="post-metadata">

**Author:** ![bko](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bko/32/20704_2.png) [@bko](https://community.particle.io/u/bko)\
**Post date:** [December 29, 2015, 6:26pm UTC](https://community.particle.io/t/arduino-photon-library/18622/6 "2015-12-29T18:26:04Z")

</div>

Hi @lindstrom1989

Both the TCPClient and TCPServer classes are built-in and you don’t need any include in the webIDE. In a C++ library you should do `#include "application.h"` to get them. This include could change names in the future. You can use various `#ifdef` macros to make your library more portable or you can make a Particle-specific version.
