There are examples that can be generated with the Digi ESP development tool. The tool can be downloaded from Digi's website. With this you can then generate a 'sample application' from the 'file -> new' menu. select the option with the serial port peripherals. There is a serial echo application that is the best option. It shows simple read/write operations.
Last updated: Aug 08, 2017