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?

More than 5 years have passed since last update.

ESP8266 Arduino Example を試す その2

Last updated at Posted at 2017-06-24

ESP8266 Arduino Exampleを試す その2

ESP8266AVRISP

Arduino_Wifi_AVRISP

ESP8266 をTCP経由でAVRライタとして使うサンプル。
動作結果は以下の通り。

Arduino AVR-ISP over TCP

Soft WDT reset

ctx: cont 
sp: 3ffef650 end: 3ffef850 offset: 01b0

>>>stack>>>
3ffef800:  3fffdad0 3ffee6c0 3ffee7f4 40201d02  
3ffef810:  feefeffe feefeffe feefeffe feefeffe  
3ffef820:  feefeffe feefeffe feefeffe 3ffee820  
3ffef830:  3fffdad0 00000000 3ffee818 40205ac8  
3ffef840:  feefeffe feefeffe 3ffee830 40100718  
<<<stack<<<

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v09f0c112
~ld

ESP8266HTTPClient

Authorization

setup でWifi のアクセスポイントに接続します。
SSIDとPASSWORD は直接、ソースコードに書き込みます。

Authorization.iso
void setup() {
    ...
    WiFiMulti.addAP("SSID", "PASSWORD"); //アクセスポイントのオープン
}

loop の中で、接続を確認しいずれかのURLに接続する。
当該 html を読み込みシリアルに書き出す。

Authorization.iso
  if((WiFiMulti.run() == WL_CONNECTED)) {

       HTTPClient http;
     ...
       http.begin("http://user:password@192.168.1.12/test.html");
     ...

       // start connection and send HTTP header
       int httpCode = http.GET();

       // httpCode will be negative on error
       if(httpCode > 0) {
           // HTTP header has been send and Server response header has been handled
           USE_SERIAL.printf("[HTTP] GET... code: %d\n", httpCode);

           // file found at server
           if(httpCode == HTTP_CODE_OK) {
               String payload = http.getString();
               USE_SERIAL.println(payload);
           }
       } else {
           USE_SERIAL.printf("[HTTP] GET... failed, error: %s\n",
                 http.errorToString(httpCode).c_str());
       }

       http.end();
   }

BasicHttpClient

Authorizationと同じ?

ReuseConnection

StreamHttpClient

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?