・PrintPupperのラズパイをあなたのWiFiまたは有線LANに接続し、PC から ssh でコンソールログインする。
・ラズパイのSDカードの boot 領域に wpa_supplicant.conf ファイルを配置することで、モニターやキーボードを繋がずに(ヘッドレス)Wi-Fiへ自動接続できます。接続に関してはラズパイ関連のネット情報を参考にしてください。
・Connect the PrintPupper's Raspberry Pi to your Wi-Fi or wired LAN, then log in to the console via SSH from your PC.
・You can enable automatic Wi-Fi connection without connecting a monitor or keyboard (headless setup) by placing a `wpa_supplicant.conf` file in the boot partition of the Raspberry Pi's SD card. please refer to online resources regarding Raspberry Pi connectivity for details.
・配布しているSDカードイメージの username/password は pi/pi です。
・The username/password for the distributed SD card image is pi/pi .
- Example -
PS C:\Users\xxxx> ssh pi@192.168.11.xx
pi@192.168.11.xx's password: pi
Linux printpupper 6.1.21-v7+ #1642 SMP Mon Apr 3 17:20:52 BST 2023 armv7l
...
pi@printpupper:~ $
・Gitリポジトリをアップデートする
・github.com に接続できることを確認
・main 最新版を pull
・再起動
- Example -
pi@printpupper:~ $ cd PrintPupper/
pi@printpupper:~/PrintPupper $ ping github.com
PING github.com (20.27.177.113) 56(84) bytes of data.
64 bytes from 20.27.177.113 (20.27.177.113): icmp_seq=1 ttl=117 time=9.47 ms
64 bytes from 20.27.177.113 (20.27.177.113): icmp_seq=2 ttl=117 time=12.5 ms
... CTRL+C stop
pi@printpupper:~/PrintPupper $ git pull -v
...
From https://github.com/r9kawai/PrintPupper
= [up to date] main -> origin/main
Already up to date.
...
pi@printpupper:~ $ sudo reboot
...
・ロボットのpythonソースコードを修正し、実機でデバッグしたい場合は以下を参考にして下さい。
・If you wish to modify the robot's Python source code and debug it on the actual hardware, please refer to the following.
・自動実行の robot.service を停止させる。pigpiod デーモンを手動実行する。
・Stop the robot.service that runs automatically. Manually start the pigpiod daemon.
- Example -
sudo systemctl stop robot
sudo pigpiod
・PrintPupper/src 以下のソースコードに所望の編集を加える。
・コマンドからデバッグ実行開始、ロボットの動作を実機で検証する。USBジョイスティックで操作する。CTRL+C で停止させる。
・Make the desired edits to the source code under PrintPupper/src .
・Start debugging from command and verify the robot's movements on the actual hardware. Control it using a USB joystick. Stop the process with Ctrl+C.
- Example -
pi@printpupper:~ $ cd ~/PrintPupper/src/
pi@printpupper:~ $ sudo python3 run_robot.py
GPIO LED GREEN [ 0pin ]
GPIO LED BLUE [ 1pin ]
GPIO 100Hz 10000range 1500neutral
GPIO FR-[ 23pin 24pin 25pin ]
GPIO FL-[ 17pin 27pin 22pin ]
GPIO BR-[ 16pin 20pin 21pin ]
GPIO BL-[ 05pin 06pin 19pin ]
Creating joystick listener...Done.
Robot Waiting L1 button to activate robot
robo > joystick connect.
... CTRL+C stop
・ソースコード編集とデバッグを繰り返す。
・Iterate between source code editing and debugging.
・ソースコードを WindowsPC から編集し易くするために、ラズパイに Samba を入れる
※この設定は参考です。セキュリティに対する配慮はまったくされていません。
・Install Samba on the Raspberry Pi to make it easier to edit source code from a Windows PC.
*Note: This configuration is for reference only; no security considerations have been taken into account.
- Example -
sudo apt update
sudo apt install samba -y
sudo vi /etc/samba/smb.conf
・smb.conf の末尾に以下のセクションを追記する
・Append the following section to the end of smb.conf.
###
[pi]
comment = Welcome to pi Server
path = /home/pi
browseable = yes
wriable = yes
guest ok = no
force create mode = 0666
force directory mode = 0777
read only = no
create mask =0777
directory mask = 0777
###
・パス簡易設定し、Sambaデーモンを再起動する。
・Configure a simple password and restart the Samba daemon.
sudo smbpasswd -a pi
< pi
sudo service smbd restart
・WindowsPC のエクスプローラから \\192.168.11.xx\pi を開くと、ソースコードを容易に編集できるようになります。
・Opening \\192.168.11.xx\pi from WindowsPC Explorer allows you to easily edit the source code.