台灣智能感測科技 https://www.taiwansensor.com.tw/ 遵循業界標準製造的優質產品, 值得您的信賴 Fri, 02 Feb 2024 03:47:53 +0000 zh-TW hourly 1 自動化工業篇 – 使用 Home Assistant 實時控制監控並自動化您的 IoT 設備 https://www.taiwansensor.com.tw/%e8%87%aa%e5%8b%95%e5%8c%96%e5%b7%a5%e6%a5%ad%e7%af%87-%e4%bd%bf%e7%94%a8-home-assistant-%e5%af%a6%e6%99%82%e6%8e%a7%e5%88%b6%e7%9b%a3%e6%8e%a7%e4%b8%a6%e8%87%aa%e5%8b%95%e5%8c%96%e6%82%a8%e7%9a%84/ https://www.taiwansensor.com.tw/%e8%87%aa%e5%8b%95%e5%8c%96%e5%b7%a5%e6%a5%ad%e7%af%87-%e4%bd%bf%e7%94%a8-home-assistant-%e5%af%a6%e6%99%82%e6%8e%a7%e5%88%b6%e7%9b%a3%e6%8e%a7%e4%b8%a6%e8%87%aa%e5%8b%95%e5%8c%96%e6%82%a8%e7%9a%84/#respond Fri, 02 Feb 2024 03:32:30 +0000 https://www.taiwansensor.com.tw/?p=65904 智能工業革命的關鍵元素 ─ Home Assistant的深度研究 首先,本文主要探討在考慮易用性和低成本的情 […]

這篇文章 自動化工業篇 – 使用 Home Assistant 實時控制監控並自動化您的 IoT 設備 最早出現於 台灣智能感測科技

]]>
智能工業革命的關鍵元素 ─ Home Assistant的深度研究

首先,本文主要探討在考慮易用性和低成本的情況下,中小型企業如何巧妙運用工具實現自動化。值得注意的是,本文的重點並非要替代傳統設備,而是在整合現有傳統設備的基礎上,透過導入智慧監控平台,實現經濟效益下的自動化效果。在大型工業環境中,數據平台的選擇通常受到高昂的價格和複雜操作的困擾。然而,Home Assistant以其簡單易用和低成本的特點,顯著地與市售大型工業數據平台形成鮮明對比。

 

  • 成本對比:
    大型工業數據平台通常需要龐大的投資,包括硬體、軟體、許可費用等。這對中小企業而言可能是一個沉重的負擔。相較之下,Home Assistant是一個開源平台,無需付出昂貴的許可費用,並且可以在普通硬體上運行,因此明顯節省了導入成本。
  • 易用性對比:
    大型工業數據平台通常需要專業人員進行設置、配置和維護,其操作界面可能相對複雜,對非技術人員來說具有一定門檻。相反,Home Assistant以其簡潔直觀的用戶界面,使得即使是缺乏技術背景的用戶也能夠輕鬆上手。它提供了友好的設置選項和自動化腳本,使得整個過程更加容易上手。
  • 可擴展性對比:
    大型工業數據平台雖然強大,但其擴展性可能受到一定的限制。在增加設備或擴大生產線時,需要進行複雜的配置和硬體更新。相反,Home Assistant以其模組化和可擴展的特點,讓用戶可以根據實際需求輕松地添加新的設備或整合新的功能,不受硬體和軟體的限制。

隨著科技的快速發展,Home Assistant不僅僅是個人智能生活的引領者,更成為中小型企業導入自動化工廠和物聯網數據平台的得力幫手。本文將深入探討Home Assistant在工業領域中的應用,以及它如何透過自動化和物聯網技術,強化企業內容並提升生產效能。Home Assistant作為一個低成本、易用且高度可擴展的選擇,顯著擁有優勢,特別適用於中小企業或資源有限的企業環境。相對於昂貴且複雜的大型工業數據平台,Home Assistant為企業提供了更加經濟實惠和靈活的解決方案。

external

首先,Home Assistant在自動化工廠中發揮了巨大的優勢。透過與各種感測器、裝置的整合,企業可以實現生產線的即時監控和智能控制。這不僅提高了生產效率,還大幅降低了生產中的錯誤率,為企業節省成本並提供更高的品質保證。

其次,Home Assistant的物聯網數據平台功能使企業能夠更好地管理和分析生產數據。這包括從生產線上收集的各種數據,如設備狀態、生產效率等。透過這些寶貴的數據,企業可以進行更深入的分析,優化生產過程,預測設備的維護需求,進而實現智慧工廠的目標。

Home Assistant 的自由組合特點也在工業場景中發揮了極大的價值。企業可以根據實際需求選擇和整合各種智能設備,建立一個完全定制的工業智能系統。這樣的自由度使得企業能夠根據不同階段的發展需求進行靈活調整,不僅提高了投資的效益,也確保了系統的長期可持續性。

總的來說,Home Assistant不僅為普通家庭提供智能便利,同時也是工業領域引領自動化和物聯網發展的佼佼者。透過其卓越的功能,企業可以實現智慧工廠的夢想,提高生產效能,並在競爭激烈的市場中保持領先地位。讓我們共同見證Home Assistant在工業領域中引發的一場真正的技術革命。

 

這篇文章 自動化工業篇 – 使用 Home Assistant 實時控制監控並自動化您的 IoT 設備 最早出現於 台灣智能感測科技

]]>
https://www.taiwansensor.com.tw/%e8%87%aa%e5%8b%95%e5%8c%96%e5%b7%a5%e6%a5%ad%e7%af%87-%e4%bd%bf%e7%94%a8-home-assistant-%e5%af%a6%e6%99%82%e6%8e%a7%e5%88%b6%e7%9b%a3%e6%8e%a7%e4%b8%a6%e8%87%aa%e5%8b%95%e5%8c%96%e6%82%a8%e7%9a%84/feed/ 0
【2024 農曆春節】配送公告/客服服務時間 https://www.taiwansensor.com.tw/%e3%80%902024-%e8%be%b2%e6%9b%86%e6%98%a5%e7%af%80%e3%80%91%e9%85%8d%e9%80%81%e5%85%ac%e5%91%8a%ef%bc%8f%e5%ae%a2%e6%9c%8d%e6%9c%8d%e5%8b%99%e6%99%82%e9%96%93/ https://www.taiwansensor.com.tw/%e3%80%902024-%e8%be%b2%e6%9b%86%e6%98%a5%e7%af%80%e3%80%91%e9%85%8d%e9%80%81%e5%85%ac%e5%91%8a%ef%bc%8f%e5%ae%a2%e6%9c%8d%e6%9c%8d%e5%8b%99%e6%99%82%e9%96%93/#respond Tue, 30 Jan 2024 03:50:51 +0000 https://www.taiwansensor.com.tw/?p=65877 【2024 農曆春節】配送公告/客服服務時間 本公司農曆春節休假時間為113年2月8日至2月14日,於113年 […]

這篇文章 【2024 農曆春節】配送公告/客服服務時間 最早出現於 台灣智能感測科技

]]>
【2024 農曆春節】配送公告/客服服務時間

本公司農曆春節休假時間為113年2月8日至2月14日,於113年2月15日開始恢復營業。休假期間如需服務請留下郵件訊息,我們將在上班後儘速處理,造成不便煩請見諒。

台灣智能感測科技 誠摯感謝您這一年來的支持與關注,並敬祝各位新春佳節愉快。

出貨日公告

*【一般郵寄與宅配出貨】 02/05 (一) 中午12:00後成立並完成付款之訂單,將順延至年後【02/15】 出貨
*【超商店到店最後出貨】 最後出貨日期為02/05 (一)

這篇文章 【2024 農曆春節】配送公告/客服服務時間 最早出現於 台灣智能感測科技

]]>
https://www.taiwansensor.com.tw/%e3%80%902024-%e8%be%b2%e6%9b%86%e6%98%a5%e7%af%80%e3%80%91%e9%85%8d%e9%80%81%e5%85%ac%e5%91%8a%ef%bc%8f%e5%ae%a2%e6%9c%8d%e6%9c%8d%e5%8b%99%e6%99%82%e9%96%93/feed/ 0
讓你 RS485 區網連結更穩,通訊更順 ── 工業級光電隔離型 485 HUB 分配器帶您體驗無限可能! https://www.taiwansensor.com.tw/%e8%ae%93%e4%bd%a0-rs485-%e5%8d%80%e7%b6%b2%e9%80%a3%e7%b5%90%e6%9b%b4%e7%a9%a9%ef%bc%8c%e9%80%9a%e8%a8%8a%e6%9b%b4%e9%a0%86-%e2%94%80%e2%94%80-%e5%b7%a5%e6%a5%ad%e7%b4%9a%e5%85%89%e9%9b%bb%e9%9a%94/ https://www.taiwansensor.com.tw/%e8%ae%93%e4%bd%a0-rs485-%e5%8d%80%e7%b6%b2%e9%80%a3%e7%b5%90%e6%9b%b4%e7%a9%a9%ef%bc%8c%e9%80%9a%e8%a8%8a%e6%9b%b4%e9%a0%86-%e2%94%80%e2%94%80-%e5%b7%a5%e6%a5%ad%e7%b4%9a%e5%85%89%e9%9b%bb%e9%9a%94/#respond Fri, 15 Dec 2023 14:20:56 +0000 https://www.taiwansensor.com.tw/?p=65352 讓你 RS485 區網連結更穩,通訊更順 ── 工業級光電隔離型 485 HUB 分配器帶您體驗無限可能! 您 […]

這篇文章 讓你 RS485 區網連結更穩,通訊更順 ── 工業級光電隔離型 485 HUB 分配器帶您體驗無限可能! 最早出現於 台灣智能感測科技

]]>
讓你 RS485 區網連結更穩,通訊更順 ── 工業級光電隔離型 485 HUB 分配器帶您體驗無限可能!

您的通訊需求不斷增長,而我們有解決方案!推出我們的全新隔離型雙向 8 口 RS485 集線器 485 HUB 分配器,為您的工業自動化提供更穩定、更可靠的通訊環境。你的 485 網路是否老是不穩定? 你有想過是否因為外部的干擾而造成通訊的問題,這些其實在簡單的 485 通訊也許不常見,但在實際的產線上卻是搞得工程人員疲於奔命的主要原因。

隔離型 485 集線器的主要功能

  1. 抵禦外部干擾: 隔離保護能夠有效抵禦來自外部環境的干擾,例如電磁干擾(EMI)和射頻干擾(RFI),這些干擾可能來自其他電子設備、電源變動、或是周圍的設施。隔離確保通訊線路免受這些干擾的影響,提高通訊的穩定性和可靠性。
  2. 防止接地迴路: 在一些應用場景中,通訊設備可能存在不同的地點或地勢,可能會產生接地迴路。接地迴路可能導致系統不穩定、數據錯誤等問題。隔離保護可以有效防止接地迴路的產生,確保設備之間的連接不會影響通訊的正常運作。
  3. 提高安全性: 在某些應用中,特別是在工業自動化和控制系統中,隔離保護還能提高整體系統的安全性。隔離可以防止潛在的故障或故意的攻擊,確保數據的安全性和完整性。
  4. 擴展系統可靠性: 隔離保護有助於提高整個系統的可靠性。當通訊環境變得複雜或不穩定時,隔離可以減少數據傳輸中的錯誤和干擾,確保系統長時間運行而不受到中斷。

主要特色:

  1. 穩固的隔離保護:
    485 HUB 分配器擁有先進的隔離技術,確保您的通訊線路不受外部干擾,提供穩定、可靠的通訊連接。600W雷電浪湧保護電路提供1000V隔離電壓,有效抑制雷電和ESD保護。工業隔離保護內建光電隔離保護電路,可有效隔離RS485主從設備,避免設備間地電位差的損壞,防靜電防雷擊。抗突波,適用於可靠性和安全性要求高的工業環境。
  2. 雙向通訊:
    支援雙向通訊,使得數據的傳輸更加靈活,同時滿足不同應用場景的需求。內置CPU處理器自動檢測通道數據流方向,自動確定通道狀態,自動切換使能控制電路,輕鬆解決RS-485收發轉換延遲問題。
  3. 8 口 RS485 集線:
    提供 8 個 RS485 接口,滿足多設備連接的需求,讓您的系統更加靈活擴展。
  4. Plug and Play:
    簡單易用的 Plug and Play 設計,讓您迅速部署,節省時間成本,專注於更重要的任務。
  5. 廣泛應用:
    接電源,寬電壓輸入,外接電源,安全可靠,適合戶外使用,DC9-​​40V寬電壓輸入。適用於工業自動化、建築控制、能源管理等多個領域,提供最佳的通訊解決方案。

為何選擇我們的 485 HUB 分配器?

在通訊領域,穩定性和可靠性是關鍵。我們的產品通過嚴格的品質控制,確保每一個細節都達到最高標準。不僅如此,我們的技術支持團隊隨時待命,為您提供專業的支援,確保您的系統運行順暢。

立即升級您的通訊系統!

無論您是追求更高效率的生產線,還是需要一個可靠的通訊解決方案,我們的 485 HUB 分配器都是您的理想之選。立即升級,體驗連結更穩,通訊更順的新世界!

 

導軌安裝支持 支援35mm標準導軌,附導軌卡扣,安裝方便。

產品連結 https://www.taiwansensor.com.tw/sku/IOT-006042

