-->
Page 1 of 1

ESP does not connect to server when using mobile wifi modem

PostPosted: Wed Nov 09, 2016 12:15 am
by cesar182
Hello ... see a couple of days ago I was doing a small project which consists of sending data to mysql through the esp8266, the tests I have been doing with the house wifi and I was able to save data in mysql without problem ... but Now I wanted to do the same with a mobile wifi modem, the esp8266 can connect to the wifi network, but the problem is that you can not connect to the serividor

este es el codigo del esp8266 usando la libreria ESP8266Wifi
Code: Select all#include <ESP8266WiFi.h>

const char* ssid     = "SSID";
const char* password = "PASSWORD";
const char* host = "192.168.1.101"; // ip of the server assigned by the mobile wifi modem

void setup() {
  Serial.begin(9600);
  // We start by connecting to a WiFi network
  WiFi.begin(ssid, password);
}

void loop() {
   delay(5000);
   WiFiClient client;
  const int httpPort = 80;
  if (!client.connect(host, httpPort)) {
    Serial.println("connection failed");
    return;
  }
  else{
    Serial.println("connected");
  }

  while(Serial.available()>0)
  {
    int dato =Serial.read();
    client.print("GET /Proyecto/guardar.php?valor=");
    client.print(dato);
    client.println("HTTP/1.1");   
  }

}



The ip of the server assigned by the house wifi was 10.0.0.10
anyone can help me with this problem please

Re: ESP does not connect to server when using mobile wifi mo

PostPosted: Wed Nov 09, 2016 5:02 am
by schufti
some mobile 3G/WiFi modems have "station separation" enabled as secutity feature, so all clients can access the internet but not each other ...

Re: ESP does not connect to server when using mobile wifi mo

PostPosted: Wed Nov 09, 2016 9:43 am
by cesar182
Ahhh ok ... there is some way to configure the modem to use it, it is a huawei mobile broadband e355