Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By thedroid
#13764 Hi,

I am trying to make a remote serial terminal using the ESP8266. Unfortunately I am new to both the Arduino IDE and ESP8266.

With the below code (vith my ssid and password added in correctly), when I try to connected to the ESP via Telnet, putty disconnects right await like nothing is listening on port 23.

Any help would be much appreciated.

Thx

Code: Select all#include <ESP8266WiFi.h>

const char* ssid = "your-ssid";
const char* password = "your-password";
bool flag_flushed = false;

// Create an instance of the server
// specify the port to listen on as an argument
WiFiServer server(23);

void setup() {
  Serial.begin(115200);
  delay(10);

  // prepare GPIO2
  pinMode(2, OUTPUT);
  digitalWrite(2, 0);
 
  // 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.println(WiFi.localIP());
}

void loop() {
 
 
  // Check if a client has connected
  WiFiClient client = server.available();
  if (!client) {
    return;
  }

  if (!flag_flushed)
  {
    client.flush();
    flag_flushed = true;
  }
 
  if (client.available() > 0)
  {
    char byteread = client.read();
    Serial.write(byteread);
  }
  if (Serial.available() > 0)
  {
    char byteread = Serial.read();
    client.write(byteread);   
  }
}
User avatar
By gambituk
#56647 Hi, i came here looking for something like this i think.... i would like to have a device that i can just go and plug into a project when i want to read the output from the serial.. is this what this is supposed to do? and did you manage to make it work?

Anyone else know of any project that does what i'm looking for?
User avatar
By gambituk
#56649 Thanks martinayotte I found that just after i posted this!, am i correct in thinking it's not initially uploaded via arduino ide? if not do you know of another similar system that i can just upload through the arduino ide or do i have to suck it up and do it using another tool??

Thanks for your initial reply and any further insights