Comunicating with the PC


NodeMcu boards have an internal USB/serial converter to communicate with your PC. Aside from ESPlorer, you may use any terminal that accesses the serial port to send and receive data and commands. You can even access it through the cmd prompt.

Arduino's Serial Monitor

Set the the serial port and open the Serial Monitor:

From the serial monitor you can send commands and read NodeMcu's output:

Using cmd prompt.

You may send commands and data to your NodeMcu from a script or program on your PC using the cmd prompt. I have not found an easy way to read NodeMcu's output, the best I could come up with yet is to send it to a file.

Getting ports status and changing parameters like baudrate

Connect your board (with firmware) to the PC using a serial cable and opend cmd prompt. Now type "mode" and enter. You should get something like this:

It tells me that I only have COM3 port open and it is set at a baudrate of 1200.

Since NodeMcu boards communicate at 115200 baud (mostly), I must change that by typing: mode com3 baud=115200.(in fact I could have typed simply mode com3 115200). You can also change other parameters with the command mode using the sintax MODE COMm[:] [BAUD=b] [PARITY=p] [DATA=d] [STOP=s] [RETRY=r]. For example: Mode Com1: Baud=9600 Parity=N Data=8 Stop=1

The command mode by itself lists all devices.To list the parameters of a specific device, use MODE [device] [/STATUS]. For example mode com3 /status.

Sending text to the serial port

Once the baudrate is set, you may send text to serial port COM3 (for example) using: echo your text > com3

https://batchloaf.wordpress.com/2013/02/12/simple-trick-for-sending-characters-to-a-serial-port-in-windows/

https://batchloaf.wordpress.com/serialsend/

Sending text from NodeMcu to a file

type com3: >> output.txt

results matching ""

    No results matching ""