2025年5月13日火曜日

iOS 18.5リリース

iOS 18.5がリリースされました

対象デバイスは、iPhone XS以降, iPad(7代目), iPad mini(5代目以降), iPad Air(3代目), iPad Pro(13インチ、12.9インチ 3代目以降、11インチ 初代以降)になります

アップデート内容は、以下の様になっています

  • 新しいプライドハ一モニーの壁紙
  • お子様のデバイスでスクU一ンタイムパスコードが使用されると、親/保護者に通知が届くようになりました
  • 他社製デバイス上のApple TVアフリでコンテンツを購入するときに、"iPhoneで購入"を使用できます
  • Apple Vision Proアブリで黒い画面が表示されるごとがある問題を修正しました
  • iPhone 13(すべてのモデル)で通信事業者から提供される衛星通信の機能に対応しました。詳しい情報: http;//support.apple.com/ja-jp/122339

Apple セキュリティアップデートを確認すると以下のセキュリティアップデート内容が記載されています

AppleJPEG

CVE-2025-31251: Hossein Lotfi (@hosselot) of Trend Micro Zero Day Initiative

Baseband

CVE-2025-31214: 秦若涵, 崔志伟, and 崔宝江

Call History

CVE-2025-31225: Deval Jariwala

Core Bluetooth

CVE-2025-31212: Guilherme Rambo of Best Buddy Apps (rambo.codes)

CoreAudio

CVE-2025-31208: Hossein Lotfi (@hosselot) of Trend Micro Zero Day Initiative

CoreGraphics

CVE-2025-31209: Hossein Lotfi (@hosselot) of Trend Micro Zero Day Initiative

CoreMedia

CVE-2025-31239: Hossein Lotfi (@hosselot) of Trend Micro Zero Day Initiative

CVE-2025-31233: Hossein Lotfi (@hosselot) of Trend Micro Zero Day Initiative

FaceTime

CVE-2025-31253: Dalibor Milanovic

CVE-2025-31210: Andrew James Gonzalez

FrontBoard

CVE-2025-31207: YingQi Shi (@Mas0nShi) of DBAppSecurity's WeBin lab, Duy Trần (@khanhduytran0)

iCloud Document Sharing

CVE-2025-30448: Dayton Pidhirney of Atredis Partners, Lyutoon and YenKoc

ImageIO

CVE-2025-31226: Saagar Jha

Kernel

CVE-2025-31219: Michael DePlante (@izobashi) and Lucas Leong (@_wmliang_) of Trend Micro Zero Day Initiative

CVE-2025-31241: Christian Kohlschütter

libexpat

CVE-2024-8176

Mail Addressing

CVE-2025-24225: Richard Hyunho Im (@richeeta)

mDNSResponder

CVE-2025-31222: Paweł Płatek (Trail of Bits)

Notes

CVE-2025-31228: Andr.Ess

CVE-2025-31227: Shehab Khan

Pro Res

CVE-2025-31245: wac

CVE-2025-31234: CertiK (@CertiK)

Security

CVE-2025-31221: Dave G.

WebKit

CVE-2025-24213: Google V8 Security Team

CVE-2025-31223: Andreas Jaegersberger & Ro Achterberg of Nosebeard Labs

CVE-2025-31238: wac working with Trend Micro Zero Day Initiative

CVE-2025-24223: rheza (@ginggilBesel) and an anonymous researcher

CVE-2025-31204: Nan Wang(@eternalsakura13)

CVE-2025-31217: Ignacio Sanmillan (@ulexec)

CVE-2025-31215: Jiming Wang and Jikai Ren

CVE-2025-31206: an anonymous researcher

CVE-2025-31205: Ivan Fratric of Google Project Zero

CVE-2025-31257: Juergen Schmied of Lynck GmbH

なおアップデートファイルの大きさは、iOS 18.4.1をインストールしているiPhone 11 proで1.17GB、iPhone 11で1.15GBになります


スマホ・携帯ランキング

