I have some familiarity with object orientated programming in C# and simple Arduino sketching.
I would like to achieve the following:
- Have an ESP8266 on the WiFi network (it's on a private VLAN so session security is unimportant), WPA2-AES(PSK) is adequate.
- DHCP will assign it a reserved IP address based on its MAC address (are these programmable on the ESP?)
- I'd like the ESP8266 to open a TCP or UDP socket to listen for commands. The protocol will be very simple, send a byte with relevant bit(s) high to command the ESP8266
- The ESP8266 responds with a simple confirmation.
Using the Arduino 1.6.5 IDE, I've got the ESP8266 talking via a serial port, connected to WiFi and functioning with the AT command set. I notice there are many people that run web servers on the ESP but I think that's huge overkill for this application.
I have also got it running as a server using:
AT+CIPSTART=0
AT+CIPMUX=1
AT+CIPSERVER=1,2222
Then on a terminal
>echo "test" | nc <ip address>,2222
But is there a better method? I'm after the equivalent of a StreamReader class if it exists?
Thank you