Maybe take look at this post
At thr part
static const char RESET[] = "AT+RESET\n"; Serial2.write(RESET, sizeof(RESET) - 1);