# Problens connecting to photon (TCPServer) from various TCPclient devices

**URL:** <https://community.particle.io/t/problens-connecting-to-photon-tcpserver-from-various-tcpclient-devices/48976>\
**Category:** Troubleshooting\
**Created:** [April 7, 2019, 11:31pm UTC](https://community.particle.io/t/problens-connecting-to-photon-tcpserver-from-various-tcpclient-devices/48976 "2019-04-07T23:31:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kevinvw](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/kevinvw/32/7400_2.png) [@kevinvw](https://community.particle.io/u/kevinvw)\
**Post date:** [April 7, 2019, 11:31pm UTC](https://community.particle.io/t/problens-connecting-to-photon-tcpserver-from-various-tcpclient-devices/48976/1 "2019-04-07T23:31:57Z")

</div>

Hi all.  
First, let me say this is not a Particle problem. I have had similar code working fine in my home Wifi. Unfortunately I am not home but in a nursing facility so I am having to deal with their wifi.

The photon runs fine and gets as far as creating a client from the server.My clients include my laptop, an android tablet and a phone. (downloaded TCP packet sender apps). I have never completed the connection.

Traceroute and ping don’t work unless I ping the public IP. but I cant get either to work between local IP devices. So finally, my question is, what about the wifi setup would prevent communications between local devices? I have attached my code just in case I did screw something up.  
Thanks for the help.

```auto
TCPServer server = TCPServer(2607);
TCPClient client;

void setup()
{
  // start listening for clients
  server.begin();

  RGB.control(true);
  RGB.color(255,255,255);

  Serial.begin(9600);

  waitFor(Serial.isConnected, 30000);

  Serial.println(WiFi.localIP());
  Serial.println(WiFi.subnetMask());
  Serial.println(WiFi.gatewayIP());
  Serial.println(WiFi.SSID());
  IPAddress host= WiFi.localIP();
  uint16_t np= WiFi.ping(IPAddress(65, 60, 111, 83));
  Serial.printf(" Ping returned %d\n", np);
}

void loop()
{
 uint16_t count1= client.available();
    Serial.printf("this client better?? - 0x%08x - bytes queued: %d - connected? %d\n", client, count1, client.connected());
 
  RGB.color(0,0,255);
  delay(1000);
  if (client && client.connected())
  { 
    RGB.color(0,255,0);
    delay(1000);
    // echo all available bytes back to the client
    while (client.available())
    {
      Serial.printf("in collection loop\n");

 // server.write(client.read());
    }
  }
  else
  {
    // if no client is yet connected, check for a new connection
    client = server.available();
    RGB.color(255,0,0);
    delay(1000);
  }
}

```

---

<div class="post-metadata">

**Author:** ![armor](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/armor/32/18398_2.png) [@armor](https://community.particle.io/u/armor)\
**Post date:** [April 8, 2019, 12:14pm UTC](https://community.particle.io/t/problens-connecting-to-photon-tcpserver-from-various-tcpclient-devices/48976/2 "2019-04-08T12:14:27Z")

</div>

DHCP? Is the WAP setup to use static IP addresses only? Is there some sort of device/client blocking (MAC address)? You could try installing Wireshark and looking at the IP traffic to figure out what is not happening.

---

<div class="post-metadata">

**Author:** ![dkryder](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dkryder/32/20382_2.png) [@dkryder](https://community.particle.io/u/dkryder)\
**Post date:** [April 8, 2019, 2:08pm UTC](https://community.particle.io/t/problens-connecting-to-photon-tcpserver-from-various-tcpclient-devices/48976/3 "2019-04-08T14:08:47Z")

</div>

it would not hurt to ask if you can talk with someone in the IT [or whatever it is called at the facility] to learn about what is acceptable [possible] and what is not.

---

<div class="post-metadata">

**Author:** ![kevinvw](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/kevinvw/32/7400_2.png) [@kevinvw](https://community.particle.io/u/kevinvw)\
**Post date:** [April 8, 2019, 2:27pm UTC](https://community.particle.io/t/problens-connecting-to-photon-tcpserver-from-various-tcpclient-devices/48976/4 "2019-04-08T14:27:27Z")

</div>

Wireshark is a good idea… I’ll play with that today.  
A few details I left out… The photon is connecting to the cloud… It shows up in the dashboard and I can publish variables… Etc.
