(I'm a newbie and i thought i submitted this post a day ago, but cannot find it; please excuse me if I actually sent it prior)
Wiring is laptop USB to WeMos D1 WiFi Uno and Pin D5 to resistor to LED to GRD. My Sketch below appears to work such that in the SerialMonitor when I type Y/N it turns on/off the LED.
My problem is I can't communicate from my iPhone via WiFi to my WeMos board.
FYI:
SerialMonitor Shows:
Connecting to (...my SSID...)
WiFi Connected
Server started
Use this URL : http://192.168.1.223
LED OFF
LED ON
LED OFF
(also...I used first an iPhone App called Fing to search for devices and found that this URL has a HOST NAME of esp-00ab68.lan)
On my iPhone on Google I typed in URL I get message "Could not find website" Then I tried typing in the host name and got the same message. Lastly I went to iPhone SETTINGS and WiFi and I typed in the URL (and host name) and got the same message.
Would appreciate it if someone could tell me if my Sketch (below) needs any changes? and.....Am I doing something wrong when using my iPhone to connect to the WeMos D1 URL ?
Thank You for any guidance you can give me.
/*
* ESP8266 (WeMosD1) WiFi Relay Control
*
* learnelectronics
* 05 JUN 2017
*
* www.youtube.com/c/learnelectronics
* arduino0169@gmail.com
*/
// WeMos D1 WiFi UNO connected via USB to Desktop PC
// Pin D5 to resistor to led to GRND
#include <ESP8266WiFi.h>
const char* ssid = "my_SSID";
const char* password = "my_PASSWORD";
int ledPin = D5;
WiFiServer server(80);
void setup()
{
Serial.begin(115000);
delay(10);
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, HIGH);
// Connect to WiFi network
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
// Start the server
server.begin();
Serial.println("Server started");
// Print the IP address
Serial.print("Use this URL : ");
Serial.print("http://");
Serial.print(WiFi.localIP());
Serial.println("/");
}
void loop()
{
Serial.available();
char ch = Serial.read();
if (ch == 'y' || ch == 'Y')
{
digitalWrite(ledPin, HIGH);
Serial.print("LED ON");
Serial.println("");
}
if (ch == 'n' || ch == 'N')
{
digitalWrite(ledPin, LOW);
Serial.print("LED OFF");
Serial.println("");
}
}