這篇文章 讓你 RS485 區網連結更穩,通訊更順 ── 工業級光電隔離型 485 HUB 分配器帶您體驗無限可能! 最早出現於 台灣智能感測科技

]]>
https://www.taiwansensor.com.tw/%e8%ae%93%e4%bd%a0-rs485-%e5%8d%80%e7%b6%b2%e9%80%a3%e7%b5%90%e6%9b%b4%e7%a9%a9%ef%bc%8c%e9%80%9a%e8%a8%8a%e6%9b%b4%e9%a0%86-%e2%94%80%e2%94%80-%e5%b7%a5%e6%a5%ad%e7%b4%9a%e5%85%89%e9%9b%bb%e9%9a%94/feed/ 0
安裝 Arduino UNO R4 WiFi 開發板逐步指南 https://www.taiwansensor.com.tw/%e5%ae%89%e8%a3%9d-arduino-uno-r4-wifi-%e9%96%8b%e7%99%bc%e6%9d%bf%e9%80%90%e6%ad%a5%e6%8c%87%e5%8d%97/ https://www.taiwansensor.com.tw/%e5%ae%89%e8%a3%9d-arduino-uno-r4-wifi-%e9%96%8b%e7%99%bc%e6%9d%bf%e9%80%90%e6%ad%a5%e6%8c%87%e5%8d%97/#respond Thu, 16 Nov 2023 16:28:02 +0000 https://www.taiwansensor.com.tw/?p=64937 開始使用 Arduino UNO R4 WiFi / 安裝 UNO R4 WiFi 板的必要板套件的逐步指南 […]

這篇文章 安裝 Arduino UNO R4 WiFi 開發板逐步指南 最早出現於 台灣智能感測科技

]]>
開始使用 Arduino UNO R4 WiFi / 安裝 UNO R4 WiFi 板的必要板套件的逐步指南

要使用 Arduino UNO R4 WiFi 板,您需要安裝 UNO R4 WiFi 板套件,這是 Arduino UNO R4 Core 的一部分。要安裝它,您需要使用 Arduino IDE,您可以從 Arduino 軟體頁面下載。在本指南中,我們將使用 IDE 2 的最新版本

ADB-013521-3

軟體與硬體需求:

下載與安裝IDE 首先,我們需要從Arduino軟體頁面下載Arduino IDE。 將Arduino IDE安裝在您的本地機器上。 打開Arduino IDE。

安裝板套件 要安裝板套件,從左側的菜單中打開"Board Manager"。搜索UNO R4 WiFi,然後安裝最新版本(或您想使用的版本)。

恭喜您,您現在已成功通過Arduino IDE安裝了UNO R4 WiFi板套件。

編譯和上傳Sketches 要編譯和上傳Sketches,您可以使用:

  • 用於編譯代碼的勾選符號。
  • 用於上傳代碼的右箭頭。

UNO R4 WiFi板有多個範例可供使用,可以直接在IDE中通過File > Examples訪問。這些範例可以在不使用外部庫的情況下直接使用。

Tetris動畫Sketch UNO R4 WiFi預裝了一個Tetris動畫。如果您已經覆蓋了該Sketch並希望恢復板機以再次播放動畫,可以在這裡找到該Sketch:

#include "Arduino_LED_Matrix.h"
#include <stdint.h>

ArduinoLEDMatrix matrix;

const uint32_t frames[][4] = {
  {
    0xe0000000,
    0x0,
    0x0,
    66
  },
  {
    0x400e0000,
    0x0,
    0x0,
    66
  },
  {
    0x400e0,
    0x0,
    0x0,
    66
  },
  {
    0x40,
    0xe000000,
    0x0,
    66
  },
  {
    0x3000000,
    0x400e000,
    0x0,
    66
  },
  {
    0x3003000,
    0x400e,
    0x0,
    66
  },
  {
    0x3003,
    0x4,
    0xe00000,
    66
  },
  {
    0x3,
    0x300000,
    0x400e00,
    66
  },
  {
    0x0,
    0x300300,
    0x400e00,
    66
  },
  {
    0x1c000000,
    0x300,
    0x30400e00,
    66
  },
  {
    0x401c000,
    0x0,
    0x30430e00,
    66
  },
  {
    0x401c,
    0x0,
    0x430e30,
    66
  },
  {
    0x4,
    0x1c00000,
    0x430e30,
    66
  },
  {
    0x0,
    0x401c00,
    0x430e30,
    66
  },
  {
    0x800000,
    0x401,
    0xc0430e30,
    66
  },
  {
    0x800800,
    0x0,
    0x405f0e30,
    66
  },
  {
    0x800800,
    0x80000000,
    0x470ff0,
    66
  },
  {
    0x800800,
    0x80080000,
    0x470ff0,
    66
  },
  {
    0x800,
    0x80080080,
    0x470ff0,
    66
  },
  {
    0x38000000,
    0x80080080,
    0x8470ff0,
    66
  },
  {
    0x10038000,
    0x80080,
    0x8478ff0,
    66
  },
  {
    0x10038,
    0x80,
    0x8478ff8,
    66
  },
  {
    0x700010,
    0x3800080,
    0x8478ff8,
    66
  },
  {
    0x400700,
    0x1003880,
    0x8478ff8,
    66
  },
  {
    0x400,
    0x70001083,
    0x88478ff8,
    66
  },
  {
    0xf000000,
    0x40070081,
    0x87f8ff8,
    66
  },
  {
    0xf000,
    0x400f1,
    0x87f8ff8,
    66
  },
  {
    0x8000000f,
    0xc1,
    0xf7f8ff8,
    66
  },
  {
    0xc0080000,
    0xf00081,
    0xc7ffff8,
    66
  },
  {
    0x400c0080,
    0xf81,
    0x87fcfff,
    66
  },
  {
    0x3400c0,
    0x8000081,
    0xf87fcfff,
    66
  },
  {
    0x20200340,
    0xc008081,
    0xf87fcfff,
    66
  },
  {
    0x38220200,
    0x3400c089,
    0xf87fcfff,
    66
  },
  {
    0x38220,
    0x2003408d,
    0xf8ffcfff,
    66
  },
  {
    0x86100038,
    0x220240bd,
    0xf8ffcfff,
    66
  },
  {
    0xec186100,
    0x38260ad,
    0xfbffcfff,
    66
  },
  {
    0x3ec186,
    0x100078af,
    0xfaffffff,
    66
  },
  {
    0x114003ec,
    0x186178af,
    0xfaffffff,
    66
  },
  {
    0x3b411400,
    0x3ec1febf,
    0xfaffffff,
    66
  },
  {
    0x143b411,
    0x4ec3febf,
    0xfbffffff,
    66
  },
  {
    0xc040143b,
    0x4fd7febf,
    0xfbffffff,
    66
  },
  {
    0xc60c0439,
    0x4ff7ffff,
    0xfbffffff,
    66
  },
  {
    0x33c60f9,
    0x4ff7ffff,
    0xffffffff,
    66
  },
  {
    0x3cbc33ff,
    0x4ff7ffff,
    0xffffffff,
    66
  },
  {
    0x8ffbff,
    0x7ff7ffff,
    0xffffffff,
    66
  },
  {
    0xf0cffbff,
    0xfff7ffff,
    0xffffffff,
    66
  },
  {
    0xfe1fffff,
    0xffffffff,
    0xffffffff,
    66
  },
  {
    0xffffffff,
    0xffffffff,
    0xffffffff,
    66
  },
  {
    0x7fffffff,
    0xffffffff,
    0xfffff7ff,
    66
  },
  {
    0x3fe7ffff,
    0xffffffff,
    0xff7ff3fe,
    66
  },
  {
    0x1fc3fe7f,
    0xfffffff7,
    0xff3fe1fc,
    66
  },
  {
    0xf81fc3f,
    0xe7ff7ff3,
    0xfe1fc0f8,
    66
  },
  {
    0x500f81f,
    0xc3fe3fe1,
    0xfc0f8070,
    66
  },
  {
    0x500f,
    0x81fc1fc0,
    0xf8070020,
    66
  },
  {
    0x5,
    0xf80f80,
    0x70020000,
    66
  },
  {
    0x5,
    0xa80880,
    0x50020000,
    600
  },
  {
    0xd812,
    0x41040880,
    0x50020000,
    200
  },
  {
    0x5,
    0xa80880,
    0x50020000,
    0xFFFFFFFF
  }
};

void setup() {
  Serial.begin(115200);
  // you can also load frames at runtime, without stopping the refresh
  matrix.loadSequence(frames);
  matrix.begin();
  // turn on autoscroll to avoid calling next() to show the next frame; the parameter is in milliseconds
  // matrix.autoscroll(300);
  matrix.play(true);
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  digitalWrite(LED_BUILTIN, HIGH);
  delay(1000);
  digitalWrite(LED_BUILTIN, LOW);
  delay(1000);
}

總結 在這個教程中,我們使用Arduino IDE安裝了UNO R4 WiFi板套件。

對於與UNO R4 WiFi板套件相關的任何問題,請參考Arduino UNO R4 Core。

UNO R4 WiFi 網路範例

Arduino UNO R4 WiFi內建ESP32-S3模組,使您能夠連接到Wi-Fi®網路並執行網路操作。已經測試並支援包括HTTPS、MQTT、UDP等協議,本文將提供一系列範例,讓您可以輕鬆入門。

Wi-Fi®支援是通過內建的WiFiS3庫實現的,該庫隨Arduino UNO R4 Core一起發送。安裝核心時,將自動安裝WiFiS3庫。

範例 本節列舉的範例已經經過測試並驗證可行。大多數範例需要您輸入您本地Wi-Fi®網路的SSID和密碼。作為標準慣例,在我們的所有範例中,我們將這些信息存儲在一個單獨的標頭文件中(稱為arduino_secrets.h)。

您需要創建這個文件,或者在每個範例的頂部刪除#include "arduino_secrets.h"文件。該文件應包含:

//arduino_secrets.h header file
#define SECRET_SSID "yournetwork"
#define SECRET_PASS "yourpassword"

Access Point 模式

/*
  WiFi Web Server LED Blink

  A simple web server that lets you blink an LED via the web.
  This sketch will create a new access point (with no password).
  It will then launch a new server and print out the IP address
  to the Serial Monitor. From there, you can open that address in a web browser
  to turn on and off the LED on pin 13.

  If the IP address of your board is yourAddress:
    http://yourAddress/H turns the LED on
    http://yourAddress/L turns it off

  created 25 Nov 2012
  by Tom Igoe
  adapted to WiFi AP by Adafruit

  Find the full UNO R4 WiFi Network documentation here:
  https://docs.arduino.cc/tutorials/uno-r4-wifi/wifi-examples#access-point
 */

#include "WiFiS3.h"

#include "arduino_secrets.h" 

///////please enter your sensitive data in the Secret tab/arduino_secrets.h
char ssid[] = SECRET_SSID;        // your network SSID (name)
char pass[] = SECRET_PASS;        // your network password (use for WPA, or use as key for WEP)
int keyIndex = 0;                 // your network key index number (needed only for WEP)

int led =  LED_BUILTIN;
int status = WL_IDLE_STATUS;
WiFiServer server(80);

void setup() {
  //Initialize serial and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }
  Serial.println("Access Point Web Server");

  pinMode(led, OUTPUT);      // set the LED pin mode

  // check for the WiFi module:
  if (WiFi.status() == WL_NO_MODULE) {
    Serial.println("Communication with WiFi module failed!");
    // don't continue
    while (true);
  }

  String fv = WiFi.firmwareVersion();
  if (fv < WIFI_FIRMWARE_LATEST_VERSION) {
    Serial.println("Please upgrade the firmware");
  }

  // by default the local IP address will be 192.168.4.1
  // you can override it with the following:
  WiFi.config(IPAddress(192,48,56,2));

  // print the network name (SSID);
  Serial.print("Creating access point named: ");
  Serial.println(ssid);

  // Create open network. Change this line if you want to create an WEP network:
  status = WiFi.beginAP(ssid, pass);
  if (status != WL_AP_LISTENING) {
    Serial.println("Creating access point failed");
    // don't continue
    while (true);
  }

  // wait 10 seconds for connection:
  delay(10000);

  // start the web server on port 80
  server.begin();

  // you're connected now, so print out the status
  printWiFiStatus();
}


void loop() {
  
  // compare the previous status to the current status
  if (status != WiFi.status()) {
    // it has changed update the variable
    status = WiFi.status();

    if (status == WL_AP_CONNECTED) {
      // a device has connected to the AP
      Serial.println("Device connected to AP");
    } else {
      // a device has disconnected from the AP, and we are back in listening mode
      Serial.println("Device disconnected from AP");
    }
  }
  
  WiFiClient client = server.available();   // listen for incoming clients

  if (client) {                             // if you get a client,
    Serial.println("new client");           // print a message out the serial port
    String currentLine = "";                // make a String to hold incoming data from the client
    while (client.connected()) {            // loop while the client's connected
      delayMicroseconds(10);                // This is required for the Arduino Nano RP2040 Connect - otherwise it will loop so fast that SPI will never be served.
      if (client.available()) {             // if there's bytes to read from the client,
        char c = client.read();             // read a byte, then
        Serial.write(c);                    // print it out to the serial monitor
        if (c == '\n') {                    // if the byte is a newline character

          // if the current line is blank, you got two newline characters in a row.
          // that's the end of the client HTTP request, so send a response:
          if (currentLine.length() == 0) {
            // HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK)
            // and a content-type so the client knows what's coming, then a blank line:
            client.println("HTTP/1.1 200 OK");
            client.println("Content-type:text/html");
            client.println();

            // the content of the HTTP response follows the header:
            client.print("<p style=\"font-size:7vw;\">Click <a href=\"/H\">here</a> turn the LED on<br></p>");
            client.print("<p style=\"font-size:7vw;\">Click <a href=\"/L\">here</a> turn the LED off<br></p>");

            // The HTTP response ends with another blank line:
            client.println();
            // break out of the while loop:
            break;
          }
          else {      // if you got a newline, then clear currentLine:
            currentLine = "";
          }
        }
        else if (c != '\r') {    // if you got anything else but a carriage return character,
          currentLine += c;      // add it to the end of the currentLine
        }

        // Check to see if the client request was "GET /H" or "GET /L":
        if (currentLine.endsWith("GET /H")) {
          digitalWrite(led, HIGH);               // GET /H turns the LED on
        }
        if (currentLine.endsWith("GET /L")) {
          digitalWrite(led, LOW);                // GET /L turns the LED off
        }
      }
    }
    // close the connection:
    client.stop();
    Serial.println("client disconnected");
  }
}

