i have small problem

the connection from my smart phone was fails…

your speech is right … my server reject any external connection …

what do you do to activate the external connections ? :frowning:

with my respect <>
Iam tired you with me .

Your server is a windows box running Apache or Linux or a Mac?

which version of the OS? have you any specific set up?

what's your router?

1- my system is windows7

2- Apache 2.4.18 that is version of my apache

3- my router is tp-link

I'm a mac / unix person so don't have much experience with Windows (and don't want to :slight_smile: ) but I would start by opening Windows Firewall (Start button / Control Panel / Security / Windows Firewall) and Allow a program through Windows Firewall and Add port 8095 there.

<>
I make the server accessible from my smart phone.
but when try that from another my pc . i can’t

wallaa_alebady:
<>
I make the server accessible from my smart phone.
but when try that from another my pc . i can’t

what did you change for your smartphone to access it?

I change the sitting of apache .
edit the httpd.conf file and make change on it ...

that does not help… not enough info

do the same you did for your phone for your arduino…

Have you checked the firewall and the ports ?

i don't do any think to my phone ..
all what i do is on my server ..

yes , i checked the firewall and the ports.

What did you do on the server that works for the phone and not another device

Modify the request to. Not reach your server but a public site - like a google request for example and see if that goes through.

See code here

i edit the httpd.config file and replace this code :

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Allow from all

</Directory>

instead of this

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all

</Directory>

my dear <> i am boring from this problem and i tired you with me…
thank you for all

when try this code of Web client example

#include <SPI.h>
#include <Ethernet.h>

// Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
// if you don't want to use DNS (and reduce your sketch size)
// use the numeric IP instead of the name for the server:
//IPAddress server(74,125,232,128);  // numeric IP for Google (no DNS)
char server[] = "www.google.com";    // name address for Google (using DNS)

// Set the static IP address to use if the DHCP fails to assign
IPAddress ip(192, 168, 0, 177);

// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
EthernetClient client;

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  // start the Ethernet connection:
  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    // try to congifure using IP address instead of DHCP:
    Ethernet.begin(mac, ip);
  }
  // give the Ethernet shield a second to initialize:
  delay(1000);
  Serial.println("connecting...");

  // if you get a connection, report back via serial:
  if (client.connect(server, 80)) {
    Serial.println("connected");
    // Make a HTTP request:
    client.println("GET /search?q=arduino HTTP/1.1");
    client.println("Host: www.google.com");
    client.println("Connection: close");
    client.println();
  } else {
    // if you didn't get a connection to the server:
    Serial.println("connection failed");
  }
}

void loop() {
  // if there are incoming bytes available
  // from the server, read them and print them:
  if (client.available()) {
    char c = client.read();
    Serial.print(c);
  }

  // if the server's disconnected, stop the client:
  if (!client.connected()) {
    Serial.println();
    Serial.println("disconnecting.");
    client.stop();

    // do nothing forevermore:
    while (true);
  }
}

all think is fine and the sketch is execute
but when replace my server ip :

IPAddress server(192,168,0,102)

instead of this

char server[] = "www.google.com";

the result is :

connecting…
connection failed
disconnecting.

I've lots of patience but here it won't help. Your router works fine, your Ethernet shield works fine, your dhcp works fine, your arduino and Ethernet library work fine, your php server works fine... and I'm pretty sure the code I gave you works fine (I tried it on my own set up) besides the port number - something to explore there - would be good to try with port 80

Your problem is your http server and most likely windows blocking the device (did you remove the MAC address from static IP allocation tables ?)

I'm afraid I can't help more - i would throw away windows and go for a mac or Linux... but that is a bit extreme I understand...

You should ask the question in more general PC forums or read the windows doc about where you can get logs of incoming connections attempts and how to allow them..

One last idea as your GET request String might be ill formed:

Change the. Host: 192.168.0.102 part into Host: 192.168.0.102:8095

The port number in theory should be there too, that might be why you get rejected and not your phone

thank you <> from deep my heart … i tired you with me a lot …
thank you for all …

i solved my problem …

Great news!
What was the problem in the end ?

i think the problem was in my pc ... where was don't receive the connection ....

but when install my wamp server on another pc . i can reach to it from another pc and also i reach to it from my ehternet shield that connected with arduino ....

i remember thing …

when i replace the sensor values instead off the constant values in http request the data that added to mysql is zero …

Well that’s most likely because you don’t build the String correctly… or your server script is bogus (but ii doubt that as it works when you submit manually)

Show your code again…