Re: Esp8266 to Linux via wi-fi assistance required
Posted: Thu Apr 05, 2018 5:07 pm
There are non-coding options on Linux for reading data from a socket. netcat (nc) can listen on a TCP or UDP port and send the incoming data to stdout.
The following listens on TCP port 8266 and sends incoming data to stdout.
To save the data to a file, redirect stdout to a file.
To see the data and save it a a file at the same time, use tee.
netcat's big brother is named socat. socat has far more options but I don't use it unless netcat can't get the job done.
The following listens on TCP port 8266 and sends incoming data to stdout.
Code: Select all
$ nc -k -l 8266
To save the data to a file, redirect stdout to a file.
Code: Select all
$ nc -k -l 8266 >mydata.txt
To see the data and save it a a file at the same time, use tee.
Code: Select all
$ nc -k -l 8266 | tee mydata.txt
netcat's big brother is named socat. socat has far more options but I don't use it unless netcat can't get the job done.