void printWiFiStatus() {
  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());

  // print your WiFi shield's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);

  // print where to go in a browser:
  Serial.print("To see this page in action, open a browser to http://");
  Serial.println(ip);

}

/*
  WiFi Web Server LED Blink

  A simple web server that lets you blink an LED via the web.
  This sketch will create a new access point (with no password).
  It will then launch a new server and print out the IP address
  to the Serial Monitor. From there, you can open that address in a web browser
  to turn on and off the LED on pin 13.

  If the IP address of your board is yourAddress:
    http://yourAddress/H turns the LED on
    http://yourAddress/L turns it off

  created 25 Nov 2012
  by Tom Igoe
  adapted to WiFi AP by Adafruit

  Find the full UNO R4 WiFi Network documentation here:
  https://docs.arduino.cc/tutorials/uno-r4-wifi/wifi-examples#access-point
 */

#include "WiFiS3.h"

#include "arduino_secrets.h" 

///////please enter your sensitive data in the Secret tab/arduino_secrets.h
char ssid[] = SECRET_SSID;        // your network SSID (name)
char pass[] = SECRET_PASS;        // your network password (use for WPA, or use as key for WEP)
int keyIndex = 0;                 // your network key index number (needed only for WEP)

int led =  LED_BUILTIN;
int status = WL_IDLE_STATUS;
WiFiServer server(80);

void setup() {
  //Initialize serial and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }
  Serial.println("Access Point Web Server");

  pinMode(led, OUTPUT);      // set the LED pin mode

  // check for the WiFi module:
  if (WiFi.status() == WL_NO_MODULE) {
    Serial.println("Communication with WiFi module failed!");
    // don't continue
    while (true);
  }

  String fv = WiFi.firmwareVersion();
  if (fv < WIFI_FIRMWARE_LATEST_VERSION) {
    Serial.println("Please upgrade the firmware");
  }

  // by default the local IP address will be 192.168.4.1
  // you can override it with the following:
  WiFi.config(IPAddress(192,48,56,2));

  // print the network name (SSID);
  Serial.print("Creating access point named: ");
  Serial.println(ssid);

  // Create open network. Change this line if you want to create an WEP network:
  status = WiFi.beginAP(ssid, pass);
  if (status != WL_AP_LISTENING) {
    Serial.println("Creating access point failed");
    // don't continue
    while (true);
  }

  // wait 10 seconds for connection:
  delay(10000);

  // start the web server on port 80
  server.begin();

  // you're connected now, so print out the status
  printWiFiStatus();
}


void loop() {
  
  // compare the previous status to the current status
  if (status != WiFi.status()) {
    // it has changed update the variable
    status = WiFi.status();

    if (status == WL_AP_CONNECTED) {
      // a device has connected to the AP
      Serial.println("Device connected to AP");
    } else {
      // a device has disconnected from the AP, and we are back in listening mode
      Serial.println("Device disconnected from AP");
    }
  }
  
  WiFiClient client = server.available();   // listen for incoming clients

  if (client) {                             // if you get a client,
    Serial.println("new client");           // print a message out the serial port
    String currentLine = "";                // make a String to hold incoming data from the client
    while (client.connected()) {            // loop while the client's connected
      delayMicroseconds(10);                // This is required for the Arduino Nano RP2040 Connect - otherwise it will loop so fast that SPI will never be served.
      if (client.available()) {             // if there's bytes to read from the client,
        char c = client.read();             // read a byte, then
        Serial.write(c);                    // print it out to the serial monitor
        if (c == '\n') {                    // if the byte is a newline character

          // if the current line is blank, you got two newline characters in a row.
          // that's the end of the client HTTP request, so send a response:
          if (currentLine.length() == 0) {
            // HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK)
            // and a content-type so the client knows what's coming, then a blank line:
            client.println("HTTP/1.1 200 OK");
            client.println("Content-type:text/html");
            client.println();

            // the content of the HTTP response follows the header:
            client.print("<p style=\"font-size:7vw;\">Click <a href=\"/H\">here</a> turn the LED on<br></p>");
            client.print("<p style=\"font-size:7vw;\">Click <a href=\"/L\">here</a> turn the LED off<br></p>");

            // The HTTP response ends with another blank line:
            client.println();
            // break out of the while loop:
            break;
          }
          else {      // if you got a newline, then clear currentLine:
            currentLine = "";
          }
        }
        else if (c != '\r') {    // if you got anything else but a carriage return character,
          currentLine += c;      // add it to the end of the currentLine
        }

        // Check to see if the client request was "GET /H" or "GET /L":
        if (currentLine.endsWith("GET /H")) {
          digitalWrite(led, HIGH);               // GET /H turns the LED on
        }
        if (currentLine.endsWith("GET /L")) {
          digitalWrite(led, LOW);                // GET /L turns the LED off
        }
      }
    }
    // close the connection:
    client.stop();
    Serial.println("client disconnected");
  }
}

void printWiFiStatus() {
  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());

  // print your WiFi shield's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);

  // print where to go in a browser:
  Serial.print("To see this page in action, open a browser to http://");
  Serial.println(ip);

}

Connect With WPA 模式

/*
  This example connects to an unencrypted WiFi network.
  Then it prints the MAC address of the WiFi module,
  the IP address obtained, and other network details.

  created 13 July 2010
  by dlf (Metodo2 srl)
  modified 31 May 2012
  by Tom Igoe

  Find the full UNO R4 WiFi Network documentation here:
  https://docs.arduino.cc/tutorials/uno-r4-wifi/wifi-examples#connect-with-wpa
 */
#include <WiFiS3.h>

#include "arduino_secrets.h" 
///////please enter your sensitive data in the Secret tab/arduino_secrets.h
char ssid[] = SECRET_SSID;        // your network SSID (name)
char pass[] = SECRET_PASS;    // your network password (use for WPA, or use as key for WEP)
int status = WL_IDLE_STATUS;     // the WiFi radio's status

void setup() {
  //Initialize serial and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  // check for the WiFi module:
  if (WiFi.status() == WL_NO_MODULE) {
    Serial.println("Communication with WiFi module failed!");
    // don't continue
    while (true);
  }

  String fv = WiFi.firmwareVersion();
  if (fv < WIFI_FIRMWARE_LATEST_VERSION) {
    Serial.println("Please upgrade the firmware");
  }

  // attempt to connect to WiFi network:
  while (status != WL_CONNECTED) {
    Serial.print("Attempting to connect to WPA SSID: ");
    Serial.println(ssid);
    // Connect to WPA/WPA2 network:
    status = WiFi.begin(ssid, pass);

    // wait 10 seconds for connection:
    delay(10000);
  }

  // you're connected now, so print out the data:
  Serial.print("You're connected to the network");
  printCurrentNet();
  printWifiData();

}

void loop() {
  // check the network connection once every 10 seconds:
  delay(10000);
  printCurrentNet();
}

void printWifiData() {
  // print your board's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  
  Serial.println(ip);

  // print your MAC address:
  byte mac[6];
  WiFi.macAddress(mac);
  Serial.print("MAC address: ");
  printMacAddress(mac);
}

void printCurrentNet() {
  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());

  // print the MAC address of the router you're attached to:
  byte bssid[6];
  WiFi.BSSID(bssid);
  Serial.print("BSSID: ");
  printMacAddress(bssid);

  // print the received signal strength:
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.println(rssi);

  // print the encryption type:
  byte encryption = WiFi.encryptionType();
  Serial.print("Encryption Type:");
  Serial.println(encryption, HEX);
  Serial.println();
}

void printMacAddress(byte mac[]) {
  for (int i = 5; i >= 0; i--) {
    if (mac[i] < 16) {
      Serial.print("0");
    }
    Serial.print(mac[i], HEX);
    if (i > 0) {
      Serial.print(":");
    }
  }
  Serial.println();
}

/*
  This example connects to an unencrypted WiFi network.
  Then it prints the MAC address of the WiFi module,
  the IP address obtained, and other network details.

  created 13 July 2010
  by dlf (Metodo2 srl)
  modified 31 May 2012
  by Tom Igoe

  Find the full UNO R4 WiFi Network documentation here:
  https://docs.arduino.cc/tutorials/uno-r4-wifi/wifi-examples#connect-with-wpa
 */
#include <WiFiS3.h>

#include "arduino_secrets.h" 
///////please enter your sensitive data in the Secret tab/arduino_secrets.h
char ssid[] = SECRET_SSID;        // your network SSID (name)
char pass[] = SECRET_PASS;    // your network password (use for WPA, or use as key for WEP)
int status = WL_IDLE_STATUS;     // the WiFi radio's status

void setup() {
  //Initialize serial and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  // check for the WiFi module:
  if (WiFi.status() == WL_NO_MODULE) {
    Serial.println("Communication with WiFi module failed!");
    // don't continue
    while (true);
  }

  String fv = WiFi.firmwareVersion();
  if (fv < WIFI_FIRMWARE_LATEST_VERSION) {
    Serial.println("Please upgrade the firmware");
  }

  // attempt to connect to WiFi network:
  while (status != WL_CONNECTED) {
    Serial.print("Attempting to connect to WPA SSID: ");
    Serial.println(ssid);
    // Connect to WPA/WPA2 network:
    status = WiFi.begin(ssid, pass);

    // wait 10 seconds for connection:
    delay(10000);
  }

  // you're connected now, so print out the data:
  Serial.print("You're connected to the network");
  printCurrentNet();
  printWifiData();

}

void loop() {
  // check the network connection once every 10 seconds:
  delay(10000);
  printCurrentNet();
}

void printWifiData() {
  // print your board's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  
  Serial.println(ip);

  // print your MAC address:
  byte mac[6];
  WiFi.macAddress(mac);
  Serial.print("MAC address: ");
  printMacAddress(mac);
}

void printCurrentNet() {
  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());

  // print the MAC address of the router you're attached to:
  byte bssid[6];
  WiFi.BSSID(bssid);
  Serial.print("BSSID: ");
  printMacAddress(bssid);

  // print the received signal strength:
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.println(rssi);

  // print the encryption type:
  byte encryption = WiFi.encryptionType();
  Serial.print("Encryption Type:");
  Serial.println(encryption, HEX);
  Serial.println();
}

void printMacAddress(byte mac[]) {
  for (int i = 5; i >= 0; i--) {
    if (mac[i] < 16) {
      Serial.print("0");
    }
    Serial.print(mac[i], HEX);
    if (i > 0) {
      Serial.print(":");
    }
  }
  Serial.println();
}

Scan Networks 掃描熱點

/*
  This example  prints the board's MAC address, and
  scans for available WiFi networks using the NINA module.
  Every ten seconds, it scans again. It doesn't actually
  connect to any network, so no encryption scheme is specified.

  Circuit:
   * Board with NINA module (Arduino MKR WiFi 1010, MKR VIDOR 4000 and Uno WiFi Rev.2)

  created 13 July 2010
  by dlf (Metodo2 srl)
  modified 21 Junn 2012
  by Tom Igoe and Jaymes Dec

  Find the full UNO R4 WiFi Network documentation here:
  https://docs.arduino.cc/tutorials/uno-r4-wifi/wifi-examples#scan-networks
 */



#include <WiFiS3.h>

void setup() {
  //Initialize serial and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  // check for the WiFi module:
  if (WiFi.status() == WL_NO_MODULE) {
    Serial.println("Communication with WiFi module failed!");
    // don't continue
    while (true);
  }

  String fv = WiFi.firmwareVersion();
  if (fv < WIFI_FIRMWARE_LATEST_VERSION) {
    Serial.println("Please upgrade the firmware");
  }
}

void loop() {
  byte mac[6];
  // scan for existing networks:
  Serial.println("Scanning available networks...");
  listNetworks();
  WiFi.macAddress(mac);
  Serial.println();
  Serial.print("Your MAC Address is: ");
  printMacAddress(mac);
  delay(10000);
}

void listNetworks() {
  // scan for nearby networks:
  Serial.println("** Scan Networks **");
  int numSsid = WiFi.scanNetworks();
  if (numSsid == -1) {
    Serial.println("Couldn't get a WiFi connection");
    while (true);
  }

  // print the list of networks seen:
  Serial.print("number of available networks:");
  Serial.println(numSsid);

  // print the network number and name for each network found:
  for (int thisNet = 0; thisNet < numSsid; thisNet++) {
    Serial.print(thisNet);
    Serial.print(") ");
    Serial.print(WiFi.SSID(thisNet));
    Serial.print(" Signal: ");
    Serial.print(WiFi.RSSI(thisNet));
    Serial.print(" dBm");
    Serial.print(" Encryption: ");
    printEncryptionType(WiFi.encryptionType(thisNet));
  }
}

void printEncryptionType(int thisType) {
  // read the encryption type and print out the name:
  switch (thisType) {
    case ENC_TYPE_WEP:
      Serial.println("WEP");
      break;
    case ENC_TYPE_WPA:
      Serial.println("WPA");
      break;
    case ENC_TYPE_WPA2:
      Serial.println("WPA2");
      break;
    case ENC_TYPE_WPA3:
      Serial.print("WPA3");
      break;   
    case ENC_TYPE_NONE:
      Serial.println("None");
      break;
    case ENC_TYPE_AUTO:
      Serial.println("Auto");
      break;
    case ENC_TYPE_UNKNOWN:
    default:
      Serial.println("Unknown");
      break;
  }
}


void printMacAddress(byte mac[]) {
  for (int i = 5; i >= 0; i--) {
    if (mac[i] < 16) {
      Serial.print("0");
    }
    Serial.print(mac[i], HEX);
    if (i > 0) {
      Serial.print(":");
    }
  }
  Serial.println();
}

Scan Networks (Advanced) 進階模式

/*
  This example  prints the board's MAC address, and
  scans for available WiFi networks using the NINA module.
  Every ten seconds, it scans again. It doesn't actually
  connect to any network, so no encryption scheme is specified.
  BSSID and WiFi channel are printed

  Circuit:
  * Board with NINA module (Arduino MKR WiFi 1010, MKR VIDOR 4000 and Uno WiFi Rev.2)

  This example is based on ScanNetworks

  created 1 Mar 2017
  by Arturo Guadalupi

  Find the full UNO R4 WiFi Network documentation here:
  https://docs.arduino.cc/tutorials/uno-r4-wifi/wifi-examples#scan-networks-advanced
*/



#include <WiFiS3.h>

void setup() {
  //Initialize serial and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }

  // check for the WiFi module:
  if (WiFi.status() == WL_NO_MODULE) {
    Serial.println("Communication with WiFi module failed!");
    // don't continue
    while (true);
  }

  String fv = WiFi.firmwareVersion();
  if (fv < WIFI_FIRMWARE_LATEST_VERSION) {
    Serial.println("Please upgrade the firmware");
  }

  // scan for existing networks:
  Serial.println();
  Serial.println("Scanning available networks...");
  listNetworks();

  // print your MAC address:
  byte mac[6];
  WiFi.macAddress(mac);
  Serial.print("MAC: ");
  printMacAddress(mac);
}

void loop() {
  delay(10000);
  // scan for existing networks:
  Serial.println("Scanning available networks...");
  listNetworks();
}

void listNetworks() {
  // scan for nearby networks:
  Serial.println("** Scan Networks **");
  int numSsid = WiFi.scanNetworks();
  if (numSsid == -1)
  {
    Serial.println("Couldn't get a WiFi connection");
    while (true);
  }

  // print the list of networks seen:
  Serial.print("number of available networks: ");
  Serial.println(numSsid);

  // print the network number and name for each network found:
  for (int thisNet = 0; thisNet < numSsid; thisNet++) {
    Serial.print(thisNet + 1);
    Serial.print(") ");
    Serial.print("Signal: ");
    Serial.print(WiFi.RSSI(thisNet));
    Serial.print(" dBm");
    Serial.print("\tChannel: ");
    Serial.print(WiFi.channel(thisNet));
    byte bssid[6];
    Serial.print("\t\tBSSID: ");
    printMacAddress(WiFi.BSSID(thisNet, bssid));
    Serial.print("\tEncryption: ");
    printEncryptionType(WiFi.encryptionType(thisNet));
    Serial.print("\t\tSSID: ");
    Serial.println(WiFi.SSID(thisNet));
    Serial.flush();
  }
  Serial.println();
}

void printEncryptionType(int thisType) {
  // read the encryption type and print out the name:
  switch (thisType) {
    case ENC_TYPE_WEP:
      Serial.print("WEP");
      break;
    case ENC_TYPE_WPA:
      Serial.print("WPA");
      break;
    case ENC_TYPE_WPA2:
      Serial.print("WPA2");
      break;
    case ENC_TYPE_WPA3:
      Serial.print("WPA3");
      break;  
    case ENC_TYPE_NONE:
      Serial.print("None");
      break;
    case ENC_TYPE_AUTO:
      Serial.print("Auto");
      break;
    case ENC_TYPE_UNKNOWN:
    default:
      Serial.print("Unknown");
      break;
  }
}

void print2Digits(byte thisByte) {
  if (thisByte < 0xF) {
    Serial.print("0");
  }
  Serial.print(thisByte, HEX);
}

void printMacAddress(byte mac[]) {
  for (int i = 5; i >= 0; i--) {
    if (mac[i] < 16) {
      Serial.print("0");
    }
    Serial.print(mac[i], HEX);
    if (i > 0) {
      Serial.print(":");
    }
  }
  Serial.println();
}

 

簡單網頁伺服器 Simple Webserver

/*
  WiFi Web Server LED Blink

  A simple web server that lets you blink an LED via the web.
  This sketch will print the IP address of your WiFi module (once connected)
  to the Serial Monitor. From there, you can open that address in a web browser
  to turn on and off the LED_BUILTIN.

  If the IP address of your board is yourAddress:
  http://yourAddress/H turns the LED on
  http://yourAddress/L turns it off

  This example is written for a network using WPA encryption. For
  WEP or WPA, change the WiFi.begin() call accordingly.

  Circuit:
  * Board with NINA module (Arduino MKR WiFi 1010, MKR VIDOR 4000 and Uno WiFi Rev.2)
  * LED attached to pin 9

  created 25 Nov 2012
  by Tom Igoe

  Find the full UNO R4 WiFi Network documentation here:
  https://docs.arduino.cc/tutorials/uno-r4-wifi/wifi-examples#simple-webserver
 */

#include "WiFiS3.h"

#include "arduino_secrets.h" 
///////please enter your sensitive data in the Secret tab/arduino_secrets.h
char ssid[] = SECRET_SSID;        // your network SSID (name)
char pass[] = SECRET_PASS;    // your network password (use for WPA, or use as key for WEP)
int keyIndex = 0;                 // your network key index number (needed only for WEP)

int led =  LED_BUILTIN;
int status = WL_IDLE_STATUS;
WiFiServer server(80);

void setup() {
  Serial.begin(9600);      // initialize serial communication
  pinMode(led, OUTPUT);      // set the LED pin mode

  // check for the WiFi module:
  if (WiFi.status() == WL_NO_MODULE) {
    Serial.println("Communication with WiFi module failed!");
    // don't continue
    while (true);
  }

  String fv = WiFi.firmwareVersion();
  if (fv < WIFI_FIRMWARE_LATEST_VERSION) {
    Serial.println("Please upgrade the firmware");
  }

  // attempt to connect to WiFi network:
  while (status != WL_CONNECTED) {
    Serial.print("Attempting to connect to Network named: ");
    Serial.println(ssid);                   // print the network name (SSID);

    // Connect to WPA/WPA2 network. Change this line if using open or WEP network:
    status = WiFi.begin(ssid, pass);
    // wait 10 seconds for connection:
    delay(10000);
  }
  server.begin();                           // start the web server on port 80
  printWifiStatus();                        // you're connected now, so print out the status
}


void loop() {
  WiFiClient client = server.available();   // listen for incoming clients

  if (client) {                             // if you get a client,
    Serial.println("new client");           // print a message out the serial port
    String currentLine = "";                // make a String to hold incoming data from the client
    while (client.connected()) {            // loop while the client's connected
      if (client.available()) {             // if there's bytes to read from the client,
        char c = client.read();             // read a byte, then
        Serial.write(c);                    // print it out to the serial monitor
        if (c == '\n') {                    // if the byte is a newline character

          // if the current line is blank, you got two newline characters in a row.
          // that's the end of the client HTTP request, so send a response:
          if (currentLine.length() == 0) {
            // HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK)
            // and a content-type so the client knows what's coming, then a blank line:
            client.println("HTTP/1.1 200 OK");
            client.println("Content-type:text/html");
            client.println();

            // the content of the HTTP response follows the header:
            client.print("<p style=\"font-size:7vw;\">Click <a href=\"/H\">here</a> turn the LED on<br></p>");
            client.print("<p style=\"font-size:7vw;\">Click <a href=\"/L\">here</a> turn the LED off<br></p>");
            
            // The HTTP response ends with another blank line:
            client.println();
            // break out of the while loop:
            break;
          } else {    // if you got a newline, then clear currentLine:
            currentLine = "";
          }
        } else if (c != '\r') {  // if you got anything else but a carriage return character,
          currentLine += c;      // add it to the end of the currentLine
        }

        // Check to see if the client request was "GET /H" or "GET /L":
        if (currentLine.endsWith("GET /H")) {
          digitalWrite(LED_BUILTIN, HIGH);               // GET /H turns the LED on
        }
        if (currentLine.endsWith("GET /L")) {
          digitalWrite(LED_BUILTIN, LOW);                // GET /L turns the LED off
        }
      }
      
    }
    // close the connection:
    client.stop();
    Serial.println("client disconnected");
  }
}

void printWifiStatus() {
  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());

  // print your board's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);

  // print the received signal strength:
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.print(rssi);
  Serial.println(" dBm");
  // print where to go in a browser:
  Serial.print("To see this page in action, open a browser to http://");
  Serial.println(ip);
}

/*
  WiFi Web Server LED Blink

  A simple web server that lets you blink an LED via the web.
  This sketch will print the IP address of your WiFi module (once connected)
  to the Serial Monitor. From there, you can open that address in a web browser
  to turn on and off the LED_BUILTIN.

  If the IP address of your board is yourAddress:
  http://yourAddress/H turns the LED on
  http://yourAddress/L turns it off

  This example is written for a network using WPA encryption. For
  WEP or WPA, change the WiFi.begin() call accordingly.

  Circuit:
  * Board with NINA module (Arduino MKR WiFi 1010, MKR VIDOR 4000 and Uno WiFi Rev.2)
  * LED attached to pin 9

  created 25 Nov 2012
  by Tom Igoe

  Find the full UNO R4 WiFi Network documentation here:
  https://docs.arduino.cc/tutorials/uno-r4-wifi/wifi-examples#simple-webserver
 */

#include "WiFiS3.h"

#include "arduino_secrets.h" 
///////please enter your sensitive data in the Secret tab/arduino_secrets.h
char ssid[] = SECRET_SSID;        // your network SSID (name)
char pass[] = SECRET_PASS;    // your network password (use for WPA, or use as key for WEP)
int keyIndex = 0;                 // your network key index number (needed only for WEP)

int led =  LED_BUILTIN;
int status = WL_IDLE_STATUS;
WiFiServer server(80);

void setup() {
  Serial.begin(9600);      // initialize serial communication
  pinMode(led, OUTPUT);      // set the LED pin mode

  // check for the WiFi module:
  if (WiFi.status() == WL_NO_MODULE) {
    Serial.println("Communication with WiFi module failed!");
    // don't continue
    while (true);
  }

  String fv = WiFi.firmwareVersion();
  if (fv < WIFI_FIRMWARE_LATEST_VERSION) {
    Serial.println("Please upgrade the firmware");
  }

  // attempt to connect to WiFi network:
  while (status != WL_CONNECTED) {
    Serial.print("Attempting to connect to Network named: ");
    Serial.println(ssid);                   // print the network name (SSID);

    // Connect to WPA/WPA2 network. Change this line if using open or WEP network:
    status = WiFi.begin(ssid, pass);
    // wait 10 seconds for connection:
    delay(10000);
  }
  server.begin();                           // start the web server on port 80
  printWifiStatus();                        // you're connected now, so print out the status
}


void loop() {
  WiFiClient client = server.available();   // listen for incoming clients

  if (client) {                             // if you get a client,
    Serial.println("new client");           // print a message out the serial port
    String currentLine = "";                // make a String to hold incoming data from the client
    while (client.connected()) {            // loop while the client's connected
      if (client.available()) {             // if there's bytes to read from the client,
        char c = client.read();             // read a byte, then
        Serial.write(c);                    // print it out to the serial monitor
        if (c == '\n') {                    // if the byte is a newline character

          // if the current line is blank, you got two newline characters in a row.
          // that's the end of the client HTTP request, so send a response:
          if (currentLine.length() == 0) {
            // HTTP headers always start with a response code (e.g. HTTP/1.1 200 OK)
            // and a content-type so the client knows what's coming, then a blank line:
            client.println("HTTP/1.1 200 OK");
            client.println("Content-type:text/html");
            client.println();

            // the content of the HTTP response follows the header:
            client.print("<p style=\"font-size:7vw;\">Click <a href=\"/H\">here</a> turn the LED on<br></p>");
            client.print("<p style=\"font-size:7vw;\">Click <a href=\"/L\">here</a> turn the LED off<br></p>");
            
            // The HTTP response ends with another blank line:
            client.println();
            // break out of the while loop:
            break;
          } else {    // if you got a newline, then clear currentLine:
            currentLine = "";
          }
        } else if (c != '\r') {  // if you got anything else but a carriage return character,
          currentLine += c;      // add it to the end of the currentLine
        }

        // Check to see if the client request was "GET /H" or "GET /L":
        if (currentLine.endsWith("GET /H")) {
          digitalWrite(LED_BUILTIN, HIGH);               // GET /H turns the LED on
        }
        if (currentLine.endsWith("GET /L")) {
          digitalWrite(LED_BUILTIN, LOW);                // GET /L turns the LED off
        }
      }
      
    }
    // close the connection:
    client.stop();
    Serial.println("client disconnected");
  }
}

void printWifiStatus() {
  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());

  // print your board's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);

  // print the received signal strength:
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.print(rssi);
  Serial.println(" dBm");
  // print where to go in a browser:
  Serial.print("To see this page in action, open a browser to http://");
  Serial.println(ip);
}

 

