Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- ubuntu
- IOT
- STM32F4
- 라즈베리파이
- uno
- orange pi
- nano
- Raspberry Pi 3
- RUBY
- JSON
- odroid-x2
- Android
- BLE
- Raspberry Pi
- ruby on rails
- python3
- Arduino
- dht11
- Beacon
- 오렌지파이
- 개발환경
- mqtt
- rails
- parser
- Server
- Python
- 아두이노
- java
- flask
- Nginx
Archives
- Today
- Total
[熱情]
NodeMCU 본문
Wifi Scan 샘플 코드
#include "ESP8266WiFi.h" void setup() { Serial.begin(115200); // Set WiFi to station mode and disconnect from an AP if it was previously connected WiFi.mode(WIFI_STA); WiFi.disconnect(); delay(2000); Serial.println("Setup done"); } void loop() { Serial.println("scan start"); int n = WiFi.scanNetworks();// WiFi.scanNetworks will return the number of networks found Serial.println("scan done"); if (n == 0) Serial.println("no networks found"); else { Serial.print(n); Serial.println(" networks found"); for (int i = 0; i < n; ++i) { // Print SSID and RSSI for each network found Serial.print(i + 1); Serial.print(": "); Serial.print(WiFi.SSID(i)); Serial.print(" ("); Serial.print(WiFi.RSSI(i)); Serial.print(")"); Serial.println((WiFi.encryptionType(i) == ENC_TYPE_NONE)?" ":"*"); delay(10); } } Serial.println(""); // Wait a bit before scanning again delay(5000); }
MAC Address 주소 출력
https://techtutorialsx.com/2017/04/09/esp8266-get-mac-address/
#include "ESP8266WiFi.h" void setup(){ Serial.begin(115200); delay(500); Serial.println(); Serial.print("MAC: "); Serial.println(WiFi.macAddress()); } void loop(){}
wifi 연결
https://arduino-esp8266.readthedocs.io/en/2.4.2/esp8266wifi/readme.html#quick-start
#include
void setup() { Serial.begin(115200); Serial.println(); WiFi.begin("my phone의 iPhone", "123456789q"); Serial.print("Connecting"); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println(); Serial.print("Connected, IP address: "); Serial.println(WiFi.localIP()); } void loop() {}
Comments