伴伴學 Accomdemy
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    3
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    --- tags: 活動共筆 --- # 20210731 伴伴學 x 官帥: 官帥陪你聊基於ESP32 BLE2 WIFI智能網關(上) 簡報: https://drive.google.com/file/d/1PS8JkcHu9HgpNEXoI9e6fOH_NTHfVqS3/view [程式碼](https://drive.google.com/drive/u/0/folders/1Ru6BPqLM_zhPnp8A8dQHZ2Xtd44KoN9P)與[外殼設計](https://grabcad.com/library/esp32-ble2wifi-gateway-1)在簡報內也有 烙鐵 8586,個人習慣設定溫度約在300-320,對元件較舒服的溫度,且內建霍爾開關,烙鐵&熱風槍放置架上,內建霍爾感測會自動關機 烙鐵焊接時先碰接腳,再把錫靠過去。機板與被焊接物都要加熱,這樣焊接的錫才會飽滿 焊接固定焊接物好工具-萬用黏土,方便固定PCB板、零件、...等 烙鐵頭表面若有沾錫,不要用沾水海綿,會傷害烙鐵頭 焊接完成記得關烙鐵,不然也會燒掉 ![](https://i.imgur.com/tQWvhUJ.jpg) ESP32的ENABLE要上拉,為了一鍵上傳使用,接一顆47uF電解電容 正常電解電容有方向性,白色的部分是負極 電容上會有寫電容值與電壓值,電壓表示耐壓,使用過程不要超過耐壓就不會爆掉 焊接時注意因為鐵殼接地很大片,所以建議焊地線時可以調高到310度並放久一點 接點焊接完成後可以用卡夫特矽膠封住接點 >卡夫特膠 >產品用途: 本品具有良好的粘合性和耐冷水性,用於粘接、密封、絕緣、防潮、防震材料,廣泛應用於電子元件、半導體材料、電子電器等設備的粘接、密封,電加熱器、電子儀表的防水、密封及電子元件的灌封等。 LED燈條有三條線,紅色接+5V,白色接訊號線(PIN13),黑色接地。為簡化焊線用最左下三隻 燈條接ESP32左邊的VIN,電壓會跟USB電源進來的一樣 不會流鼻水的熱熔膠槍:G-250 (今天推薦的設備都沒有業配,純心得) 外殼黏接的膠是3M黏手機螢幕的黑膠,膠本身有彈性,繞著底殼外緣走一圈即可 底殼有留一個壁掛孔,方便直接掛到牆壁上。且底殼中央有墊高方便貼合 選用的ESP32沒有排針,若拿到的ESP32已經焊了排針,建議剪掉 ESP32與底殼用熱熔膠貼合,電容若凸出外殼可以反折,只要不短路就好 燈條貼在外殼上方,貼上後為了避免會拉掉,建議外圍補一圈熱熔膠固定 外側燈條露出的凹槽也可以用熱熔膠填滿,表面就會很漂亮 若熱熔膠表面不漂亮,可以用吹風機加熱 燈條的線沿著外殼內側繞回去,可以避免影響天線收訊 智能家居會是帶狀分享的內容,Home Assistant功能強大,後面會有更多分享 這次的網關是負責收集資料,不負責SENSOR 這次的燈條用1米60燈的,黑色與白色只有底板顏色有差。買回來自己剪 USB接上電腦後可以看到CP210X,沒有看到的人需要裝自行裝驅動程式 連接完成後開啟LedStripTest.ino 程式內容已經改好,Arduino板子選好Esp32直接燒錄就可以 確定LED沒問題以後改開啟20210717063000XiaomiFloraPlant.ino 用手機開起藍芽功能,準備開始掃描BLE裝置 手機掃瞄到手上的BLE裝置後會顯示裝置的UUID,把UUID輸入Flora程式碼 題外話: Home Assistant建議安裝Duck DNS與Samba share 左側選單 -> HACS裡面有很多外掛功能 ewelink、IKEA、小米也做了HA的外掛,若有買的也可以整合進來 HA的功能大部分都稱為platform,與用的語言是YAML。要注意YAML很注重空格 若手上有ESP CAMERA也可以整合進來,甚至有支援RTSP、MJPEG的CAMERA 設定範例可以直接上網搜尋,怕格式跑掉可以直接複製再來改 Home Assistant -> ESP Home 從SUPERVISOR進入安裝,安裝完要按啟動,啟動完會顯示在左側選單 不建議開啟自動更新,有時會有BUG STEP1: 把網關接到樹梅派的USB 右上角應該會顯示USB裝置,選擇後按+(新增裝置) 任意取名,Device Type選Wifi module,再輸入WIFI帳號密碼 設定完可以進入EDIT,有簡單的設定內容可以參考 直接點UPLOAD測試是否可以正常上傳 HA上傳後會自動把ESP32的AP功能關掉,並開啟OTA的功能 STEP2: 修改 esp32_gateway_test.yaml 這邊會用到BLE TRACKER與TEXT SENSOR PLATFORM為BLE_RSSI * YAML /config/configuration.yaml platform: scrape 可在想抓取網頁上的"資料" 安裝[Web Scraper - Web Scraper - Free Web Scraping](https://chrome.google.com/webstore/detail/web-scraper-free-web-scra/jnhgnonknehpejjnehehllkliplmbmhn/related?hl=zh-TW)外掛 可截取網頁上的資訊 ex: 股票資料、流量、點閱人數、...etc >- platform: scrape name: 台積電2330 resource: https://tw.stock.yahoo.com/q/ts?s=2330 select: '#detailTable td tr:nth-of-type(2) td:nth-of-type(5)' headers: User-agent: Mozilla/5.0 * Node-RED MQTT >Node-RED 是 IBM 以 Node.js 為基礎,開發出來的視覺化 IOT 開發工具,因為純粹透過流程圖的方式工作,所以不需要會 Node.js 也可以透過 Node-RED 完成許多後端才能做的事情。 * LINE Notify - https://notify-bot.line.me/my/ LINE - 建立群組"TEST" 發行權杖 選擇接收聊天室 - "TEST" 產生 Token (要好好保存,否則要砍掉重建) ![Example code](https://i.imgur.com/l81qLp1.jpg) * Duck DNS ``` lets_encrypt: accept_terms: true certfile: fullchain.pem keyfile: privkey.pem token: domains: - louisguan.duckdns.org aliases: [] seconds: 300 ``` ---- ## Q&A * 請問外殼是怎麼拆開…有黏住嗎? Ans : 外殼黏接的膠是3M黏手機螢幕的黑膠 * 請問燈條是買回來自已採剪的嗎? 採剪時注意什麼? LED賣廠上有3個版本,要購買那個版本? Ans : 是的。買一整捲回來剪裁。60顆LED/米。 ![](https://i.imgur.com/KUYBAIG.jpg) * 為什麼不使用樹梅派來應用呢? Ans : 樹梅派本身是有BLE的,但是因為在實作時不可能把SERVER到處放,所以會做便宜輕量的網關取代 * 請問led是買 裸板 滴膠 套管 那個一版本? Ans : 不會碰到水的話,買裸板就行了。需防水則購買滴膠or套管。 * ESPHome 能做output動作嗎?列如用node red去改變led的顏色 Ans : 可以的。 * 請問在ESP32上焊接一鍵上傳的電容,是所有品牌的ESP32都可以這樣用嗎? Ans : 目前市售上的都是可以這樣子使用。 --- ## Reference * Make自造666 - [智能居家平台 BLE2WIFI網關賣場](https://myship.7-11.com.tw/general/detail/GM2107187188865) * Home Assistant - [OFFICIAL WEBSITE](https://www.home-assistant.io/) * Home Assistant - [MJPEG IP Camera](https://www.home-assistant.io/integrations/mjpeg/) * yaml vs yml的區別: [小科普](https://cloud.tencent.com/developer/ask/69788?from=14588) * ESPHome - [OFFICIAL WEBSITE](https://esphome.io/) * Node-RED - [官方網站](https://nodered.org/) * Node-RED - [( 基礎操作 )](https://tutorials.webduino.io/zh-tw/docs/socket/useful/node-red.html) * 智能情境設定連動Line即時訊息_Node-RED應用 - https://www.justplus.com.tw/line.html * Duck DNS - [OFFICIAL WEBSITE](https://www.duckdns.org/) * TridentTD_LineNotify - [GitHub](https://github.com/TridentTD/TridentTD_LineNotify ) ---

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully