Skip to content

Instantly share code, notes, and snippets.

@chaeplin
Last active September 3, 2015 19:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save chaeplin/190ba7175d1e8098a629 to your computer and use it in GitHub Desktop.
Save chaeplin/190ba7175d1e8098a629 to your computer and use it in GitHub Desktop.
esp8266_wifi_test
#include <ESP8266WiFi.h>
//#include <IPAddress.h>
const char* ssid = "wifi_ssid";
const char* password = "wifi_password";
WiFiClient wifiClient;
long startMills;
void setup() {
delay(50);
startMills = millis();
Serial.begin(38400);
Serial.println(millis() - startMills);
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.mode(WIFI_STA);
Serial.println(millis() - startMills);
WiFi.begin(ssid, password);
WiFi.config(IPAddress(192, 168, 10, 15), IPAddress(192, 168, 10, 1), IPAddress(255, 255, 255, 0));
Serial.println(millis() - startMills);
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
delay(100);
}
Serial.println("");
Serial.println(millis() - startMills);
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
Serial.println("done");
}
void loop() {
delay(200);
Serial.println("going to sleep");
ESP.deepSleep(5000000, WAKE_RF_DEFAULT);
}
@chaeplin
Copy link
Author

tail 0
chksum 0xb3
load 0x3ffe8000, len 1548, room 8
tail �b��d䄆����������ć䦆FC�����������Ʀ��DŽ�b�ƄbŧĄ�EÇ�ĥ�������Ć���D�ƄbŧĄ�DÇ�ĥ����������DŽD�ƄE�慆Ĥb�Ą�E�b1

Connecting to wifi_ssid
1
1
............
2018
WiFi connected
IP address:
192.168.10.15
done
going to sleep
b��d䄆����������ć䦦FC�����������Ʀ��DŽ�b�ƄbŧĄ�EÇ�ĥ�������Ć���D�ƄbŧĄ�DÇ�ĥ����������DŽD�ƄE�慆Ĥb�Ą�E��b1

Connecting to wifi_ssid
1
4
...
1109
WiFi connected
IP address:
192.168.10.15
done
going to sleep
b��d䄆����������ć䦦FC�����������Ʀ��DŽ�b�ƄbŧĄ�EÇ�ĥ�������Ć���D�ƄbŧĄ�DÇ�ĥ����������DŽD�ƄE�慆Ĥb�Ą�E��b1

Connecting to wifi_ssid
1
3
...
1109
WiFi connected
IP address:
192.168.10.15
done
going to sleep
b��d䄆����������ć䦦FC�����������Ʀ��DŽ�b�ƄbŧĄ�EÇ�ĥ�������Ć���D�ƄbŧĄ�DÇ�ĥ����������DŽD�ƄE�慆Ĥb�Ą�E��b1

Connecting to wifi_ssid
1
4
...
1109
WiFi connected
IP address:
192.168.10.15
done
going to sleep

@chaeplin
Copy link
Author

include <ESP8266WiFi.h>

extern "C"{

include "user_interface.h"

}


  WiFi.begin(ssid, password);
  wifi_set_channel(7);


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment