Is the below program correct to enable and disable the esp8266 through program?
i have connected esp8266 with arduino nano.
esp vcc -- 3.3 v
esp gnd == ground
esp rx -- arduuino rx
esp tx -- arduino tx
esp chpd -- arduino D10
int chpd = 10; // D10 as chpd in arduino
void setup() {
Serial.begin(9600);
pinMode(chpd, OUTPUT);
}
void loop() {
digitalWrite(chpd, HIGH);
Serial.println(" esp enabled");
delay(10000);
digitalWrite(chpd, LOW);
Serial.println(" esp disabled");
delay(10000);
}
I have only used the esp as standalone board never connected to a arduino board,
but i can tell you a few things.
tx sends data rx receives data so the connection should be tx-rx// rx-tx,
also esp boards do not like 5v level signals so either run the nano board at 3.3v or use voltage dividers. One more thing i hope you are not trying to run the esp from the 3.3v pin on the nano u need more current that that can give use a ams1117 3.3v regulator or a dc-dc module.
thank you.
I am using arduino because i want to interface lcd module. It requires more I/O pins that esp don't have.
Why i need enabling is , i am requesting for particular data from a web service. I am connecting to web service successfully by AT commands. In first execution of loop GET method sending and giving response as i required. But from second execution of the loop the below message coming on serial monitor.
[response]
GET /emp/empdetails.asmx/emp?empcode=a001HTTP=1.0Host
SEND OK
+IPD,264:<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://tempurGET /emp/empdetails.asmx/emp?empcode=a001HTTP=1.0Host
SEND OK
[/response]
why?
Because I think if I send every loop as a new loop, may the problem will be solved.
That's why i am asking about enable esp by program.
Please help me anyone......
I would suggest the Arduino Mega 2560 since it has four hardware serial ports.