Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

power down ESP #28

Closed
rikki78 opened this issue Jun 4, 2015 · 2 comments
Closed

power down ESP #28

rikki78 opened this issue Jun 4, 2015 · 2 comments

Comments

@rikki78
Copy link

rikki78 commented Jun 4, 2015

Hi,

I'm trying to power down the ESP in this great piece of software. Disabling works well, now I'm wondering which steps to take to get the ESP back connected.
I've tried enabling, resetting and connecting the ESP. Can you describe which steps to take?

thanks for helping!

@tuanpmt
Copy link
Owner

tuanpmt commented Jun 5, 2015

you can reinitialize same as setup code like this

void setup() {
  Serial.begin(19200);
  debugPort.begin(19200);
  esp.enable();
  delay(500);
  esp.reset();
  delay(500);
  while(!esp.ready());

  debugPort.println("ARDUINO: setup mqtt client");
  if(!mqtt.begin("DVES_duino", "admin", "Isb_C4OGD4c3", 120, 1)) {
    debugPort.println("ARDUINO: fail to setup mqtt");
    while(1);
  }


  debugPort.println("ARDUINO: setup mqtt lwt");
  mqtt.lwt("/lwt", "offline", 0, 0); //or mqtt.lwt("/lwt", "offline");

/*setup mqtt events */
  mqtt.connectedCb.attach(&mqttConnected);
  mqtt.disconnectedCb.attach(&mqttDisconnected);
  mqtt.publishedCb.attach(&mqttPublished);
  mqtt.dataCb.attach(&mqttData);

  /*setup wifi*/
  debugPort.println("ARDUINO: setup wifi");
  esp.wifiCb.attach(&wifiCb);

  esp.wifiConnect("DVES_HOME","wifipassword");


  debugPort.println("ARDUINO: system started");
}

@rikki78
Copy link
Author

rikki78 commented Jun 8, 2015

Thank you for helping, now it is working!

@rikki78 rikki78 closed this as completed Jun 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants