kanorimon
BeagleBone Green Wireless(以下BBGW)で行った初期設定をまとめる。
Getting Started
beagleboard.orgのGetting Startedを実行する。
Windowsで、USBドライバのインストールがエラーになる場合は、テストモードに変更するとインストール可能(参考)。
既存のWiFiに接続する
Cloud9IDE、または、Teratermなどのターミナルで、BBGWにインストールしたDebianに接続し、/etc/network/interfacesに書かれている以下のコマンドを実行する。
debian@beaglebone:~/$ cat /etc/network/interfaces ~略~ ##connman: WiFi # #connmanctl #connmanctl> tether wifi off #connmanctl> enable wifi #connmanctl> scan wifi #connmanctl> services #connmanctl> agent on #connmanctl> connect wifi_*_managed_psk #connmanctl> quit ~略~
debian@beaglebone:~/$ connmanctl
connmanctlをインタラクティブモードで起動する。
connmanctl> tether wifi off
テザリングを無効にする。既に無効になっている場合は、以下のエラーが表示されるが問題ない。
Error disabling wifi tethering: Already disabled
connmanctl> enable wifi
WiFiを有効にする。既に有効になっている場合は、以下のエラーが表示されるが問題ない。
Error wifi: Already enabled
connmanctl> scan wifi
WiFiをスキャンする。
connmanctl> services
WiFiの一覧を表示する。
以下のような一覧が表示されるので、使用したいWiFiが表示されているか確認する。
*AO MyWifiNetwork1 wifi_abcdef123456_1234567890abcdefgh_managed_psk MyWifiNetwork2 wifi_abcdef123456_9876543210zyxwvuts_managed_psk
connmanctl> agent on
エージェントを登録する。
connmanctl> connect wifi_*_managed_psk
servicesで確認したWiFiのうち、使用したいWiFiのwifi_*_managed_pskをconnectの引数として指定する。
SSIDの指定ではないので注意。
パスワードで保護されている場合は、コマンドを実行した後にパスワードを聞かれるので入力する。
connmanctl> quit
connmannctlを終了する。
pingなどで疎通確認を行い、問題がなければ完了。
APのSSID/パスワードを変更する
BBGWのワイヤレスチップはWiLink8で制御されているので、wl18xxの設定ファイルを変更する必要がある。
wl18xxの設定ファイルは、/etc/default/bb-wl18xxなので、このファイルを編集する。
debian@beaglebone:~/$ cat /etc/default/bb-wl18xx # TETHER_ENABLED: Whether or not to run the /usr/bin/bb-wl18xx-tether daemon; set to no to disable. TETHER_ENABLED=yes # USE_CONNMAN_TETHER: Whether or not to just use connman tether inteface; set to no to disable. USE_CONNMAN_TETHER=no # USE_WL18XX_IP_PREFIX: default IP block of SoftAP0 interface USE_WL18XX_IP_PREFIX="192.168.8" # USE_WL18XX_MAC_ADDRESS: use custom mac address, for when work wifi starts sending deauthentication packet spam. #USE_WL18XX_MAC_ADDRESS="EC:XX:XX:B:XX:XX" # USE_PERSONAL_SSID: set custom ssid USE_PERSONAL_SSID="BeagleBone" # USE_PERSONAL_PASSWORD: set ssid password USE_PERSONAL_PASSWORD="BeagleBone" # USE_GENERATED_DNSMASQ: use generated version of /etc/dnsmasq.d/SoftAp0; set to no so user can modify /etc/dnsmasq.d/SoftAp0 USE_GENERATED_DNSMASQ=yes # USE_GENERATED_HOSTAPD: use generated version of /etc/hostapd.conf; set to no so user can modify /etc/hostapd.conf USE_GENERATED_HOSTAPD=yes # USE_APPENDED_SSID: appends mac address after SSID (aka -WXYZ, BeagleBone-WXYZ) USE_APPENDED_SSID=yes
このファイルのうち、以下の設定を変更することで、任意のSSID/パスワードを設定することができる。
USE_PERSONAL_SSID
SSIDを設定する。
USE_PERSONAL_PASSWORD
パスワードを設定する。
USE_APPENDED_SSID
SSIDの末尾にMACアドレスを付加するか否かの設定をする。
noの場合、MACアドレスを付加しない。
yesの場合、MACアドレスを付加する。複数のBBGWのAPを同時に使う場合にはyesにする。
ファイルを保存した後、再起動すると設定が反映される。
なお、/etc/hostapd.confを自分で編集したい場合は、USE_GENERATED_HOSTAPDをnoにする。