Skip to content

Instantly share code, notes, and snippets.

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 vintagechips/98dc2f1493bf529316519a7cd84a8623 to your computer and use it in GitHub Desktop.
Save vintagechips/98dc2f1493bf529316519a7cd84a8623 to your computer and use it in GitHub Desktop.
#include <WiFi.h>
const char* ssid = "Buffalo-G-0E94";
const char* password = "password";
const int port = 23;
WiFiServer server(port);
void setup() {
Serial.begin(9600);
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(100);
Serial.print(".");
}
Serial.println();
Serial.println("WiFi connected.");
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
Serial.print("Server port: ");
Serial.println(port);
server.begin();
server.setNoDelay(true);
}
void loop() {
char c;
WiFiClient client = server.available();
if (client) {
Serial.println("New Client.");
while (client.connected()) {
if (client.available()) {
c = client.read();
//client.write(c);
Serial.write(c);
}
if (Serial.available()) {
c = Serial.read();
client.write(c);
}
}
client.stop();
Serial.println("Client Disconnected.");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment