i'm noob in this forum, so first of all, sorry if i mess with this post in some way. Second, i'm spanish guy, sorry for my english!
Now, the main thing. I'm trying to connect an esp8266-12 to a w5100 ethernet shield. I use ICSP to vcc,, D13,D12,D14,D16 connectors and the SS (d15) pin in esp8266 to the 10 pin of w5100. Then i loaded a simple program like this:
#include <Ethernet.h>
#include <SPI.h>
IPAddress ipEnvio;
byte mac[] = { 0x00, 0x11, 0x22, 0x33, 0xFB, 0x11 }; // Use your MAC address
String ipEnvioString;
void setup()
{
pinMode(15, OUTPUT);
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println("Intentando establecer conexion por DHCP.");
if( (Ethernet.begin(mac))==0)
{
Serial.println("Error estableciendo conexion por DHCP");
IPAddress dnServer(8,8,8,8);
IPAddress gateway(192,168,1,1);
IPAddress subnet(255,255,255,0);
IPAddress ip(192,168,1,114);
Ethernet.begin(mac, ip, dnServer, gateway, subnet);
}
Serial.print("Mi ip en begin es: ");
Serial.println(Ethernet.localIP());
}
void loop() {
// put your main code here, to run repeatedly:
//Componemos la ip que tenemos para enviarla por PUT
ipEnvio=Ethernet.localIP();
ipEnvioString = String(ipEnvio[0])+"."+String(ipEnvio[1])+"."+String(ipEnvio[2])+"."+String(ipEnvio[3]);
Serial.print("Mi ip por cadena es: ");
Serial.println(ipEnvioString);
Serial.print("Mi ip por funcion es: ");
Serial.println(Ethernet.localIP());
delay(3000);
}
to my esp8266, no problem loading skecth.
But, when i try to use DHCP it is impossible. Always use 192.168.1.114 as IP. And the most weird thing is Serial.print(Ethernet.localIP()) is returning 255.224.255.224, but i can ping to 192.168.1.114 without problem.
What the hell is going here?
Thanks to you!!