I have been tryin to use Roberemo and the sample WifiWebServer examples in my network.
When I use my phone as a hotspot, I can use the the phone browser or packet send tool to sucessfully send and receive a debuf message on the server ip/port.
However when I use STA mode to register the server with an IP address on my Wifi network, I can't reach that server device anymore. I can see the device in my dhcp and its standard (example even ) code.
WTF is going on here ? It's doing my nut and its gotta be simple.
The serial debu output says the wifi connection to the network is good, DHCP is showing a lease, serial output is showing an IP address and the ESP is just sitting there, not doing anything. Its clearly simple but not occurring to me.
Any ideas?
#include <WiFiClient.h>
WiFiServer server(port);
WiFiClient client;
void setup()
{
delay(500);
Serial.begin(UART_BAUD);
//WiFi.hostname("BadgerSPDev1");
#ifdef MODE_STA
// STATION mode (ESP connects to router and gets an IP)
// Assuming phone is also connected to that router
// from RoboRemo you must connect to the IP of the ESP
WiFi.mode(WIFI_STA);
WiFi.begin( ssid, pwd);
while (WiFi.status() != WL_CONNECTED)
{
delay(100);
}
Serial.println("");
Serial.print("hostname :");
Serial.println( WiFi.hostname());
Serial.print("Status: "); Serial.println(WiFi.status());
Serial.print("IP: "); Serial.println(WiFi.localIP());
Serial.print("Subnet: "); Serial.println(WiFi.subnetMask());
Serial.print("Gateway: "); Serial.println(WiFi.gatewayIP());
Serial.print("SSID: "); Serial.println(WiFi.SSID());
Serial.print("Signal: "); Serial.println(WiFi.RSSI());
Serial.print("Networks: "); Serial.println(WiFi.scanNetworks());
Serial.println("Connected to wifi");
Serial.println("Starting TCP Server");
server.begin( ); // start TCP server
}
void loop()
{
client = server.available(); // wait for it to connect
//etc.