2025年5月10日土曜日

Timer Camera X(ジャンク)、WiFiに繋がるか...

 先の記事で記載したWiFiに接続できないM5STACK ESP32 PSRAM Timer Camera XでWiFi関連をチェックしてみました。結論を先に言ってしまうと、繋がりませんでした。

最初にM5Burnerを使用してTimerCamForUIFlowを書き込んで、CameraToolsに接続しました。残念ながら、USB経由では問題なく接続できましたが、WiFiにすると接続がエラーになります。やはり、問題があることは確かです。

ESP32 Wifi接続できない"をキーワードに検索をしてみた結果、いろいろと出てきました。そこで、それらを踏まえたチェック用のスケッチを作成しました。内容としてはMACアドレス表示、セキュリティ設定の変更、電波強度変更、WiFiスキャン(ファクトリテストで行っていました)を行うようにしています

Unitに映像を表示させることにしました。なお、JEPEGモード、320x240で撮影し、それをLCD Unitに表示する簡単な記述になります。

#include <M5TimerCAM.h>
#include <M5GFX.h>
#include <M5UnitLCD.h>
#include <WiFi.h>
#include "wifi_chk.h"

// M5UnitLCD display
M5UnitLCD display(4, 13, 400000);  // SDA, SCL, FREQ

int tx_power;     // 送信出力値格納用
char msgbuf[64];  // メッセージ表示用

// WiFi Power CHeck
void wifi_power_chk() {
  Serial.println("WiFi Power CHeck");
  display.println("WiFi Power CHeck");

  wifi_power_t wifiPWR[11];
  wifiPWR[0] = WIFI_POWER_19_5dBm;  // 78
  wifiPWR[1] = WIFI_POWER_19dBm;    // 76
  wifiPWR[2] = WIFI_POWER_18_5dBm;  // 74
  wifiPWR[3] = WIFI_POWER_17dBm;    // 68
  wifiPWR[4] = WIFI_POWER_15dBm;    // 60
  wifiPWR[5] = WIFI_POWER_13dBm;    // 52
  wifiPWR[6] = WIFI_POWER_11dBm;    // 44
  wifiPWR[7] = WIFI_POWER_8_5dBm;   // 34
  wifiPWR[8] = WIFI_POWER_7dBm;     // 28
  wifiPWR[9] = WIFI_POWER_5dBm;     // 20
  wifiPWR[10] = WIFI_POWER_2dBm;    // 8

  WiFi.disconnect(true, true);
  WiFi.mode(WIFI_STA);
  WiFi.setMinSecurity(WIFI_AUTH_WPA2_PSK);  // Lower min security to WPA.
  for (int i = 0; i < 11; ++i) {
    WiFi.begin(ssid, password);
    wl_status_t status = WiFi.begin(ssid, password);
    WiFi.setTxPower(wifiPWR[i]);
    sprintf(msgbuf, "Try WiFi connection by %d...", WiFi.getTxPower());
    Serial.printf(msgbuf);
    display.println(msgbuf);

    delay(10000);
    if (status != WL_CONNECTED) {
      status = WiFi.status();
      sprintf(msgbuf,
              status == WL_NO_SHIELD ? "no shield\n" : status == WL_IDLE_STATUS     ? "idle\n"
                                                     : status == WL_NO_SSID_AVAIL   ? "no ssid available\n"
                                                     : status == WL_SCAN_COMPLETED  ? "scan completed\n"
                                                     : status == WL_CONNECT_FAILED  ? "connect failed\n"
                                                     : status == WL_CONNECTION_LOST ? "connection lost\n"
                                                     : status == WL_DISCONNECTED    ? "disconnected\n"
                                                                                    : "connected\n");
    } else sprintf(msgbuf, "conncted\n");
    Serial.printf(msgbuf);
    display.println(msgbuf);
    WiFi.disconnect(true, true);
    WiFi.reconnect();
  }
}

// WiFi Security CHeck
void wifi_sec_chk() {
  Serial.println("WiFi Security CHeck");
  display.println("WiFi Security CHeck");

  wifi_auth_mode_t wifiSEC[6];
  wifiSEC[0] = WIFI_AUTH_OPEN;            /**< authenticate mode : open */
  wifiSEC[1] = WIFI_AUTH_WEP;             /**< authenticate mode : WEP */
  wifiSEC[2] = WIFI_AUTH_WPA_PSK;         /**< authenticate mode : WPA_PSK */
  wifiSEC[3] = WIFI_AUTH_WPA2_PSK;        /**< authenticate mode : WPA2_PSK */
  wifiSEC[4] = WIFI_AUTH_WPA_WPA2_PSK;    /**< authenticate mode : WPA_WPA2_PSK */
  wifiSEC[5] = WIFI_AUTH_WPA2_ENTERPRISE; /**< authenticate mode : WPA2_ENTERPRISE */

  WiFi.disconnect(true, true);
  WiFi.mode(WIFI_STA);
  for (int i = 0; i < 6; ++i) {
    WiFi.begin(ssid, password);
    wl_status_t status = WiFi.begin(ssid, password);
    WiFi.setMinSecurity(wifiSEC[i]);
    switch (wifiSEC[i]) {
      case WIFI_AUTH_OPEN:
        sprintf(msgbuf, "Try WiFi connection by open ...\n");
        break;
      case WIFI_AUTH_WEP:
        sprintf(msgbuf, "Try WiFi connection by WEP ...\n");
        break;
      case WIFI_AUTH_WPA_PSK:
        sprintf(msgbuf, "Try WiFi connection by WPA ...\n");
        break;
      case WIFI_AUTH_WPA2_PSK:
        sprintf(msgbuf, "Try WiFi connection by WPA2 ...\n");
        break;
      case WIFI_AUTH_WPA_WPA2_PSK:
        sprintf(msgbuf, "Try WiFi connection by WPA+WPA2 ...\n");
        break;
      case WIFI_AUTH_WPA2_ENTERPRISE:
        sprintf(msgbuf, "Try WiFi connection by WPA2-EAP ...\n");
        break;
      default:
        sprintf(msgbuf, "Setting error!\n");
    }
    Serial.printf(msgbuf);
    display.println(msgbuf);

    delay(10000);
    if (status != WL_CONNECTED) {
      status = WiFi.status();
      sprintf(msgbuf,
              status == WL_NO_SHIELD ? "no shield\n" : status == WL_IDLE_STATUS     ? "idle\n"
                                                     : status == WL_NO_SSID_AVAIL   ? "no ssid available\n"
                                                     : status == WL_SCAN_COMPLETED  ? "scan completed\n"
                                                     : status == WL_CONNECT_FAILED  ? "connect failed\n"
                                                     : status == WL_CONNECTION_LOST ? "connection lost\n"
                                                     : status == WL_DISCONNECTED    ? "disconnected\n"
                                                                                    : "connected\n");
    } else sprintf(msgbuf, "conncted\n");
    Serial.printf(msgbuf);
    display.println(msgbuf);
    WiFi.disconnect(true, true);
    WiFi.reconnect();
  }
}

void setup() {
  TimerCAM.begin();
  display.begin();
  WiFi.begin();

  Serial.begin(115200);
  display.setTextSize(2);
  display.setRotation(3);
  display.setTextScroll(true);
  display.clear(TFT_BLACK);

  // Show MacAddress
  byte mac[6];
  WiFi.macAddress(mac);
  sprintf(msgbuf, "MAC Address : \n %02x:%02x:%02x:%02x:%02x:%02x\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
  Serial.printf(msgbuf);
  display.println(msgbuf);

  // Show WiFi Power (Default)
  WiFi.disconnect(true, true);
  tx_power = WiFi.getTxPower();  // デフォルトの送信出力取得 19.5dBmだと78
  sprintf(msgbuf, "Default TxPower: %d\n", tx_power);
  Serial.printf(msgbuf);
  display.println(msgbuf);
  delay(5000);

  display.clear(TFT_BLACK);
  wifi_sec_chk();
  display.clear(TFT_BLACK);
  wifi_power_chk();
}

void loop() {
  //WiFi スキャン
  Serial.println("WiFi Scan start");
  display.println("WiFi Scan start");

  // WiFi.scanNetworks will return the number of networks found.
  int n = WiFi.scanNetworks();
  Serial.println("WiFi Scan done");
  display.println("WiFi Scan done");
  if (n == 0) {
    Serial.println("no networks found\n");
    display.println("no networks found\n");
  } else {
    sprintf(msgbuf, "%2d networks found\n", n);
    Serial.printf(msgbuf);
    display.println(msgbuf);
    Serial.println("Nr | SSID                             | RSSI | CH | Encryption");
    display.println("Nr | SSID                             | RSSI | CH | Encryption");
    for (int i = 0; i < n; ++i) {
      // Print SSID and RSSI for each network found
      sprintf(msgbuf, "%2d | %-32.32s | %4d | %2d | ", i + 1, WiFi.SSID(i).c_str(), WiFi.RSSI(i), WiFi.channel(i));
      Serial.printf(msgbuf);
      display.println(msgbuf);
      switch (WiFi.encryptionType(i)) {
        case WIFI_AUTH_OPEN:
          sprintf(msgbuf, "open\n");
          break;
        case WIFI_AUTH_WEP:
          sprintf(msgbuf, "WEP\n");
          break;
        case WIFI_AUTH_WPA_PSK:
          sprintf(msgbuf, "WPA\n");
          break;
        case WIFI_AUTH_WPA2_PSK:
          sprintf(msgbuf, "WPA2\n");
          break;
        case WIFI_AUTH_WPA_WPA2_PSK:
          sprintf(msgbuf, "WPA+WPA2\n");
          break;
        case WIFI_AUTH_WPA2_ENTERPRISE:
          sprintf(msgbuf, "WPA2-EAP\n");
          break;
        case WIFI_AUTH_WPA3_PSK:
          sprintf(msgbuf, "WPA3\n");
          break;
        case WIFI_AUTH_WPA2_WPA3_PSK:
          sprintf(msgbuf, "WPA2+WPA3\n");
          break;
        case WIFI_AUTH_WAPI_PSK:
          sprintf(msgbuf, "WAPI\n");
          break;
        default:
          sprintf(msgbuf, "unknown\n");
      }
      Serial.printf(msgbuf);
      display.println(msgbuf);
      delay(10);
    }
  }
  Serial.printf("");
  display.println("");

  // Delete the scan result to free memory for code below.
  WiFi.scanDelete();

  // Wait a bit before scanning again.
  delay(5000);
  TimerCAM.Power.powerOff();
}

調べては継ぎ足しして作成したので、冗長な記述が多いです(汗

なおwifi_chk.hは、ssidとpasswordのみを宣言しています。 wifi_sec_chk()がセキュリティ設定を変更して接続チェックを行っています。wifi_power_chk()は電波強度を変更して接続チェックを行っています。なお、loop()ないでWiFiスキャンを行っています。

実行した結果は下記になります:

MAC Address : 
 **:**:**:**:**:**
Default TxPower: 78
WiFi Security CHeck
Try WiFi connection by open ...
disconnected
Try WiFi connection by WEP ...
disconnected
Try WiFi connection by WPA ...
disconnected
Try WiFi connection by WPA2 ...
disconnected
Try WiFi connection by WPA+WPA2 ...
disconnected
Try WiFi connection by WPA2-EAP ...
no ssid available
WiFi Power CHeck
Try WiFi connection by 72...disconnected
Try WiFi connection by 72...disconnected
Try WiFi connection by 72...disconnected
Try WiFi connection by 66...disconnected
Try WiFi connection by 60...disconnected
Try WiFi connection by 50...disconnected
Try WiFi connection by 38...disconnected
Try WiFi connection by 28...disconnected
Try WiFi connection by 28...disconnected
Try WiFi connection by 14...disconnected
Try WiFi connection by 2...disconnected
WiFi Scan start
WiFi Scan done
 3 networks found
Nr | SSID                             | RSSI | CH | Encryption
 1 | ***********                      |  -85 | 11 | WPA+WPA2
 2 | ***********                      |  -89 |  4 | WPA2
 3 | ***********                      |  -93 |  4 | WPA2

MACアドレスは正常に表示され、WiFiスキャンも実行されました。しかし、セキュリティや電波強度の変更を行ってもまったく繋がる様子がありません。スキャンは正常なのに何で?!って感じです。また、電波強度は設定した値と読み取った値が異なることも良くわかりません。今度、M5STAMP Picoで試してみたいと思います

最終手段でフラッシュメモリをクリアして、工場出荷状態に戻して上記テストを再度行ってみました(フラッシュメモリのクリアは自己責任でお願いします)。クリアにはesptool.pyを使用します。入手先はEspressifのGithubになります

https://github.com/espressif/esptool

下記コマンドにて、フラッシュをクリアできます

”esptool.py -p シリアルポート名 erase_flash"

残念ながら フラッシュメモリをクリアでも問題は改善しませんした。と言うわけで最初に記載した通り、結果はWiFiには何をやっても繋がりませんでした。

念のため、蓋を開けて確認しましたが老いた目では問題があるようには見えません


当初の予定通りカメラボードとして、余生を過ごしてもらう結果になりました

参考にさせて頂きましたサイト:

2025年5月9日金曜日

Timer Camera X(ジャンク)で画像をLCDで表示

M5STACK ESP32 PSRAM Timer Camera Xのジャンク品を購入しました。ジャンク理由はWiFiに接続できたことが無いとなっていましたが、とりあえずカメラが使えればと購入しました

最初にカメラがちゃんと動作するかをテストします。と言っても液晶は付いていないんので、Groveコネクタ経由でLCD Unitに映像を表示させることにしました。なお、JEPEGモード、320x240で撮影し、それをLCD Unitに表示する簡単な記述になります。

#include <M5TimerCAM.h>
#include <M5GFX.h>
#include <MUnitLCD.h>

// M5UnitLCD display;                 // default setting
M5UnitLCD display(4, 13, 400000);  // SDA, SCL, FREQ

void setup() {
  TimerCAM.begin();
  display.begin();

  // display setting
  display.setRotation(0);
  display.clear(TFT_BLACK);

  if (!TimerCAM.Camera.begin()) {
    Serial.println("Camera Init Fail");
    return;
  }
  Serial.println("Camera Init Success");

  // Cammera setting
  TimerCAM.Camera.sensor->set_pixformat(TimerCAM.Camera.sensor, PIXFORMAT_JPEG);  // 画像フォーマット
  TimerCAM.Camera.sensor->set_framesize(TimerCAM.Camera.sensor, FRAMESIZE_QVGA);  // 画像サイズ:320x240

  TimerCAM.Camera.sensor->set_vflip(TimerCAM.Camera.sensor, 1);    //上下反転 0無効 1有効
  TimerCAM.Camera.sensor->set_hmirror(TimerCAM.Camera.sensor, 0);  //左右反転 0無効 1有効
}

void loop() {
  while(true) {
    if (TimerCAM.Camera.get()) {
      TimerCAM.Power.setLed(255);  // LED点灯
      Serial.printf("pic size: %d\n", TimerCAM.Camera.fb->len);

      int32_t data_size = TimerCAM.Camera.fb->len;
      uint8_t* sata_buf = TimerCAM.Camera.fb->buf;

      if (data_size != 0) {
        display.drawJpg(sata_buf, data_size, 0, 0, 320, 240);
        data_size = 0;
      }

      TimerCAM.Camera.free();
      TimerCAM.Power.setLed(0);
    }
  }
  TimerCAM.Camera.free();
  TimerCAM.Power.setLed(0);
  TimerCAM.Power.setLed(0);
}

簡単な記述なので、サクッと動作しました

カメラの詳細設定に関しては、今後いろいろと試したいと思います。

記述してから気が付きましたが、動作チェックが目的であればcameraToolsを使用すれば、もっと簡単にできました。やはり、ドキュメントは見ないといけませんね

2025年5月8日木曜日

LCD Unitを使ってみよう!

先日、LCD Unitのファームウェアをアップデートしましたが実際に使用していなかったので、M5StickC Plus2に接続して表示させてみました

基本的にはサンプルデザインを流用して記述しました。サンプル記述では、メッセージ表示後に丸と四角のランダムパターンを表示します

// #include <M5StickCPlus2.h>
// #include <M5GFX.h>
#include <Arduino.h>
#include <M5UnitLCD.h>
#include <M5Unified.h>

void setup(void) {
  auto cfg = M5.config();

  // M5 UnitLCD display setting.
  // cfg.external_display.unit_lcd = true;

  #if defined(__M5GFX_M5UNITLCD__)       // setting for Unit LCD.
    cfg.unit_lcd.pin_sda = GPIO_NUM_32;  // Grove I2C SDA pin
    cfg.unit_lcd.pin_scl = GPIO_NUM_33;  // Grove I2C SCL pin
    cfg.unit_lcd.i2c_addr = 0x3E;        // I2C Adress
    cfg.unit_lcd.i2c_freq = 400000;
    cfg.unit_lcd.i2c_port = I2C_NUM_0;
  #endif

  M5.begin(cfg);

  // Get the number of available displays
  int display_count = M5.getDisplayCount();

  for (int i = 0; i < display_count; ++i) {
    M5.Displays(i).setRotation(3);
    int textsize = M5.Displays(i).height() / 60;
    if (textsize == 0) { textsize = 1; }
    M5.Displays(i).setTextSize(textsize);
    Serial.printf("No.%d\n", i);
    M5.Displays(i).printf("No.%d\n", i);
  }


  // If an external display is to be used as the main display, it can be listed in order of priority.
  //  M5.setPrimaryDisplayType( m5::board_t::board_M5UnitLCD );
  M5.Display.print("primary display\n");


  int index_unit_lcd = M5.getDisplayIndex(m5::board_t::board_M5UnitLCD);
  M5.Displays(index_unit_lcd).print("This is  M5 UnitLCD display\n");
  M5.delay(10000);
}


// When creating a function for drawing, it can be used universally by accepting a LovyanGFX type as an argument.
void draw_function(LovyanGFX* gfx) {
  int x = rand() % gfx->width();
  int y = rand() % gfx->height();
  int r = (gfx->width() >> 4) + 2;
  uint16_t c = rand();
  gfx->fillRect(x - r, y - r, r * 2, r * 2, c);
}


void loop(void) {
  M5.delay(1);

  for (int i = 0; i < M5.getDisplayCount(); ++i) {
    int x = rand() % M5.Displays(i).width();
    int y = rand() % M5.Displays(i).height();
    int r = (M5.Displays(i).width() >> 4) + 2;
    uint16_t c = rand();
    M5.Displays(i).fillCircle(x, y, r, c);
  }

  for (int i = 0; i < M5.getDisplayCount(); ++i) {
    draw_function(&M5.Displays(i));
  }
}

なお、#include <Arduino.h>を宣言していないと、上記記述の14行目~17行名で構造体 config_tにunit_lcdが無いといった趣旨のエラーが発生します。勉強不足で、嵌まってしましいましたよ。

参考にさせて頂きましたサイト:

2025年5月2日金曜日

M5StickC Plus2でWifi接続

 M5STACK 製品をいくつか購入していますが、いまだWifiに接続したことが無かったので試してみました。調べてみたところ、WiFi.hを使用すれば簡単に接続できるようです

#include <M5StickCPlus2.h>
#include <M5Unified.h>
#include <WiFi.h>

const char* ssid = "********";        // 接続先WiFiのSSID
const char* password = "********";    // 接続先WiFiのパスワード

void setup() {
  auto cfg = M5.config();
  M5.begin(cfg);

  M5.Lcd.fillScreen(BLACK);
  M5.Lcd.setBrightness(5);
  M5.Lcd.setRotation(3);                           // 画面向き
  M5.Lcd.setTextSize(2);                           // フォントサイズ

  M5.Lcd.print("SSID : ");
  M5.Lcd.println(ssid);

  WiFi.begin(ssid, password);  // WiFi接続

  M5.Lcd.print("Connecting");

  while (WiFi.status() != WL_CONNECTED) {  // 接続チェック
    delay(500);
    M5.Lcd.print(".");
  }

  M5.Lcd.println("");
  M5.Lcd.print("IP Adress : \n");
  M5.Lcd.println(WiFi.localIP());  // IPアドレス表示
}

void loop() {}

wifi.begin()で接続して、Wifi.status()で接続チェックを行うだけでと簡単でした。実行も問題なくでき簡単です。

折角、Wifiに接続できましたので、APIなどを使用しないで使えるNTPサーバーに接続して日時を取得して表示するスケッチを作成しました

#include <M5StickCPlus2.h>
#include <M5Unified.h>
#include <WiFi.h>

#define JST 9 * 3600L

const char* ssid = "********";        // 接続先WiFiのSSID
const char* password = "********";    // 接続先WiFiのパスワード

void setup() {
  auto cfg = M5.config();
  M5.begin(cfg);

  M5.Lcd.fillScreen(BLACK);
  M5.Lcd.setBrightness(5);
  M5.Lcd.setRotation(3);  // 画面向き
  M5.Lcd.setTextSize(2);  // フォントサイズ

  M5.Lcd.print("SSID : ");
  M5.Lcd.println(ssid);

  WiFi.begin(ssid, password);  // WiFi接続

  M5.Lcd.print("Connecting");

  while (WiFi.status() != WL_CONNECTED) {  // 接続チェック
    delay(500);
    M5.Lcd.print(".");
  }

  M5.Lcd.println("");
  M5.Lcd.print("IP Adress : \n");
  M5.Lcd.println(WiFi.localIP());  // IPアドレス表示

  // NTPサーバと、ローカルのタイムゾーンを設定
  // タイムゾーン:日本、夏時間無し、PUBLIC NTPと日本標準時グループに接続
  configTime(JST, 0, "ntp.nict.jp", "ntp.jst.mfeed.ad.jp"); 
}

void loop() {
  M5.Lcd.clear(BLACK);
  M5.Lcd.setCursor(0, 0);
  struct tm tm;
  /*
    tm構造体の要素:
    int tm_sec    秒:(0~61)
    int tm_min    分:(0~59)
    int tm_hour   時:(0~23)
    int tm_mday   日:(1~31)
    int tm_mon    1月からの月数:(0~11)
    int tm_year   1900年からの年数
    int tm_wday   日曜日からの日数:(0~6)
    int tm_yday   1月1日からの日数:(0~365)
    int tm_isdst  夏時間フラグ
 */
  getLocalTime(&tm);
  M5.Lcd.printf(" %04d/%02d/%02d %02d:%02d:%02d",
               tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,  // 年、月、日
               tm.tm_hour, tm.tm_min, tm.tm_sec);             // 時、分、秒
  delay(1000);
}

#define JSTは日本時間にするための設定で、configTime()でPUBLIC NTPと日本標準時グループに接続して時間を取得しています、なお、メモとして構造体 tmの内容をコメントとして記載しています。ま、使用するたびに調べるのが面倒なだけですが...

無事に動作し、時間を取得できました。

NTPサーバーへの接続は、WEBサービスを使用するスケッチの最初の一歩ですね