Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

esp8266 điều khiển thiết bị qua webserver

NotificationsYou must be signed in to change notification settings

hoangminh5210119/webserver_esp8266

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

  • Mở serial monitor lên để xem địa chỉ IP của thiết bị.
  • Mở trình duyệt web lên gõ vàohttp://192.168.4.1/ đối với chế độ phát WiFi, gõ vàohttp://esp8266.local/ nếu là chế độ dùng esp8266 kết nối vào mạng wifi.
  • Muốn dùng đượchttp://esp8266.local/ thì cần cài thêmBonjour cho Window.

  1. Filewebserver.ino.
  • // #define STA_MODE dùng để định nghĩa sữ dụng chế độ nào của ESP8266. Nếu dùng ở chế độ lấy ESP8266 kết nối vào mạng WiFi thì bỏ dấu//.

  • WiFi.mode(WIFI_STA); chọn mode kết nối vào mạng wifi nhà.

  • WiFi.begin(ssid, password); kết nối vào wifi.

  • WiFi.mode(WIFI_AP); chọn mode phát wifi.

  • server.on("/", handleRoot); bắt đường dẫn/ trả vềhandleRoot

  • server.send(200, "text/html", s1); gửi định dạngtext/html tới client.

  • server.begin(); bắt đầu chạy server.

  • server.handleClient(); thực thi yêu cầu của client.

  • if (server.argName(i) == "LED1") kiểm tra tham số trả về có bằngLED hay không.

  1. FilepageControl.h.
  • khai báoPROGMEM để lưu trữ trong bộ nhớ flash thay vì SRAM.

  • <form menthod='get'><input class='button' type='submit' name='LED1' value='ON' ></form> tạo nút nhấn vớiname='LED1' và value='ON'.

  • namevalue là 2 tham số được dùng trong quá trình gửi nhận dữ liệu giữa người dùng thao tác trên trình duyệt Web và ESP8266.

  1. Kết nối.

kết nối phần cứng

  1. giao diện điều khiển

giao diện điều khiển

About

esp8266 điều khiển thiết bị qua webserver

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp