Skip to content

Instantly share code, notes, and snippets.

@CreateRemoteThread
Created September 29, 2019 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CreateRemoteThread/5779c1517bf4a54d4277f354e57f7487 to your computer and use it in GitHub Desktop.
Save CreateRemoteThread/5779c1517bf4a54d4277f354e57f7487 to your computer and use it in GitHub Desktop.
#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