這篇文章 安裝 Arduino UNO R4 WiFi 開發板逐步指南 最早出現於 台灣智能感測科技

]]>
https://www.taiwansensor.com.tw/%e5%ae%89%e8%a3%9d-arduino-uno-r4-wifi-%e9%96%8b%e7%99%bc%e6%9d%bf%e9%80%90%e6%ad%a5%e6%8c%87%e5%8d%97/feed/ 0
使用 Arduino ESP32 搭配 INA219 電流感測器,來打造一個能源計量儀表 https://www.taiwansensor.com.tw/%e4%bd%bf%e7%94%a8-arduino-esp32-%e6%90%ad%e9%85%8d-ina219-%e9%9b%bb%e6%b5%81%e6%84%9f%e6%b8%ac%e5%99%a8%ef%bc%8c%e4%be%86%e6%89%93%e9%80%a0%e4%b8%80%e5%80%8b%e8%83%bd%e6%ba%90%e8%a8%88%e9%87%8f/ https://www.taiwansensor.com.tw/%e4%bd%bf%e7%94%a8-arduino-esp32-%e6%90%ad%e9%85%8d-ina219-%e9%9b%bb%e6%b5%81%e6%84%9f%e6%b8%ac%e5%99%a8%ef%bc%8c%e4%be%86%e6%89%93%e9%80%a0%e4%b8%80%e5%80%8b%e8%83%bd%e6%ba%90%e8%a8%88%e9%87%8f/#respond Wed, 01 Nov 2023 03:51:13 +0000 https://www.taiwansensor.com.tw/?p=64737 使用 Arduino ESP32 搭配 INA219 電流感測器,來打造一個能源計量儀表 在這個專案中,我們將 […]

這篇文章 使用 Arduino ESP32 搭配 INA219 電流感測器,來打造一個能源計量儀表 最早出現於 台灣智能感測科技

]]>
使用 Arduino ESP32 搭配 INA219 電流感測器,來打造一個能源計量儀表

在這個專案中,我們將使用ESP32 開發板和INA219電流感測器來創建一個能源計量儀表。這個能源計量儀表能夠測量直流電流、電壓和功率。我們將使用ESP32和16×2 I2C顯示器來即時顯示所有的能源數據。請查看之前的文章,了解使用INA219直流電流感測器的 Arduino 能源計量儀表。

零件清單

在開始之前,請確保您擁有以下必要的元件:

  1. ESP32 開發板
  2. INA219 電流感測器
  3. LiquidCrystal_I2C 顯示模組(16x2)
  4. 杜邦線(Jumper wires)
  5. 麵包板(可選)
  6. ESP32 的電源供應器

ESP32 能源計量儀表使用 ESP32 作為主控制器。它使用 INA219 電流感測器測量電流和電壓。

INA219 DC電流感測器

INA219 I2C DC CURRENT Sensor module

INA219是一款常用於電子專案中,用於測量和監控電流流動的直流電流感測器。它是一個高精度的感測器,能夠測量高達3.2A的電流,並提供0.1mA的解析度。

它的操作方法是將一個小電阻放在負載電路中,並通過INA219將這個電阻上的電壓轉換為電流量。它使用I2C通信協議,這使得它能夠輕鬆地與其他支援I2C的設備進行整合。

INA219 Datasheet 

規格:

  • 電阻:0.1歐姆,精度1%,2瓦特功率。
  • 電壓範圍:最高可達+26伏特。
  • 電流測量:±3.2安培,解析度為±0.8毫安培。
  • 尺寸:0.9英寸 x 0.8英寸 PCB。
  • 電壓感測:0伏特至26伏特範圍。
  • 介面:I2C通信。
  • 數據:測量電流、電壓和功率。
  • 地址:16個可編程地址。
  • 過濾:提供過濾選項。
  • 校準:包括校準寄存器。

連線圖和連接方式

這個設置的連接非常簡單且容易理解。(以下是一個基本的連接示意圖,請注意根據您的具體硬體配置進行調整)

ESP32 Energy Meter

INA219 / LCD -> ESP32

  • VCC -> 5V
  • GND – > GND
  • SDA -> D21
  • SCL-> D22

ESP32 Energy meter

原始碼和函式庫

  1. 安裝所需的函示庫:

將以下程式碼上傳到您的 ESP32 開發板。

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <Adafruit_INA219.h>

Adafruit_INA219 ina219;
LiquidCrystal_I2C lcd(0x27, 16, 2);

float busvoltage = 0;
float current_mA = 0;
float power_mW = 0;

void setup()
{
  lcd.init();
  lcd.backlight();
  lcd.setCursor(0, 0);
  lcd.print("ESP32 Energy");
  lcd.setCursor(0, 4);
  lcd.print("Monitor");
  delay(2000);

  if (!ina219.begin())
  {
    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("FAILED TO FIND");
    lcd.setCursor(0, 1);
    lcd.print("INA219 MODULE");
    while (1)
    {
      delay(10);
    }
  }

  Serial.begin(115200);
}

void loop()
{
  measureValues();
  // Other operations you might want to perform in the loop
}

void measureValues()
{
  busvoltage = ina219.getBusVoltage_V();
  current_mA = ina219.getCurrent_mA();
  power_mW = ina219.getPower_mW();

  lcd.clear();
  lcd.setCursor(0, 1);
  lcd.print("V:");
  lcd.print(busvoltage);
  lcd.setCursor(9, 1);
  lcd.print("I:");

  if (current_mA < 3)
  {
    lcd.print("000");
  }
  else if (current_mA < 10)
  {
    lcd.print("00");
    lcd.print((int)current_mA);
  }
  else if (current_mA < 100)
  {
    lcd.print('0');
    lcd.print((int)current_mA);
  }
  else
  {
    lcd.print((int)current_mA);
  }

  lcd.setCursor(0, 0);
  lcd.print("Power(mW):");
  lcd.print((int)power_mW);
  delay(2000);
}

專案工作和演示

上傳程式碼後,就可以測試ESP32電能表了。

  1. 連接 電池作為電源
  2. 連接 LED 作為負載。

設備的能耗以毫瓦 (mW) 表示,電流以毫安培 (I) 為單位測量,電壓等級以伏特 (V) 表示。

 

 

這篇文章 使用 Arduino ESP32 搭配 INA219 電流感測器,來打造一個能源計量儀表 最早出現於 台灣智能感測科技

]]>
https://www.taiwansensor.com.tw/%e4%bd%bf%e7%94%a8-arduino-esp32-%e6%90%ad%e9%85%8d-ina219-%e9%9b%bb%e6%b5%81%e6%84%9f%e6%b8%ac%e5%99%a8%ef%bc%8c%e4%be%86%e6%89%93%e9%80%a0%e4%b8%80%e5%80%8b%e8%83%bd%e6%ba%90%e8%a8%88%e9%87%8f/feed/ 0
如何在 Sonoff ZBDongle-E 上啟用 Thread 和 Matter 支援? https://www.taiwansensor.com.tw/%e5%a6%82%e4%bd%95%e5%9c%a8-sonoff-zbdongle-e-%e4%b8%8a%e5%95%9f%e7%94%a8-thread-%e5%92%8c-matter-%e6%94%af%e6%8f%b4%ef%bc%9f/ https://www.taiwansensor.com.tw/%e5%a6%82%e4%bd%95%e5%9c%a8-sonoff-zbdongle-e-%e4%b8%8a%e5%95%9f%e7%94%a8-thread-%e5%92%8c-matter-%e6%94%af%e6%8f%b4%ef%bc%9f/#respond Wed, 01 Nov 2023 02:42:25 +0000 https://www.taiwansensor.com.tw/?p=64731 如何在 Sonoff ZBDongle-E 上啟用 Thread 和 Matter 支援? 使用Silabs […]

這篇文章 如何在 Sonoff ZBDongle-E 上啟用 Thread 和 Matter 支援? 最早出現於 台灣智能感測科技

]]>
如何在 Sonoff ZBDongle-E 上啟用 Thread 和 Matter 支援?

使用Silabs Multiprotocol附加組件2.2.0版本時,需要手動將Dongle的韌體升級至4.3.0版本。如果您的Dongle韌體版本仍為4.2.3,新的附加組件版本將無法正常啟動。您可以查看更多詳細資訊,請參考相關連結。此外,Darkxst已經更新了他的Web刷機工具,因此您可以在對話視窗中簡單地點擊升級至4.3.0版本。

原文網址 翻譯 ,使用前請確認您自己有能力可以恢復韌體,相關後續使用者的討論與問題請至原網站查詢。

因為Sonoff ZBDongle-E基於EFR32MG21多協議SoC晶片,由於模組的無線電通訊,它能夠支援Zigbee和Thread通訊。然而,目前該公司僅將此設備作為Zigbee接收器銷售,並且官方尚未提供Thread支援。目前還不清楚Sonoff是否有意推出更新,將此設備用作Thread邊界路由器。

幸運的是,您可以使用自定義韌體刷機Sonoff ZBDongle-E版本,使其既能作為Zigbee協調器,也能作為Thread邊界路由器在Home Assistant中使用。這個過程並不困難,但在刷機後需要進行一些額外的設定和安裝。

如果您只打算將設備用作Zigbee協調器,則無需刷機,因為它已經內建了NCP韌體版本v6.10.3,這是ZBDongle-E的最新官方Zigbee韌體。如果您想要啟用Thread支援,請繼續閱讀以了解如何執行。

在啟用Sonoff ZBDongle-E的Thread支援之前,首要的是要理解這個過程的風險。像這種刷機過程通常存在導致Dongle無法修復的風險,所以請自行承擔風險。在開始之前,請注意以下事項:

  1. 如果您目前正在使用Sonoff ZBDongle-E作為Zigbee協調器,您需要在刷入新韌體後重新配對所有設備。
  2. 雖然刷機後可能成功恢復,但標準的Zigbee網路備份和還原方法的成功機會很小。
  3. 如果您使用現有的ZHA整合,您需要完全刪除它,然後重新添加它並在新的多協議韌體周圍建立網路。
  4. 如果您正在運行Zigbee2MQTT網路,您需要停止插件並更改配置以訪問新的多協議韌體。

本指南使用 Web Flasher,它將用於安裝最新的RCP Multi-PAN韌體到您的ZBDongle-E上,這將用於創建Zigbee網路以及作為邊界路由器提供Thread支援。

不同的韌體類型 Zigbee協調器,包括ZBDongle-E,依賴於網路協處理器(NCP)韌體類型。Zigbee應用程式以及網路協議堆疊保存在Dongle本身上,它管理大部分Zigbee網路。您使用的Zigbee整合只是通過與Dongle通信,來發送/接收添加到網路中的設備的指令。

最近,基於遠程協處理器(RCP)的韌體已經適用於這些SoC模組,允許將Zigbee應用程式完全卸載到您的伺服器(在這種情況下是Home Assistant),僅在硬體層面利用Dongle的無線電。使用後者的方式,可以利用Dongle的硬體功能刷入MultiPAN RCP韌體,以創建獨立的Zigbee和Thread網路,這正是我們要做的。

刷機Sonoff ZBDongle-E

這個自定義韌體是由darkxst(Tim L)開發的,適用於Home Assistant Yellow和SkyConnect,Sonoff ZBDongle-E以及EasyIot ZB-GW04 v1.1/v1.2。他還創建了一個用於刷機的Web工具,比通用的Silabs Flasher更容易使用。他的工作是從官方NabuCasa Silabs韌體生成工具分支出來的,添加了對其他硬體的支援。

下載並安裝最新的CP210x USB驅動程式(Windows/Mac)

  1. 前往CP210x官方網站,下載最新的CP210x USB驅動程式,然後依照操作系統選擇適當的版本(Windows或Mac)進行下載。
  2. 安裝下載的驅動程式,按照提示完成安裝過程。

連接Sonoff ZBDongle-E到您的電腦

  1. 使用USB線將Sonoff ZBDongle-E連接到您的電腦上,確保它已正確連接。

識別Dongle的通訊埠號碼

  • 在Windows上:打開「設備管理器」,然後展開「連接埠(COM和LPT)」,您應該能夠看到Sonoff ZBDongle-E的通訊埠號碼(例如:COM5)。
  • 在Linux上:使用以下命令檢查通訊埠號碼:ls /dev/tty*(例如:/dev/ttyACM0)。
  • 在Mac上:使用以下命令檢查通訊埠號碼:ls /dev/tty.usb*(例如:/dev/tty.usbserial12345)。

請確保您記錄下Dongle的通訊埠號碼,以便後續操作。

  1. 在ZBDongle-E下,點擊「連接」。Enabling Thread and Matter Support on the Sonoff ZBDongle-E: Connecting to Flash
  2. 從端口列表中選擇Dongle。Enabling Thread and Matter Support on the Sonoff ZBDongle-E: Selecting Port
  3. 等待連接建立。然後點擊「更改韌體」。【Click Change Firmware】
    Enabling Thread and Matter Support on the Sonoff ZBDongle-E: Change Firmware
  4. 點擊「繼續」,然後拔掉Dongle。
    Enabling Thread and Matter Support on the Sonoff ZBDongle-E: Success

一旦刷機完成,您可以繼續在Home Assistant中設置您的Zigbee和Thread網路。請參考下面的指南以獲得詳細的教程。

設定 Home Assistant

在繼續進行指南之前,請確保您正在運行最新版本的Home Assistant。由於Thread和Matter是相對新的整合,並且正在積極開發中,升級到最新版本將確保最小的錯誤或故障。請記住,它們都處於Beta測試階段,仍然被標記為實驗性功能。

Silicon Labs多協議附加組件

在單個Sonoff ZBDongle-E上運行Zigbee和Thread網路的一個重要要求是Silicon Labs多協議附加組件。這個附加組件充當了Home Assistant和Sonoff Dongle之間的網關,本質上允許您使用Dongle上的RCP Multi-PAN韌體來創建獨立的網路。

一旦設置完成,您的ZHA、Zigbee2MQTT或Thread整合將與Silicon Labs多協議附加組件進行通信,而不像之前直接與Dongle通信。

Thread Support Sonoff ZBDongle-E Silicon Labs Multiprotocol Installation

要安裝這個附加組件,請在Home Assistant中導航到「設置」>「附加組件」。搜尋「Silicon Labs多協議」並安裝它,但還不要立即啟動它。然後,點擊頂部的「配置」選項卡,並按照下面的圖片設置設定。

Thread Support Sonoff ZBDongle-E Silicon Labs Multiprotocol Configuration

  • 選擇Sonoff ZBDongle-E
  • 波特率設為460800
  • 禁用硬體流量控制
  • 禁用自動刷機韌體
  • 其餘設定保持不變,然後點擊保存
  • 返回到“資訊”選項卡,然後啟動這個附加組件。

現在,您已經準備好設置ZHA、Zigbee2MQTT或使用Sonoff ZBDongle-E來創建Thread網路了。

對於ZHA

像通常一樣,導航到「設置」>「設備和服務」>「新增整合」,並搜索ZHA。選擇「Zigbee Home Automation」,然後按照流程進行,但有一個重要的區別。

Thread Support Sonoff ZBDongle-E ZHA Setup

當它提示您選擇串行埠時,選擇socket://core-silabs-multiprotocol:9999,而不是/dev/ttyACM0 - Sonoff dongle

點擊「提交」,然後選擇「建立新網路」。我建議不要嘗試還原備份,因為它不會起作用。如果您還原備份,則所有現有設備將被添加,但無法控制。ZHA整合現在已添加,您可以開始像通常一樣配對設備。我已經配對了一些設備,它們都正常運作,如應有的那樣。Thread Support Sonoff ZBDongle-E ZHA Done

Zigbee2MQTT

在一般情況下,設置Zigbee2MQTT也類似,只有一些小的不同之處。首先,如果Zigbee2MQTT附加組件已經運行,請停止它。如果您是首次安裝它,請在配置之前不要啟動它。導航到「設置」>「附加組件」>「Zigbee2MQTT」>「配置」選項卡。在「串列埠」欄位下,粘貼以下內容:

port: tcp://core-silabs-multiprotocol:9999
adapter: ezsp

保存配置並啟動附加組件。Zigbee2MQTT會在出現問題時通知您,因此在啟動附加組件時監視日誌是個好主意。您應該會在最後看到一條訊息:

Zigbee2MQTT:資訊 2023-05-30 18:59:58:Zigbee2MQTT已經啟動!

附加組件已成功啟動,您可以繼續創建您的新Zigbee網路。

如果您導航到Zigbee2MQTT界面的「關於」選項卡,您應該會看到新的EZSP版本:

Thread Support Sonoff ZBDongle-E Zigbee2MQTT EZSP Ver

或者,您可以在「設置」>「串行」中檢查由Silabs多協議附加組件列出的協調器:

Thread Support Sonoff ZBDongle-E Zigbee2MQTT Serial

Thread網路

如果您有Thread網路可用,您現在可以使用Sonoff ZBDongle-E作為邊界路由器將其添加到Home Assistant中。如果您已經重新啟動了Home Assistant,Thread整合應該會自動被發現。如果沒有,請導航到「設置」>「設備和服務」>「新增整合」>「Thread」。確認提示,整合將被添加。

Thread Support Sonoff ZBDongle-E Thread Border Router

基於Thread的消費者設備使用兩個家庭自動化標準之一:Matter或HomeKit。要實際使用設備,您需要使用這些整合之一進行設備委託。請注意,Thread整合完全處於測試階段,因此仍在不斷改進中,目前許多功能可能尚未完全可用。

Matter整合(以及Matter Server附加組件)協調Matter Wi-Fi和Thread設備的配置和控制。如果您擁有基於Thread協議的經Matter認證的設備,您可以使用您的手機和相應的應用程序將其添加到Home Assistant中。

總結

在Sonoff ZBDongle-E上啟用Thread、Zigbee和Matter支援對於智能家居愛好者來說非常有益,它基本上將您的Home Assistant實例變成了一個強大的多協議中樞。它具備了硬體能力,所以為什麼不實際使用它呢?感謝darkxst,這個韌體分支和Web刷機工具的開發者。

 

這篇文章 如何在 Sonoff ZBDongle-E 上啟用 Thread 和 Matter 支援? 最早出現於 台灣智能感測科技

]]>
https://www.taiwansensor.com.tw/%e5%a6%82%e4%bd%95%e5%9c%a8-sonoff-zbdongle-e-%e4%b8%8a%e5%95%9f%e7%94%a8-thread-%e5%92%8c-matter-%e6%94%af%e6%8f%b4%ef%bc%9f/feed/ 0
開始使用 ESPHome 和 Home Assistant https://www.taiwansensor.com.tw/%e9%96%8b%e5%a7%8b%e4%bd%bf%e7%94%a8-esphome-%e5%92%8c-home-assistant/ https://www.taiwansensor.com.tw/%e9%96%8b%e5%a7%8b%e4%bd%bf%e7%94%a8-esphome-%e5%92%8c-home-assistant/#respond Sun, 22 Oct 2023 04:53:36 +0000 https://www.taiwansensor.com.tw/?p=64639 在本指南中,我們將介紹如何使用安裝為 Home Assistant 附加元的 ESPHome Dashboar […]

這篇文章 開始使用 ESPHome 和 Home Assistant 最早出現於 台灣智能感測科技

]]>
在本指南中,我們將介紹如何使用安裝為 Home Assistant 附加元的 ESPHome Dashboard,在設備上安裝 ESPHome。

首先,這是對 ESPHome 運作方式的簡要介紹:ESPHome 是一個旨在盡可能簡化 ESP 板的管理的工具。它讀取 YAML 配置文件,並創建自定義固件,然後將其安裝在您的 ESP 設備上。在 ESPHome 配置中添加的設備或傳感器將自動顯示在 Home Assistant 的用戶界面中。

安裝 ESPHome Dashboard ESPHome Dashboard 可以安裝為 Home Assistant 的附加元件,您可以在監督員面板的附加元商店中找到它。使用以下按鈕打開它,然後點擊"安裝之後,等待一會兒直到它安裝完成(這可能需要一段時間)。點擊"啟動",然後點擊"開啟 Web 介面"。如果您看到"502: Bad Gateway",表示它正在啟動,您可以在幾秒後刷新頁面。

../_images/hassio_addon.png

您現在應該會看到一個友好的入門嚮導,它將引導您創建第一個配置。

../_images/dashboard_empty.png

嚮導將指導您創建第一個配置,並根據您的瀏覽器,在您的 ESP 設備上進行安裝。您需要為您的配置命名並輸入您的無線網路設定,以便 ESP 設備能夠上線並與 Home Assistant 通信。

備註 設置新的 ESPHome 設備最困難的部分是初始安裝。安裝需要您的 ESP 設備通過電纜連接到電腦。後續更新可以通過無線方式安裝。 有關進行此第一次連接的指南,請參閱"實際連接到您的設備"。

儀表板介面

假設您使用嚮導創建了第一個配置文件,讓我們快速了解 ESPHome 儀表板介面。

../_images/dashboard_states.png

在首頁上,您將看到您創建的節點的所有配置。對於每個文件,您可以執行一些基本操作:

  • UPDATE(更新):如果設備尚未使用當前運行的相同 ESPHome 版本安裝,將顯示此按鈕。
  • EDIT(編輯):這將打開配置編輯器。
  • LOGS(日誌):使用此命令,您可以查看節點輸出的所有日誌。如果連接了USB設備,則可以選擇使用串行連接。否則,它將使用內置的OTA日誌。
  • Overflow menu(溢出菜單):這是一個下拉菜單,允許您執行更多操作。
    • Validate(驗證):這將驗證配置文件。
    • Install(安裝):打開安裝對話框。
    • Clean Build Files(清除生成的構建文件):這將刪除所有生成的構建文件,是一個安全的操作。有時,舊文件未刪除,可能會導致以後的編譯問題。
    • Delete(刪除):這將刪除配置文件。

ESPHome 的配置文件可以在 <HOME_ASSISTANT_CONFIG>/esphome/ 下找到並編輯。例如,上圖中車庫門節點的配置可以在 /config/esphome/garage-door.yaml 中找到。

備註 由於 Home Assistant 附加元運行為獨立容器,通過命令行訪問它們並不直接,但是是可行的。為此,請安裝 Home Assistant 的 SSH 附加元,配置用戶名和密碼,並禁用保護模式(請評估您所承擔的風險)。然後,例如,要通過 SSH 客戶端從設備訪問日誌,登錄並使用類似 docker exec -it addon_15ef4d2f_esphome esphome logs /config/esphome/garage-door.yaml 的命令。欲瞭解更多信息,請參閱"使用 ESPHome 命令行入門"。

增加一些(基本)功能

所以現在你應該有一個名為(或類似)的檔案/config/esphome/livingroom.yaml。開啟該檔案(在任何文字編輯器中)並將一個簡單的 GPIO 開關新增 至設定中,如下所示:

<span class="nt">switch</span><span class="p">:</span>
  <span class="p p-Indicator">-</span> <span class="nt">platform</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">gpio</span>
    <span class="nt">name</span><span class="p">:</span> <span class="s">"Living</span> <span class="s">Room</span> <span class="s">Dehumidifier"</span>
    <span class="nt">pin</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">5</span>

在上面的範例中,我們只是添加一個名為「客廳除濕器」的開關(實際上可以控制任何東西,例如燈)並連接到 pin GPIO5

將您的裝置連接到 Home Assistant 

一旦您的配置安裝在 ESP 裝置上並在線,Home Assistant 將自動發現它並提供在您的整合螢幕上進行設定:

打開您的 Home Assistant 實例並開始設定新的整合。

或者,您可以在 Home Assistant 整合頁面上手動新增裝置。按一下「新增整合」按鈕(右下角),搜尋 esphome,然後輸入主機名,例如:「<NODE_NAME>.local」作為主機。使用相同的流程新增多個 esphome 裝置。

../_images/gpio-ui1.png

首次安裝後,您可能永遠不需要再次使用 USB 電纜,因為 ESPHome 的所有功能也可以遠端啟用。

添加二進位感測器

接下來,我們將添加一個非常簡單的二進位感測器,它定期檢查 GPIO 引腳以查看它是拉高還是拉低 - GPIO二進位感測器

<span class="nt">binary_sensor</span><span class="p">:</span>
  <span class="p p-Indicator">-</span> <span class="nt">platform</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">gpio</span>
    <span class="nt">name</span><span class="p">:</span> <span class="s">"Living</span> <span class="s">Room</span> <span class="s">Window"</span>
    <span class="nt">pin</span><span class="p">:</span>
      <span class="nt">number</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">16</span>
      <span class="nt">inverted</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">true</span>
      <span class="nt">mode</span><span class="p">:</span>
        <span class="nt">input</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">true</span>
        <span class="nt">pullup</span><span class="p">:</span> <span class="l l-Scalar l-Scalar-Plain">true</span>

這次安裝時,不需要再次透過USB插入裝置。上傳將以無線方式進行(“無線”)。

../_images/gpio-ui.png

下一步要去哪裡

太棒了!現在,您已成功設定第一個 ESPHome 項目,並將第一個 ESPHome 自訂韌體安裝到您的節點。您也了解如何透過設定檔啟用一些基本元件。

因此,現在是查看 ESPHome 的好時機。希望您能在那裡找到您需要的所有感測器/輸出/…。如果您遇到任何問題或需要新功能,請在GitHub 問題追蹤器上建立新問題或在 Discord 聊天中找到我們(也請務必閱讀常見問題)。

這篇文章 開始使用 ESPHome 和 Home Assistant 最早出現於 台灣智能感測科技

]]>
https://www.taiwansensor.com.tw/%e9%96%8b%e5%a7%8b%e4%bd%bf%e7%94%a8-esphome-%e5%92%8c-home-assistant/feed/ 0
為何我選擇 Home Assistant 打造我的智能家居 https://www.taiwansensor.com.tw/%e7%82%ba%e4%bd%95%e6%88%91%e9%81%b8%e6%93%87-home-assistant-%e6%89%93%e9%80%a0%e6%88%91%e7%9a%84%e6%99%ba%e8%83%bd%e5%ae%b6%e5%b1%85/ https://www.taiwansensor.com.tw/%e7%82%ba%e4%bd%95%e6%88%91%e9%81%b8%e6%93%87-home-assistant-%e6%89%93%e9%80%a0%e6%88%91%e7%9a%84%e6%99%ba%e8%83%bd%e5%ae%b6%e5%b1%85/#respond Sun, 22 Oct 2023 04:40:57 +0000 https://www.taiwansensor.com.tw/?p=64637 為何我選擇 Home Assistant 打造我的智能家居 智能家居和物聯網(IoT)相當熱門!它提供了無與倫 […]

這篇文章 為何我選擇 Home Assistant 打造我的智能家居 最早出現於 台灣智能感測科技

]]>
為何我選擇 Home Assistant 打造我的智能家居

智能家居和物聯網(IoT)相當熱門!它提供了無與倫比的便利性,同時節約能源並提高家庭安全性。我碰巧喜歡摸索事物,所以讓我們來建立一個智能家居!然而,在我進行研究以了解如何入門時,我意識到智能家居行業是一個大混亂…

