-->
Page 1 of 1

Beginner basic help with scanning wifi environment

PostPosted: Fri Feb 12, 2016 8:16 pm
by Uni
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.

Re: Beginner basic help with scanning wifi environment

PostPosted: Fri Feb 12, 2016 9:41 pm
by martinayotte
Your question is a bit unclear !
You're talking about AT commands and you've posted an Arduino sketch.
Two BIG different world !
You can NOT have both worlds (2 different firmwares) at the same time on one ESP.
Choose ONE or the other !

Re: Beginner basic help with scanning wifi environment

PostPosted: Sat Feb 13, 2016 9:46 am
by xtal
Its my thinking that to use the AT stuff it must be script driven over the serial port...
Like back in the 80's for Modem's [ie] by another Uproc