@giranp Good morning. First of all: You're in the wrong forum. The port for ESP8266 is supported at forum.micropython.org.
Besides that, what you did is right. The information missing is:
a) which kind of board are you using?
b) did you set the access rights for /dev/ttyUSB0, or better, are you as user in the dialout group? You shoud get an error message if not.
c) When connected, try Ctrl-C or Ctrl-B or Ctrl-D, whether this changes the behviour.
@robmarkcole The frequency of sampling depends of the rate, your data changes. The sampling for averaging here can be fast, since it just deals with the intrinsic noise of the esp32 adc (which, by the way, is a very bad one). So the whole burst is to be taken as one sample.
The plant moisture will not change really fast. So taking a value burst like once per hour should be more than sufficient. If you want some theory about that, search for "Shannon sampling theorem".