Created
September 29, 2019 07:49
-
-
Save CreateRemoteThread/5779c1517bf4a54d4277f354e57f7487 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> | |
#include <WiFiClient.h> | |
#include <ESP8266WebServer.h> | |
#include <ESP8266mDNS.h> | |
IPAddress local_IP(192,168,1,1); | |
IPAddress gateway(192,168,1,1); | |
IPAddress subnet(255,255,255,0); | |
WiFiServer wifiServer(23); | |
void setup() { | |
WiFi.softAPConfig(local_IP, gateway, subnet); | |
WiFi.softAP("TESTAPNAME","TESTPASSWORD"); | |
WiFi.softAPIP(); | |
Serial.begin(115200); | |
wifiServer.begin(); | |
} | |
void loop() { | |
WiFiClient client = wifiServer.available(); | |
if (client) { | |
while (client.connected()) { | |
while (client.available()>0) { | |
char c = client.read(); | |
Serial.write(c); | |
} | |
delay(10); | |
while (Serial.available()) { | |
// get the new byte: | |
char inChar = (char)Serial.read(); | |
// add it to the inputString: | |
client.write(inChar); | |
} | |
} | |
client.stop(); | |
// Serial.println("Client disconnected"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment