kyouheisato
    • 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
    # 2023年_ネットワーク実習 # 10/11 ## 今日やること * ノートパソコンを使ったSSH通信 ## 今日出てくる単語 * ipアドレス(動的・静的) ![](https://hackmd.io/_uploads/H1IV257Wp.png)* isp * path * ルーター * wi-fi * linux * Debian * シェル * カーネル * powerShwll ## 実践 フロー表を作ろう! 1. wifiに接続しよう 自分のノートPCを授業用のルーターと接続してください。 |ルーターの名前|pw| |---|---| |aterm-ef42c3-g|1257e7d013cab| 2. ノートパソコンとラズパイをつなげよう windows powwershelを開こう ![](https://hackmd.io/_uploads/rJKPBnQb6.png) 3. ssh通信でルーター経由でラズパイに入り込もう power shellにssh通信のコードと通信先を入力する ![](https://hackmd.io/_uploads/SJMxO3mb6.png) |ラズパイの名前|pw| |---|---| |pi103berry|pi103| ## ssh接続 ``` $ ssh ホスト名@ipアドレス ``` 例 ``` $ ssh pi@192.168.10.103 ``` ![](https://hackmd.io/_uploads/Hyd2t3mZa.png) pwを聞かれるので`pi103`と入力(PWは入力しても見えないようになっている) コマンド一覧 https://monomonotech.jp/kurage/raspberrypi/linux_command.html ## 課題 1. テキストファイルを作ろう 自分がいるディレクトリを知る ``` % pwd ``` ディレクトリ移動 ``` % cd Desktop ``` テキストファイルを作る方法1 ``` % touch sample.txt ``` - touchコマンドは、ファイルのアクセス時刻と修正時刻を変更するコマンドですが、ファイルが存在しない場合は作成します。 テキストファイルを作る方法2 ``` % echo "テキストファイルの中身" > sample.txt ``` - echoは標準出力にテキストを出力するコマンド - その結果を`>`でファイルにリダイレクトしている ## 参考サイトURL https://monomonotech.jp/kurage/raspberrypi/linux_command.html http://kobore.net/2-wifi-window10.mm.html https://qiita.com/napspans/items/cb2737eadae48118f8c5#:~:text=Raspberry%20pi%20%E3%82%A4%E3%83%B3%E3%82%B8%E3%82%B1%E3%83%BC%E3%82%BF%E3%83%BC%E3%83%A9%E3%83%B3%E3%83%97%E3%81%AE%E6%84%8F%E5%91%B3 https://qiita.com/naohiro2g/items/d5385a4e660fd72711b2 https://qiita.com/m4saka/items/b9defd7542eee3551759 https://livra.geolocation.co.jp/iplearning/230/ # 10/18 ## 前回達成できたこと wifiルーター経由で自分が所持しているPCとラズパイをssh通信できた。 linux環境でのシェルスクリプトを少し動かせた。(ディレクトリ移動,ファイル検索,ファイル作成,メモ編集) ## 前回の問題点 PCのwifiはルーターのアクセスポイントでつぶれているのでインターネット(rispot)にアクセスできず授業資料やネット検索を使えない。 ## 本日やること 1. 自分のノートPCのwifiを2つのアクセスポイントにつなげる。 - USB-LANがそのまま使えず断念 3. ラズパイにssh通信してラズパイにつながっているセンサーの値を取得する。 https://monomonotech.jp/kurage/raspberrypi/led_chikachika.html 3. ルーターにつなげた時のラズパイのipアドレスを固定ipアドレスに変える 4. ラズパイのホスト名とPWを変更する https://www.kodomonokagaku.com/experience/programming/39884/ 5. ラズパイの日時修正 https://arakoki70.com/?p=5691 |ラズパイの名前|pw|| |---|---|---| |pi103berry|pi103|| |pi104berry|pi104|new!| |pi105berry|pi105|new!| ### 参考URL http://kobore.net/2-wifi-window10.mm.html https://infocat.xyz/wifi/ ### 前回のURL https://hackmd.io/@kyouheisato/B1a3VPfbp ### 前回できたこと - wifiルーター経由で自分のPCとラズパイをssh通信できた。 - linux環境(ラズパイの環境)でシェルスクリプトを少し動かせた。 (ディレクトリ移動,ファイル検索,ファイル作成,メモ編集) - ssh通信を繰り返してラズパイ間を行き来できた。 ### 前回の問題点 PCのwifiはルーターのアクセスポイントでつぶれているのでインターネット(rispot)にアクセスできず授業資料やネット検索を使えない。 - USB-LANをルータにつなげてどうにか解決 ### 本日やること 1. 自分のノートPCのにwifiドングルをつけてインターネット通信しながらルーターにも入り込む https://hackmd.io/NEuhW4ewRx-zfj0suogpZw 2. 処理手順・結果をメモする習慣を付ける(メモしやすい・視覚的にわかりやすいツールを使ってみる) ```markmap # ssh通信確認 ## pi103 - 通信可![](https://hackmd.io/_uploads/SkKcsvkXT.png) - 通信可![](https://hackmd.io/_uploads/ry7f6Pkm6.png) ## pi104 - 通信可![](https://hackmd.io/_uploads/Skak3P1Qa.png) - 通信不可![](https://hackmd.io/_uploads/r1xuavkma.png) ### パワーマネジメント - ![](https://hackmd.io/_uploads/SkzE-Ok76.png) ## pi105 - 通信不可![](https://hackmd.io/_uploads/Sk8HnD17p.png) - 通信不可![](https://hackmd.io/_uploads/HJUiTvymT.png) ``` ssh通信timeout問題 https://white-sesame.jp/archives/blog/2484 ## 1108 #### やること 転送コマンドを使ってみる * scp・・・ファイル転送 ``` scp ファイル名 ラズベリーパイのユーザー名@IPアドレスorホスト名:ディレクトリ/ ``` https://raspi-school.com/scp/ https://igarashi-systems.com/sample/translation/raspberry-pi/remote/remote-rsync.html https://raspi-katsuyou.com/index.php/2020/07/11/15/24/17/910/ ##### ラズパイのコマンド一覧 https://monomonotech.jp/kurage/raspberrypi/linux_command.html ディレクトリ移動 ![image](https://hackmd.io/_uploads/rJvYTAW46.png) ![image](https://hackmd.io/_uploads/BJKpa0-Na.png) * ファイルやディレクトリの情報表示 ``` # 例1:現在のディレクトリの全ファイルの名前のみを表示 ls # 例2:現在のディレクトリの全ファイルの詳細情報を表示 ls -l ``` ## 実行手順 1. sshが使えるラズパイを2つ用意する 今日使うラズパイは以下の通り |ラズパイの名前|pw|送受信| |---|---|---| |pi103berry|pi103|送信側| |pi104berry|pi104|受信側| 2. 一つをを送信側A,もう片方を受信側Bとして,AからBへファイルを送るようにしたい。 3. 送るためのファイルをAのデスクトップに作成する。 今回は自分の名前のtextファイルをデスクトップに作成 ![image.png](https://hackmd.io/_uploads/HJi9sju7a.png) ![image.png](https://hackmd.io/_uploads/S1aUqjd7p.png) ![image.png](https://hackmd.io/_uploads/SJKt3idQT.png) 4. scpコマンドでBのデスクトップにファイルを転送する。 https://kojimanotech.com/2018/05/28/50/#outline__2 ![image.png](https://hackmd.io/_uploads/ByreZn_Xp.png) ``` scp+空白+送りたいファイル(フルパス)+空白+送り先のIPアソレス(もしくはホスト名)+:+保存したいディレクトリ(フルパス) ``` ![image.png](https://hackmd.io/_uploads/rygrM3dXp.png) 5. Bのデスクトップを確認して,ファイルが送られているか確認する。 ```markmap # ssh通信確認_通信側と受信側は使える状態か ## 送受信確認済み_受信側にファイルを作成できるか ### 受信側にファイルを作成できるか #### ファイル作成済み_SCPでファイルを送信できるか #### a ### a #### a #### a ## 使えない状態 - 通信可![](https://hackmd.io/_uploads/SkKcsvkXT.png) ``` # 11/15 ## 今日やること rsyncを使ってみる * rsyncとは・・・ファイルの同期(変更されたファイルのみを転送し、大量のデータを効率的に同期する)コマンド ![image](https://hackmd.io/_uploads/rJoEpkf4T.png) ### 手順 1. デスクトップにあるネットワーク実習フォルダ内に自分の名前のファイルを二つ作る。 無印のファイルの方に適当なテキストファイルを作成しておく。 sato のところは自分のフォルダ名に変えること! * ディレクトリの作成コマンド ``` mkdir 作りたいファイル ``` * ファイルの作成コマンド ``` touch 作りたいファイル名 ``` ファイル構成 ```markmap # home/pi/ネットワーク実習 ## sato ### A.txt ### B.txt ## sato2 ``` 2. rsyncコマンドを実行する。とりあえず以下のコードを実行してみる ``` rsync -r sato/ sato2 ``` 3. 自分の名前の無印フォルダからフォルダ2にテキストファイルが転送されているか確認する。 * ディテレクトリ内の確認 ``` ls ``` * ディレクトリを一つ戻る ``` cd .. ``` * ディレクトリの移動 ``` cd ./移動したいディレクトリ ``` * ディレクトリ・ファイルの削除 ``` rm -r ディレクトリ名・ファイル名 ``` ![image](https://hackmd.io/_uploads/rkqEjJGNa.png) ![image](https://hackmd.io/_uploads/rJaq9kMET.png) ``` rsync -avzr -e ssh ネットワーク実習 /pi@192.168.10.104:home/ ``` * rsync データ同期するよっていうコマンド * -avzr おまじない * -e ssh ssh通信するよっていうコマンド * ネットワーク実習 / 送るディレクトリ。/を付けたらディレクトリ内を送る/がないと * pi@192.168.10.104: 転送先のIP * home/ 転送先のディレクトリ # 11/22 ## 今日やること scpを使って自分のPCとラズパイ間でデータを送受信する ### 手順 #### 自分のPCからラズパイにファイルを転送 1. 自分のPCのデスクトップ(*どこでもよい)に転送用のファイルを用意する(例ではtestsato)。 ![image](https://hackmd.io/_uploads/rkP0Imi46.png) 2. 転送用のファイルの上でSHIFT+右クリックをすると図のようなポップアップが出てくる ![image](https://hackmd.io/_uploads/ByJ_wmi4p.png) 3. 「パスのコピー」をクリックすると今選択したファイル(testsato)のフルパスが得られる。 4. windowsPowerShellを開いてscpコマンドを実行する。 *今回はPC→ラズパイにデータを送るだけなのでsshはしなくてよい。sshでラズパイに入っている人はexitで解除 ``` scp+空白+送りたいファイルのフルパス+空白+pi@+送り先のラズパイのIPアドレス+:+ファイルが置かれる場所のパス ``` サトウのPCで転送した場合は以下の通り。 ``` scp "C:\Users\kyohei\Desktop\testsato.txt" pi@192.168.10.103:/home/pi ``` #### ラズパイから自分PCにファイルを転送 1. ssh通信したラズパイに転送用のファイルを用意する(例ではtest.txt)。 ![image](https://hackmd.io/_uploads/H1_1CQo4T.png) 2. 転送用ファイルのパスを確認する。 ディレクトリのフルパス表示 ``` pwd ``` 3. ssh通信を解いて自分のPC上でscpコマンドを実行する。 ``` scp+空白+送信元のラズパイのIPアドレス+:+送られるファイルのフルパス+空白+ファイルが置かれる場所のパス(自分のPC) ``` サトウのPCで転送した場合は以下の通り。 ``` scp pi@192.168.10.103:/home/pi/test.txt /"C:\Users\kyohei\Desktop\" ``` # 12/13 ### ラズパイとリスポットをどうにかつなげる ![image](https://hackmd.io/_uploads/ByodZqB86.png) ![image](https://hackmd.io/_uploads/B1dEM5SLT.png) ![image](https://hackmd.io/_uploads/BJ2eQ9SUT.png) # 12/20 ### Raspberry Pi インストール |使用者名|ラズパイのホスト名|ユーザー名|PW|ipアドレス| |---|---|---|---|---| |佐藤(例)|atef42c3-g|1257e7d|あいうえお|192.0.0.0| |坂田翔吾|raspberry0123|syosy|syosy|192.168.10.107 |川口緋莉|raspberry11|owner|risshouniv|192.168.10.105 |前川空飛|raspberry12|owner|risshouniv|192.168.10.111 |福永裕子|raspi20|fuku|201h1|192.168.10.112| |阿部みう|raspi88|muu|201h8|192.168.10.113 |緒方陽紀|rasberrypi0420|ohgrtk15|Ogthrk15|192.168.10.108 |ルーターの名前|pw| |---|---| |aterm-ef42c3-g|1257e7d013cab| osバージョンの確認 https://qiita.com/Colours/items/f38aac187c5ddc8f879e ipアドレスの固定化 https://mugeek.hatenablog.com/entry/2019/05/27/230256 パスワードの替え方 https://hardsofttalk.seesaa.net/article/202105article_4.html # 1/10 ## 今日やること * 前回設定した自分のラズパイに入れるか確認 * ipconfigで自分のPCのIPを調べましょう |名前|自分のPCのIP| |---|---| |太田|192.168.10.114| |阿部|192.168.10.115| |坂田|192.168.10.104| |緒方|192.168.10.106| |福永|192.168.10.107| |川口|192.168.10.113| * wifiが繋がるか確認 * モジュールのimportができるか確認 ======================= ↑ここまで出来たら * 代表者一人に対物センサをつけてもらい,ssh通信を使って自分のラズパイでセンサ値を読み込めるようにする ルータの不調? - ルータの[HP](https://www.aterm.jp/product/atermstation/product/warpstar/wg1800hp3/) - Wi-Fi接続台数※1※2 18台 利用人数※1 6人 matplotlibのインポート https://qiita.com/Morio/items/d75159bac916174e7654 import時のパスのエラー https://www.exceedsystem.net/2020/09/29/1321/ Numpyのエラー https://numpy.org/devdocs/user/troubleshooting-importerror.html#check-environment-variables libopenblasを入れた(太田) ``` $ sudo apt install libopenblas-dev ``` ## 1/17 ### 今日やること * モジュールのimport(matplotlib) * 他人のセンサ値を取得する * センサ値をグラフに描画 #### ルータ接続安定化 ルータの負荷対策のため、ノートPCからは5GHz帯のSSIDで接続してください。(パスワード同じ) |ルーターの名前|pw| |---|---| |aterm-ef42c3-a|1257e7d013cab| WindowsのGet-NetNeighborコマンド - https://learn.microsoft.com/ja-jp/powershell/module/nettcpip/get-netneighbor?view=windowsserver2019-ps - https://atmarkit.itmedia.co.jp/ait/articles/2209/08/news001.html sudo vim /etc/wpa_supplicant/wpa_supplicant.conf network={ ssid="繋げたい無線LANの名前" priority=1           #ネットワークの優先度、大きいほど優先大 key_mgmt=WPA-EAP        #認証方式 ここではWPA2エンタープライズ pairwise=CCMP #暗号化方式 auth_alg=OPEN #認証アルゴリズム WPA/WPA2はOPEN eap=PEAP #EAPメソッド identity="XXXX" #認証用ID(大学サイトのログインID) password="YYYY" #IDのパスワード phase1="peaplabel=0" #外部認証 phase2="auth=MSCHAPV2"  #内部認証 }

    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