SEND


STD@MESSAGE
Sends the string "MESSAGE" to STDOUT.
STD@STR[0]
STD@NUM[0]
Sends the content of STR[0]/NUM[0] to STDOUT. Similar commands can be used with other parameters.
STD:STR[0]=STDIN;LED(FLASH)
If a message arrives on STDIN, it is stored in STR[0] and the LED flashes.
Commands interpreted by the interpreter are not stored. This applies to similar commands when the STDIN line is selected in the Setup/Communication menu.

STR[0]@

WS@MESSAGE
Sends the string "MESSAGE" to WebSocket.
WS:STR[0]=WSIN;LED(FLASH)
If a message arrives on WS, it is stored in STR[0] and the LED flashes.

USB@MESSAGE
Sends the string "MESSAGE" to the USB-serial converter mounted on the panel.
USB:STR[0]=USBIN;LED(FLASH)
If a message arrives on USB, it is stored in STR[0] and the LED flashes.

SER@MESSAGE
Sends the string "MESSAGE" to the serial port created in the Setup/Peripherals menu.
SER:STR[0]=SERIN;LED(FLASH)
If a message arrives on SER, it is stored in STR[0] and the LED flashes.

UDP@MESSAGE
Sends the string "MESSAGE" to the address and port configured in Setup/Communication/UDP OUTGOING menu.
UDP(192.168.0.100:8888)@MESSAGE
Sends the string "MESSAGE" to the IP address specified in parentheses on port 8888.
UDP(192.168.0.100-103:8888)@MESSAGE
Sends the string "MESSAGE" to IP addresses ranging from 192.168.0.100 to 192.168.0.103 on port 8888.
UDP(example.com:8888)@MESSAGE
Sends the string "MESSAGE" to the domain specified in parentheses on port 8888.
UDP:STR[0]=UDPIN;LED(FLASH)
If a message arrives on the UDP INCOMING port configured in Setup/Communication/UDP, it is stored in STR[0] and the LED flashes.

TCP
Connects to the server configured in Setup/Communication/TCP Client menu.
TCP(192.168.0.100:9999)
Connects to the server at the IP address specified in parentheses on port 9999.
TCP(example.com:9999)
Connects to the server accessible by the domain name specified in parentheses on port 9999.
TCP@MESSAGE
Sends the string "MESSAGE" to the server.
TCP:STR[0]=TCPIN;LED(FLASHI)
If a message arrives from the server, it is stored in STR[0] and the LED flashes.
TCP!
Closes the TCP connection.
TCPC:LED(ON)
If connection is successful, LED lights up.
TCPE:LED(FLASH)
If connection attempt fails, LED flashes.
TCPD:LED(OFF)
When connection is lost, LED turns off.

TCPS@MESSAGE
Sends the string "MESSAGE" to clients connected to the port configured in Setup/Communication/TCP Server menu.
TCPS:STR[0]=TCPSIN;LED(FLASHI)
If a message arrives from a client, it is stored in STR[0] and the LED flashes.
TCPS!
Closes the TCP connection.
TCPSC:LED(ON)
If connection is successful, LED lights up.
TCPSD:LED(OFF)
When connection is lost, LED turns off.

STR[1]=Bob|
STR[2]=names=%STR[1]|
STR[3]=http://192.168.1.20:8123/api/|
STR[4]=[Content-Type:application/json][Name:Value]

POST(http://www.esp8266.org/post.php)@names=Alice
POST(https://www.esp8266.org/post.php)@names=Alice
POST(https://www.esp8266.org/post.php)@STR[2]
Sends a POST message to the specified webpage. HTTPS works only in lite version due to limited RAM!!!
POST(http://192.168.1.20:8123/api/)[Content-Type:application/json][Name:Value]@{"device": "command"}
POST(STR[3])STR[4]@{"device": "command"}
The [] brackets contain HTTP headers.
POST@
Sends the webpage's response to STDOUT.
POST?
Sends the send status to STDOUT.

The code post.php used in the above example:
<?php $names = $_POST["names"]; echo "Hello " . $names . " !"; ?>
NOW[0]@MESSAGE
Sends the string "MESSAGE" to paired module 0 using ESP-NOW protocol. After issuing the command, the WebSocket connection breaks!
NOW[0-3]@MESSAGE
Sends the string "MESSAGE" to paired modules 0 to 3.
NOWDT:STR[0]=Delivery success
If the ESP-NOW message delivery is successful, STR[0] will be "Delivery success".
NOWDF:STR[0]=Delivery fail
If the ESP-NOW message delivery fails, STR[0] will be "Delivery fail".
NOW:STR[0]=NOWIN;LED(FLASH)
If an ESP-NOW message arrives, it is stored in STR[0] and the LED flashes.

STR[0]@

MAIL(address)from@sub@body
Available only in lite version due to limited RAM!!! Sends an email to the email address specified in parentheses. 'from' appears as the sender, 'sub' as the subject, and 'body' as the message. STR[x] can be used. You must set up the SMTP server in the Setup/Communication menu. Using a Google account is simplest. For this purpose, it's advisable to register a new account. In account settings, under the Security menu, enable two-step verification! Once done, in the Security menu, search for 'App passwords'. Create one; this will be your SMTP PASS. SMTP USER is your Gmail address, SMTP SERVER: smtp.gmail.com, SMTP PORT: 465. Free version allows maximum of 300 emails per month.
MAIL?
After sending, queries and sends success status to STDOUT.



Examples

Serial console.
SER:STR[0]@=SERIN <html> <body> <H1>Serial Terinal</H2> <H2>RX</H2> <textarea id="rx" rows="4" cols="50" disabled></textarea> <br> <button type="button" onclick="document.getElementById('rx').value='';">Clear</button> <br><br> <H2>TX</H2> <textarea id="tx" rows="4" cols="50"></textarea> <br> <button type="button" onclick="sendtx();">Send</button> <script type="text/javascript" src="tools.js"></script> <script> startWS(0); function onMessage(msg) { document.getElementById("rx").value = msg; } function sendtx() { sendWS("SER@" + document.getElementById("tx").value); } </script> </body> </html>