問題:基於雲的智能家居 近年來,大型科技公司如亞馬遜(Alexa、Blink、Eero、Ring)和谷歌(Google Assistant、Nest攝像頭和恆溫器)大大推廣了智能家居產品,降低了進入門檻。

然而,亞馬遜、谷歌和大多數消費者智能家居公司不一定是您的朋友。首先,他們的大部分產品嚴重依賴雲端。這在一切運作正常時可能聽起來並不太糟糕,但您需要制造商的支援。

考慮以下情況:

  1. 您的互聯網連接或雲服務中斷。 最好的情況下,您會失去"智能"功能,直到連接恢復。最壞的情況下,在中斷期間您根本無法使用設備。
  2. 制造商突然決定要求訂閱他們的雲服務,即使他們在您購買產品時承諾提供"免費雲"。Wink在2020年5月就曾經這樣做。 您要麼支付訂閱費,要麼失去大多數,甚至全部的功能。
  3. 制造商倒閉並關閉他們的雲端,導致他們的產品變得無用。這在2022年4月曾經發生在Insteon。 不幸的是,您購買的設備只會變成華麗的門栓。

解決方案:Home Assistant

我遇到了 Home Assistant,這是一個以隱私和本地控制為首要考慮的開源家庭自動化“中樞”。搭配適當的硬體,您可以輕鬆建立一個完全本地化的智能家居。

如果您想了解更多有關 Home Assistant 及其願景的信息,請參閱以下連結:

完美的家居自動化:Home Assistant對智能家居的願景 開放式家居的現況 衝動之下,我決定試試 Home Assistant,並使用它來開始建立我的智能家居。

 

入門指南 安裝和設定

設定 Home Assistant 相當簡單。由於我家已經有一台個人電腦,我將 Home Assistant 作業系統安裝為虛擬機器在上面。

您可以在大多數現代個人電腦和單板電腦(如智慧管家)上運行 Home Assistant,而且他們提供了多種不同的安裝方式。他們網站上的安裝頁面詳細介紹了這些方式。安裝 Home Assistant 後,請在網頁瀏覽器中前往您的實例,並按照設定嚮導進行操作。欲瞭解更多信息,請參閱他們網站上的入門指南頁面。

購買欲整合的硬體與感測器

因為我決定使用 Home Assistant 建立完全本地的智能家居,我制定了以下選擇智能設備的標準:

必須支援本地控制,並在沒有互聯網連接的情況下運作。 必須與 Home Assistant 整合。 價格合理。 最好能夠在不需要製造商帳戶的情況下設置。 事實證明,很難找到符合這些標準的設備,因為大多數消費者智能設備嚴重依賴雲端,而它們的 Home Assistant 整合只是與雲端進行互動。

幸運的是,還有一些選擇。例如,某些(但不是全部)Kasa by TP-Link 的產品支援僅本地控制,無需 Kasa 帳戶。他們在他們的網站上有一個本地可控設備的清單。此外,大多數非 Wi-Fi 基礎(藍牙、Zigbee、Z-Wave等)的設備都是設計用於本地控制的。

我的開源智能家居

憑藉這些設備,我已經使用 Home Assistant 使我的家居變得"智能"並實現自動化。我現在不會深入介紹我的設置,但也許在以後的帖子中會詳細談論。

我已經運行 Home Assistant 數個月,效果非常棒!我的自動化運行良好,而且我可以在沒有互聯網連接的情況下本地控制一切。

實際上,一切都進展得如此順利,以至於我決定擴展我的設置。我已經訂購了一些額外的設備,包括一些 Aqara Zigbee 設備和一個 SONOFF Zigbee USB 傳輸器。我還考慮嘗試使用 Tasmota 或 ESPHome 進行 DIY 設備的開發。

這篇文章 為何我選擇 Home Assistant 打造我的智能家居 最早出現於 台灣智能感測科技

]]>
https://www.taiwansensor.com.tw/%e7%82%ba%e4%bd%95%e6%88%91%e9%81%b8%e6%93%87-home-assistant-%e6%89%93%e9%80%a0%e6%88%91%e7%9a%84%e6%99%ba%e8%83%bd%e5%ae%b6%e5%b1%85/feed/ 0
智慧家庭協議解釋:Wi-Fi、藍牙、Zigbee、Z-Wave、Thread 和 Matter https://www.taiwansensor.com.tw/%e6%99%ba%e6%85%a7%e5%ae%b6%e5%ba%ad%e5%8d%94%e8%ad%b0%e8%a7%a3%e9%87%8b%ef%bc%9awi-fi%e3%80%81%e8%97%8d%e7%89%99%e3%80%81zigbee%e3%80%81z-wave%e3%80%81thread-%e5%92%8c-matter/ https://www.taiwansensor.com.tw/%e6%99%ba%e6%85%a7%e5%ae%b6%e5%ba%ad%e5%8d%94%e8%ad%b0%e8%a7%a3%e9%87%8b%ef%bc%9awi-fi%e3%80%81%e8%97%8d%e7%89%99%e3%80%81zigbee%e3%80%81z-wave%e3%80%81thread-%e5%92%8c-matter/#respond Sun, 22 Oct 2023 04:26:52 +0000 https://www.taiwansensor.com.tw/?p=64623 智慧家庭協議解釋:Wi-Fi、藍牙、Zigbee、Z-Wave、Thread 和 Matter Wi-Fi、藍 […]

這篇文章 智慧家庭協議解釋:Wi-Fi、藍牙、Zigbee、Z-Wave、Thread 和 Matter 最早出現於 台灣智能感測科技

]]>
智慧家庭協議解釋:Wi-Fi、藍牙、Zigbee、Z-Wave、Thread 和 Matter

Wi-Fi、藍牙、Zigbee、Thread、Z-Wave 和 Matter 是智慧家庭中裝置相互通訊的方式。它們通常被描述為無線協定、通訊標準和無線技術。它們如何運作?是什麼讓他們彼此不同?它們之間有更好的協議嗎?在這篇文章中,我們將解決這些問題,並全面了解如何利用它們為您帶來好處。

什麼是 Wi-Fi?

Wi-Fi 是 Wireless Fidelity 的縮寫,是一種無線通訊技術,可讓裝置連接到網路並以無線方式相互通訊。它基於 IEEE 802.11 標準,在未經許可的射頻頻段(通常為 2.4 GHz 或 5 GHz)下運作。

Wi-Fi 讓智慧型手機、平板電腦、筆記型電腦、智慧電視和智慧家庭設備等裝置能夠建立與區域網路 (LAN) 或網路的無線連線。它提供高速資料傳輸,允許用戶存取線上服務、瀏覽網頁、串流媒體和傳輸文件,而無需實體電纜。

Wi-Fi、Zigbee、Z-Wave、藍牙 - 有什麼區別
Wi-Fi、Zigbee、Z-Wave、藍牙 - 有什麼區別

 

選擇 Wi-Fi 以獲得廣泛的兼容性、高頻寬和直接連接到互聯網

Wi-Fi 無所不在。幾乎每個家庭都有它,每個 Wi-Fi 智慧型裝置都有其內建的透過 Wi-Fi 進行通訊的功能。WiFi的傳輸頻寬最大,已達數百Mbps。只要你有無線路由器,就可以接上它來傳輸高畫質視訊、無損音訊、高精準度圖片。Wi-Fi 連接到互聯網,因此可以透過智慧型手機、平板電腦或筆記型電腦在世界任何地方控制和監控家中的一系列智慧型裝置。

然而,Wi-Fi 非常耗電。Wi-Fi具有很強的傳輸能力和穿牆能力。它具有最強大的性能,但WiFi的功耗很高,不適合電池供電的設備,更適合插電設備。

智慧家庭中的 Wi-Fi
智慧家庭中的 Wi-Fi

 

什麼是藍牙?

藍牙是一種短距離無線技術標準,用於在短距離固定和行動裝置之間交換資料以及建立個人區域網路。其頻率為2.4GHz,傳輸範圍為50~150公尺。藍牙 5 提供四種不同的資料速率以適應各種傳輸範圍:2Mbps、1Mbps、500kbps 和 125kbps。藍牙的技術規格包括ERP 1-3三個等級的傳輸功率,以及空曠空間中100公尺、10公尺和1公尺的範圍。第二類 (10m) 是最受歡迎的,它使您能夠連接不同房間甚至不同樓層的設備。

在藍牙技術中,資料以資料包的形式傳輸到頻寬為 1 Mhz 的 79 個通道之一(在最古老的藍牙 1.0 標準的情況下),確保最大傳輸速度為 721 kbit/s。最新藍牙 4.0 標準 (BLE) 的 40 個通道和 2 Mhz 頻寬確保了高達 3 Mb/s 的最大資料傳輸速率。

 

低功耗藍牙在智慧家庭中扮演什麼角色?

智慧家庭設備使用低功耗藍牙 (BLE),它比標準藍牙消耗更少的能量,因為設備大部分時間都處於低功耗狀態。

低功耗藍牙對於智慧型裝置操作的優勢在於易於採用且廣泛的相容性。例如,如果您在手機上安裝飛利浦 Hue 藍牙應用程序,您可以控制最多 10 個 Hue 智慧 LED 燈,而無需購買智慧顯示器或像 Hue Bridge 這樣的智慧集線器。

特性比較
特性比較

 

但低功耗藍牙也有缺點。首先,它提供的頻寬比 Wi-Fi 少得多,這就是為什麼智慧攝影機和視訊門鈴傾向於使用 Wi-Fi 的原因——頻寬越大,視訊資料傳輸效果越好。

藍牙技術對指令的反應也相當緩慢。與您現在可以選擇控制智慧型裝置的替代技術(如 Zigbee、Z-Wave、Thread 和 Matter)相比,使用藍牙的智慧型裝置的回應存在明顯的延遲。

 

什麼是 Zigbee?

Zigbee 是一種無線網路標準,其規範由成立於 2002 年的非營利組織 Zigbee 聯盟維護和更新。有超過 400 家科技公司支持該標準,包括蘋果、亞馬遜和谷歌等巨頭,與貝爾金、華為、 IKEA、英特爾、高通和Signify 等眾多品牌並列。

Zigbee 標準可以在室內約82 至109 碼/75 至100 公尺的距離內廣播數據,或在露天約328 碼/300 公尺的距離內廣播數據,這意味著它可以輕鬆地在大型家庭中提供強大、穩定的覆蓋。

Zigbee聯盟
Zigbee聯盟

 

Zigbee 在智慧家庭中如何運作?

Zigbee 在智慧家庭設備之間發送指令,例如從智慧揚聲器到燈泡,或從開關到燈泡,而無需先透過 Wi-Fi 路由器等中央控制集線器。此訊號也可以被接收設備發送和理解。不管是哪個廠商生產的。只要他們都支持 Zigbee,他們就說同樣的語言。

Zigbee 作為網狀網路運行,這意味著可以在連接到相同 Zigbee 網路的裝置之間發送指令。理論上,每個設備都充當一個節點,向其他每個設備接收和傳輸數據,幫助指令數據進一步傳播,智慧家庭網路可以覆蓋更大的區域。

Zigbee 網狀網絡
Zigbee 網狀網絡

 

Zigbee 網路的網狀結構也意味著網路中不存在任何故障點。例如,如果您家裡充滿了 Zigbee 相容的智慧燈泡,您可能希望它們同時發光。如果其中一個燈泡無法正常運作,網格會確保指令仍會傳遞到網路中的每個其他燈泡。

Zigbee 可能不像 Wi-Fi 那麼常見,但它出現在數量驚人的產品中;Zigbee 聯盟擁有來自 35 個國家的 400 多名成員。該聯盟還表示,目前已生產超過 3 億個 Zigbee 認證產品,超過 2,500 種。

 

什麼是Z波?

Z-Wave 是一種在連接設備之間發送資料的無線通訊協定。與 Zigbee 類似,Z-Wave 使用網狀網路技術,使設備能夠相互通訊並形成互連網路。Z-Wave 在比 Wi-Fi 和 Zigbee 更低的射頻上運行,由於在同一頻率上缺乏競爭,因此減少了其他無線設備幹擾的可能性,並直接提高了設備可靠性。Z-Wave 網路由一個「控制器」和一個或多個「從站」組成。

Z-Wave 控制器(通常稱為 Z-Wave 集線器)用於:

  • 啟動並建立網絡
  • 在 Z-Wave 網路中新增或刪除設備
  • 將 Z-Wave 網路橋接到您的家庭 Wi-Fi 網路。

Z-wave 網狀網絡
Z-wave 網狀網絡

 

Z-wave 如何幫助連結智慧家庭?

Z-Wave 從屬設備是一種智慧家庭設備,例如智慧鎖或感測器。與 Zigbee 類似,主電源供電的 Z-Wave 設備充當網狀網路的中繼器,因此當您添加更多 Z-Wave 智慧插頭或感測器時,網狀網路的可靠性和範圍就會增加。

Z-Wave 受歡迎的原因之一是它的互通性,即跨不同品牌交換和利用資訊的能力。這意味著任何帶有 Z-Wave 徽標的智慧型裝置都可以與其他支援 Z-Wave 的裝置無縫協作,無論該裝置是由哪家公司生產的。

Z-wave 幫助連接智慧家居

Wi-Fi、Zigbee 和 Z-Wave - 有什麼區別?

Zigbee 與 Wi-Fi 和 Z-Wave 相比具有不同的功能,各有優缺點。這些都是:

 

可用性

