Local chat server via Telnet using NodeMCU


  • Set up a Telnet chat server using NodeMCU


  1. NodeMCU (quantity: 1 no)
  2. Micro USB cable A to B (quantity: 1 no)
  3. Android mobile phone (quantity: 1 no)
  4. Telnet client mobile app
  5. Arduino IDE on the computer

Let’s begin!

Telnet is a convention utilized on the Internet or local area network to give a bidirectional intelligent text-based facility. Let’s make a chat server on the NodeMCU.

Final Code

To copy the code, right click on view raw at the bottom of the code, click on open link in new tab and then copy the code.

Uploading the code

Step 1: Enter the final code in the Arduino IDE window.

  • When you click on New to open a new blank code in the Arduino IDE, you will get a new window with two functions: void setup() and void loop()
  • You can either type commands as shown in the final code under void setup() and void loop() functions or
  • Delete the contents of this window. Then copy and paste the final code in the Arduino IDE window.

Step 2: Compile/ verify the code by clicking on the verify button.

  • Make sure the board is connected to your computer
  • Check if the correct board and port is selected.

Step 3: Upload the code by clicking on the upload button, which is right next to the verify button.

  • The Arduino IDE provides a progress bar when it’s uploading.
  • After it is done, you will see “Done uploading” on the bottom left of your IDE.
  • If you encounter any errors, you need to go back to the code and fix the errors.

There you go!

After that open Telnet client app (downloaded from Play store ). Now, input the IP address from serial monitor of Arduino IDE into telnet applicaton and  let the port be 23.

Type a message and send it. Check the serial monitor of your Arduino IDE, the message you sent should appear there.

Now, you can send your reply by typing on your serial monitor and click on SEND button. This message should appear on the Telnet Client app.

We have successfully created a local chat server using Telnet and NodeMCU.

We would love to see what you build out of these learnings!

Click here to submit your projects, share it with the world and stand a chance to be rewarded.


Knowledge and Content by Li2 Technologies | © 2021 NASSCOM Foundation | All rights reserved