Chat freely about anything...

User avatar
By Uni
#41003 I only recently began programming an ESP8266 using Arduino. I can communicate with the board while typing commands over a serial connection, but I can't seem to issue those same commands from the code itself. My goal is to set wifi mode with AT+CWMODE=3, then refresh wifi data with AT+CWLAP every 30 seconds. I've used a timer library to make things a bit easier, but otherwise I could use some tips. Here's the basic skeleton:

Code: Select all#include "Timer.h"

Timer t;
 
void setup()
{
  Serial.begin(115200);
  t.every(30000,takeReading);
}
void loop()
{
  t.update();
}

void takeReading()
{
}


I've tried a few different libraries for the esp8266 from github, but most don't seem cover basic functions like this. Even if you can just point me to the correct library to use, and the syntax of sending these commands over a serial connection, that would be very helpful.