Wi-Fi 無所不在,因為它透過路由器在普遍接受的 2.4 GHz 上運作。同樣,Zigbee 也在普遍接受的 2.4 GHz 頻段上運作。它簡化了製造過程,因為可以使用相同的晶片在世界各地分銷產品。

另一方面,Z-Wave 產品只能在一定範圍的政府頻率內進行通訊。在美國,Z-Wave 產品使用 908 MHz,而在歐洲則使用 868 MHz。世界不同地區還提供許多其他頻率。大多數製造商只為美國和歐洲生產有限的 Z-Wave 產品。

Wi-Fi、Zigbee 與 Z-Wave

互通性

大多數 Wi-Fi 都是可互通的,尤其是使用相同網路協定的 Wi-Fi。一些製造商提供公司特定的整合。亞馬遜和谷歌等大公司提供自己的 Wi-Fi 集成,例如智慧揚聲器和其他智慧家居產品。

所有 Z-Wave 產品都具有互通性,因為由 Sigma Design 等單一組織對其進行了認證。整個認證過程確保所有產品都與整個 Z-Wave 生態系統相容。大規模的互通性幫助 Z-Wave 迅速提高了行業採用率。據估計,目前市場上有超過 3,000 種經過 Z-Wave 認證的產品。

相反,Zigbee由於未能實施互通性標準而遭受了很大損失。Zigbee 必須面對許多詐欺活動,尤其是在其最初幾年。2007 年,Zigbee Pro 標準推出,以提高互通性並防止詐欺。Zigbee 3.0產品現在具有非常令人印象深刻的互通性。

 

可計算性

在 Zigbee 和 Z-Wave 中,Wi-Fi 是唯一獲得亞馬遜、谷歌和蘋果這三大主要平台支援的智慧家庭技術。您還可以添加多技術中心,以提供更靈活、更有效率的功能。大多數公司很容易整合Wi-Fi 產品,因為它是一項非常知名的技術。

Vera 和 SmartThings 等廣泛的多技術中心支援 Zigbee。而且,許多開源程式也支援Zigbee設備。然而,Zigbee 的可計算性肯定比 Wi-Fi 設備低得多。另一方面,幾乎每個多技術中心和家庭軟體程式都支援 Z-Wave。但是,亞馬遜或Google智慧音箱不支援 Z-Wave。

 

什麼是線?

Thread 是專門為物聯網設備所建置的無線協定。它的設計目的是讓它們工作得更快、故障點更少、功耗更少,並且彼此之間的通訊更順暢。

Thread 是一種使用 802.15.4 無線電技術的低功耗、低頻寬網狀網路協議,類似於現有的智慧家庭協議 Zigbee 和 Z-Wave。但與它們不同的是,它不需要中央樞紐或橋樑。相反,Thread 設備可以直接相互通訊。透過消除中間人,Thread 可以更快,尤其是在大型網路上。

此外,與其他低功耗智慧家庭協定不同,Thread 是基於互聯網協定(IP) 的,這意味著它可以直接連接到任何其他基於IP 的設備,例如智慧型手機、平板電腦、電腦和Wi-Fi 路由器。

可擴展的低功耗網格
可擴展的低功耗網格

 

Thread 在智慧家庭中如何運作?

Thread 從一開始就被設計為支援低延遲的物聯網低功耗協定。這就是它的目的。智慧家庭中使用的許多其他技術旨在優化其他應用程式。例如,藍牙最初被設計為有線的替代品。Thread 專為只想長時間休眠、喚醒、傳送單一資料包,然後返回休眠狀態並盡可能長時間保存電池的裝置而設計。

Thread 的直接通訊功能與其處理規模(超過 250 個設備)的能力相結合,意味著更低的延遲。Silicon Labs 運行的基準測試顯示,Thread 在延遲測試中擊敗了 Zigbee 和藍牙,尤其是在擁有許多設備的大型網路中。Thread 網格可用作路由網格,這表示設備會主動尋找網路中每個其他設備的最佳路由。這種效率直接轉化為功耗的降低和延遲的降低。作為一個網狀網絡,Thread 具有自我修復能力;如果一台路由器(請參閱側邊欄)斷線,另一台路由器可以彌補這一不足,這樣您的網路就不會出現故障。

智慧家庭中的執行緒工作

什麼是物質?

Matter 是由 Project Connected Home Over IP(Project Chip)於 2019 年創建的智慧家庭標準。它是一種新的開源標準,使用基於互聯網協議 (IP) 的無線技術,Wi-Fi 路由器使用該技術來分配每個連接設備的IP 位址。現在它由連接標準聯盟 (CSA)(前身為 Zigbee 聯盟)維護。該標準是免版稅的,並鼓勵設備和平台之間的互通性。Matter 於 2022 年 11 月正式上線。

Matter 是一個應用層協議,運行在不同的實體層協議上,包括 Thread、Wi-Fi 和乙太網路。Matter 的目標是提供一個統一的標準,實現智慧家庭設備之間的互通性和相容性。它定義了設備之間的通訊和互動方式,允許不同品牌和類型的智慧家庭設備之間無縫協作。

網路生態系統共存:Matter 是一種聚合標準,匯集了現有的物聯網標準
網路生態系統共存:Matter 是一種聚合標準,匯集了現有的物聯網標準

物質能解決什麼問題?

  • 建立通用標準:物聯網設備已經存在多年,但它們被分為獨特的類別。沒有一個通用標準將它們組合在一起,這是我們必須克服的最大障礙之一。在 Zigbee、Z-Wave、藍牙和 Wi-Fi 之間,智慧家庭和物聯網設備的無線連接空間變得過於擁擠,不利於其自身的發展。
  • 持續的網路連線:物聯網設備以前完全依賴雲端來處理所有事情,這使得它們在失去網路連線時變得毫無用處。Matter 允許裝置離線工作,無需持續存取雲端和各種雲端服務。減少對雲端的依賴也意味著設備的安全性提高——這對於智慧鎖和安全攝影機等敏感硬體至關重要。

 

物質存在哪些問題?

沒有什麼是完美的,雖然 Matter 比它的前輩好很多,但它也有一些缺點。新標準的引入取決於廣泛採用。支援物質的智慧型設備的數量正在增加。Eve、Meross Nanoleaf、Hue、Comcast 和 Toya 等品牌正在更新或創建新的 Matter 支援的解決方案。當您購買新設備或配件時,請尋找 Matter 智慧家居徽章。如果您想知道現有設備是否會獲得 Matter 更新,請參閱製造商的網站。

 

結論

Wi-Fi、藍牙、Zigbee、Thread、Z-Wave 和 Matter 都是智慧家庭中使用的重要通訊協定。每個協定都有其獨特的特性和優勢,可滿足不同的設備要求和用例。

隨著越來越多的公司加入Thread和Matter陣營,並將其納入自己的產品生態系統中,這兩項技術將逐漸成為智慧家庭設備的主流標準。不過,值得注意的是,市場上仍有許多智慧家庭設備使用其他通訊協定。因此,在可預見的未來,我們可能會看到各種通訊技術共存,並在特定設備類型或用例中合理應用。但整體趨勢是,Thread和Matter將在智慧家居產業中發揮重要作用,並逐漸成為首選。

這篇文章 智慧家庭協議解釋:Wi-Fi、藍牙、Zigbee、Z-Wave、Thread 和 Matter 最早出現於 台灣智能感測科技

]]>
https://www.taiwansensor.com.tw/%e6%99%ba%e6%85%a7%e5%ae%b6%e5%ba%ad%e5%8d%94%e8%ad%b0%e8%a7%a3%e9%87%8b%ef%bc%9awi-fi%e3%80%81%e8%97%8d%e7%89%99%e3%80%81zigbee%e3%80%81z-wave%e3%80%81thread-%e5%92%8c-matter/feed/ 0
Arduino發佈了Opta,它的首款「微型PLC」,針對工業物聯網領域。 https://www.taiwansensor.com.tw/arduino%e7%99%bc%e4%bd%88%e4%ba%86opta%ef%bc%8c%e5%ae%83%e7%9a%84%e9%a6%96%e6%ac%be%e3%80%8c%e5%be%ae%e5%9e%8bplc%e3%80%8d%ef%bc%8c%e9%87%9d%e5%b0%8d%e5%b7%a5%e6%a5%ad%e7%89%a9%e8%81%af%e7%b6%b2/ https://www.taiwansensor.com.tw/arduino%e7%99%bc%e4%bd%88%e4%ba%86opta%ef%bc%8c%e5%ae%83%e7%9a%84%e9%a6%96%e6%ac%be%e3%80%8c%e5%be%ae%e5%9e%8bplc%e3%80%8d%ef%bc%8c%e9%87%9d%e5%b0%8d%e5%b7%a5%e6%a5%ad%e7%89%a9%e8%81%af%e7%b6%b2/#respond Thu, 05 Oct 2023 06:00:14 +0000 https://www.taiwansensor.com.tw/?p=64430 以STM32H747XI為基礎,Opta家族包括Ethernet、RS485和Wi-Fi/藍牙變種,針對專業人 […]

這篇文章 Arduino發佈了Opta,它的首款「微型PLC」,針對工業物聯網領域。 最早出現於 台灣智能感測科技

]]>
以STM32H747XI為基礎,Opta家族包括Ethernet、RS485和Wi-Fi/藍牙變種,針對專業人士打造。

Arduino宣布推出其所謂的「首款微型PLC(可程式邏輯控制器)」,名為Opta — 一款堅固的設備,專為工業物聯網(IIoT)而設計。

Arduino團隊聲稱他們的最新硬體產品是「專為PLC工程師而設計的」,它支援包括LD(Ladder Logic Diagram)和FBD(Function Block Diagram)在內的標準語言,允許專業使用者擴大工業和建築自動化項目,充分發揮我們的標誌性開源、易於使用且不會受供應商限制的方法。

Arduino's Pro range has its first "micro PLC," the Opta — positioned firmly for the Industrial Internet of Things (IIoT). (📷: Arduino)

內部結構方面,可安裝在DIN軌道上的Opta,由Arduino與Finder合作開發,使用了STMicro STM32H747XI雙核微控制器。該微控制器包括一個高性能Arm Cortex-M7核心,最高運行速度可達480MHz,以及一個低功耗的Cortex-M4核心,最高運行速度可達240MHz,並配備共享浮點運算單元(FPU)、Chrom-ART加速器、硬件JPEG加速器、2MB快閃記憶體、總共1,056KB的RAM,以及1,024字節和4KB的備份靜態RAM(SRAM)。

Opta的功能取決於型號,首次推出將提供三種變種:Opta Lite,包括Ethernet連接和用於編程的USB Type-C;Opta RS485,額外添加RS485半雙工支持;以及Opta WiFi,包括用於Wi-Fi和藍牙低功耗(BLE)通信的無線電。Arduino已經確認,所有型號都支援空中更新,並具有專用的安全元素以確保加密,此外還搭載可用於開關4個最高2.3kW負載的繼電器。

The Opta range uses STMicro's STM32H747XI chip, with two Arm Cortex-class cores, FPU, and accelerators. (📷: STMicro)

Arduino宣布推出其所謂的「首款微型PLC(可程式邏輯控制器)」,名為Opta — 這是一款堅固的裝置,設計瞄準工業物聯網(IIoT)的前沿。

「我們設計Opta時特別考慮到了PLC工程師,」Arduino團隊在最新硬體發布中宣稱,「支援標準語言,包括LD(梯形邏輯圖)和FBD(功能塊圖),它允許專業用戶擴展工業和建築自動化項目,充分發揮我們標誌性的開源、易於使用且不受供應商限制的方法。」

在內部結構方面,可安裝在DIN軌道上的Opta — 由Arduino與Finder合作開發 — 使用了STMicro STM32H747XI雙核微控制器。該微控制器包括一個高性能的Arm Cortex-M7核心,最高運行速度可達480MHz,以及一個低功耗的Cortex-M4核心,最高運行速度可達240MHz,並配備了共享的浮點運算單元(FPU)、Chrom-ART加速器、硬件JPEG加速器、2MB快閃記憶體、總共1,056KB的RAM,以及1,024字節和4KB的備份靜態RAM(SRAM)。

Opta的功能取決於型號,首次推出將提供三種變種:Opta Lite,包括Ethernet連接和用於編程的USB Type-C;Opta RS485,額外添加RS485半雙工支持;以及Opta WiFi,包括用於Wi-Fi和藍牙低功耗(BLE)通信的無線電。Arduino已經確認,所有型號都支援空中更新,並配備了專用的安全元素以確保加密,此外還搭載了繼電器,可用於切換最高2.3kW的四個負載。

Arduino團隊聲稱,「通過其內置連接性和機器學習功能,Opta為每個人提供了開展工業自動化新機遇的可能性:設計、迭代和實施越來越有野心的想法,以實現更高質量的製造、提高效率、提高生產力和盈利能力。如果您同意我們的觀點,即創新有助於我們應對各種可能的挑戰,我們期待看到您如何利用Opta創造更好的解決方案!」

如果您想得知更多關於 Opta系列的資訊,您可以在官方產品頁面上查看

這篇文章 Arduino發佈了Opta,它的首款「微型PLC」,針對工業物聯網領域。 最早出現於 台灣智能感測科技

]]>
https://www.taiwansensor.com.tw/arduino%e7%99%bc%e4%bd%88%e4%ba%86opta%ef%bc%8c%e5%ae%83%e7%9a%84%e9%a6%96%e6%ac%be%e3%80%8c%e5%be%ae%e5%9e%8bplc%e3%80%8d%ef%bc%8c%e9%87%9d%e5%b0%8d%e5%b7%a5%e6%a5%ad%e7%89%a9%e8%81%af%e7%b6%b2/feed/ 0