王威 oliwave
    • Create new note
    • Create a note from template
      • 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
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me 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
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control 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
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me 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
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Week 13 Pi (2019/12/12) - Book mode https://hackmd.io/@ncnu-opensource/By4H6JLNW ## 期末分組 ### 規則 至少一個人跟報告組不一樣 ### 第一組(設備已拿 變壓器 繼電器) 108213510 蕭棋文 108213504 張育銓(組長) 106213077 陳佳境 ### 第二組(設備已拿 變壓器) 108213503 陳奕良(組長) 108213517 林柏宇 108213505 張尹賓 ### 第三組(設備已拿 變壓器 繼電器) 108213513 黃名玄(組長) 108213511 朱家慶 108213512 簡鈺紋 ### 第四組(設備已拿 繼電器) 107213004 郭子緯(組長) 105213018 黃雅琳 106213017 蔡佳軒 ### 第五組(設備已拿 繼電器) 105321015 呂國丞(組長) 105321047 張瑋育 105321018 陳湘蕙 ### 第六組(設備已拿 繼電器) 105212048 謝其佑(組長) 105321032 何文睿 106213018 林子揚 ### 第七組(設備已拿 變壓器 繼電器) 107321522 陳奕哲(組長) 107321519 彭梓宸 ### 第八組(設備已拿 繼電器) 105213022 李漢偉(組長) 106213040 林其緯 106213048 李政峰 ### 第九組(設備已拿 繼電器) 106213021 游允喆 106213076 黃暐澄(組長) 106213060 吳翰琳 106213001 李柏翰 ### 第十組(海聯代表隊,設備已拿 繼電器) 陳荷文(真.組長) 洪煥銘 賴王bin 確認每一組都有拿到樹梅派本體、TTL線、SD卡一張(部分組別有拿變壓器) ### 樹梅派設定 到 raspiberry 官網下載(選lite版本)(一組一個人下載即可): https://www.raspberrypi.org/downloads/raspbian/ ( raspbian 是 for 樹梅派的 OS ) ### 使用 ubuntu 系統 將 SD 卡插到電腦裡面 查看硬碟狀況,找到SD卡 ``` lsblk -p ``` 卸載SD卡以利格式化 ``` sudo umount <path>(記憶體掛載位置) ``` 格式化SD卡(2TB以上請使用parted),此處使用fdisk ``` sudo fdisk <device>(SD卡) ``` 進到Device裡面 ``` p 看partition狀態 ``` 刪除partition ``` d 刪除分割區 ``` ``` 1 查看原始分割配置 ``` ``` p 看到partition被刪掉了 ``` ``` n 建立新分割區 ``` ``` L 看分割區種類 > 選 b FAT 32 ``` 確認格式化成FAT32格式 ``` sudo fdisk <device>(SD卡) ``` ### 燒錄 dd:(沒有防呆,千萬不要mount錯位置) bs 是 blocksize,幾MB可以自己填 ``` sudo dd if=Raspibian.img檔 of=掛載位置 bs=1M(mac的m是小寫,mac也可以不加) status=progress conv=fsync ``` ### 啟用uart 建立一個目錄 ``` mkdir dsdcard ``` mount SD 卡 ``` sudo mount <deviceSD卡> <建立的目錄> ``` ``` sudo vim ~/Desktop/建立的目錄/config.txt ``` 修改config.txt檔案裡面加上enable_uart=1 ### 使用 windows 系統或 mac 請到支援連結找方法 支援連結(格式化筆記): https://hackmd.io/@minecola/BJaoPYkAr ### 開始使用樹梅派 :::danger 1. 把剛剛設定好的SD卡放到樹梅派的SD卡槽上(不要接電源) ::: 2. 接上電源,紅燈是電源,黃燈是記憶卡讀取,閃爍是電壓不穩 3. TTL線黑、白、綠接6、8、10腳位(windows、mac要裝驅動,見下方支援連結) ### screen ``` sudo apt install screen ``` 找到usb裝置 ``` ls /dev | grep ttyUSB ``` ``` sudo screen /dev/ttyUSB0(找到的usb裝置) 115200 ``` ### putty ``` sudo apt install putty ``` 打開putty圖形化介面 ``` sudo putty ``` :::info 連線進入 pi 後,需要登入 帳號:pi 密碼:raspberry ::: 連結支援: [如何連線透過 USB 連線至 PI](https://hackmd.io/@minecola/ryYq_Y1AH) [樹莓派大補帖](https://hackmd.io/@minecola/SyfH2T2TS) ### 樹梅派地區時區設定 ``` sudo raspi-config ``` 開啟介面選4:選1.2.分別調整地區、時區 地區與編碼 zh_tw UTF-8 時區 Taipei ### 網路設定 修改wifi設定檔 ``` sudo vim /etc/wpa_supplicant/wpa_supplicant.conf ``` 填入wifi資訊 或 ``` sudo raspi-config ``` 3.Network Options > 設定 WIFI > 需要WIFI名稱跟密碼 ### 設定ssh ``` sudo raspi-config ``` 5.Interfacing > ssh > enable 在同個網路環境下就可以用ssh連線了 ## 從SD卡設定網路連線及ssh(在沒有螢幕跟ttl線的情況下) 以macOSX為例 因為檔案系統不同的關係,mac只能夠掛載boot磁區 ``` #插入SD卡後cd到boot cd /Volumes/boot ``` 建立wifi設定檔,開機時會自動匯入/etc/wpa_supplicant/ ``` touch wpa_supplicant.conf ``` 編輯wpa_supplicant.conf 用vim, nano或其他文字編輯器都可以 ``` country=TW # Your 2位wifi國家碼 ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev network={ ssid="你的wifi名稱" psk="你的wifi密碼" } ``` 在/boot裡加入一個ssh可以在開機的時候自動打開ssh ``` touch ssh ``` 插上sd卡開機之後,在macOSX上搜尋local網域內裝置 ``` arp -a ``` 可以在pi連線前先看一次,pi開機後多出來那一個就是pi,找到就可以用ssh去連他 ### pi 自動寄信 mail.py: ```python= #!/usr/bin/python import subprocess import smtplib import socket from email.mime.text import MIMEText import datetime # Which email address want to send to = 'XXX' # Using specific gmail account gmail_user = 'XXX' gmail_password = 'XXX' # SMTP command smtpserver = smtplib.SMTP('smtp.gmail.com', 587) smtpserver.ehlo() smtpserver.starttls() #smtpserver.ehlo 這行不用加,不影響 smtpserver.login(gmail_user, gmail_password) today = datetime.date.today() # Linux Specific shell command arg='ip route list' p=subprocess.Popen(arg,shell=True,stdout=subprocess.PIPE) data = p.communicate() split_data = data[0].split() ipaddr = split_data[split_data.index('src')+1] my_ip = 'Your ip is %s' % ipaddr msg = MIMEText(my_ip) msg['Subject'] = 'IP For RaspberryPi on %s' % today.strftime('%b %d %Y') msg['From'] = gmail_user msg['To'] = to smtpserver.sendmail(gmail_user, [to], msg.as_string()) smtpserver.quit() ``` ### gmail 開啟低安全性應用程式 https://myaccount.google.com/lesssecureapps ### 編輯/etc/rc.local 開機自動作業 ``` sudo vim rc.local ``` ### 在exit之前加入要做的事 ``` python mail.py ```

    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