0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ESP32: Wifi の使い方

Last updated at Posted at 2022-11-14

Ubuntu 24.04 上の Arduino IDE 2.3.2 を使いました。
ボードは、 ESP32 Dev Module です。

WiFIClientBasic を開きます。
スケッチ例 -> WiFI -> WiFIClientBasic
image.png

SSID と password を修正

WiFiMulti.addAP("ssid***", "password***");

LAN内の、192.168.1.6 で http サーバーが動いているとすると、
host を 192.168.1.6
port を 80
にする。

    const uint16_t port = 80;
//    const char * host = "192.168.1.1"; // ip or dns
 //   const uint16_t port = 1337;
    const char * host = "192.168.1.6"; // ip or dns

実行結果

$ cu -l /dev/ttyUSB0 -s 115200
Connected.

WiFi connected
IP address: 
192.168.1.8
Connecting to 192.168.1.6
HTTP/1.1 400 Bad Request
Closing connection.
Waiting 5 seconds before restarting...
Connecting to 192.168.1.6
HTTP/1.1 400 Bad Request
Closing connection.
Waiting 5 seconds before restarting...
Connecting to 192.168.1.6
HTTP/1.1 400 Bad Request
Closing connection.
Waiting 5 seconds before restarting...

http サーバーから、Bad Request が返ってきているのを確認。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?