2015年11月16日月曜日

Arduino Yun Mini 使い方

Arduino Yun Miniの写真見てかっこいいじゃん!

と思って購入したんですが、Edisonよりデカイので若干テンション下り目です。。。

が、とりあえずセットアップしてみないとお金の無駄遣いなのでセットアップ”だけ”してみます。
手始めとしては、Arduino S.r.lのArduino Yun MIniホームページを開くとこから始めましょう。

ページを開くと以下のような表記箇所があるので、

Go to the Arduino Yun mini LABS Page
You can find resources, tutorials, sample projects related to everyday life with your Arduino Yun mini 

そのタイトル部分、”Go to the Arduino Yun mini LABS Page”のリンクを開くとYun miniのLABSのページへと移動します。

Arduino Yun Mini is a breadboard PCB developed with ATmega 32u4 MCU and QCA MIPS 24K SoC CPU operating up to 400 MHz.
You can find the ATmega32u4 datasheet here .
Qualcomm Atheros CPU supports a Linux distribution based on OpenWRT named Linino. The board has built- in WiFi ( IEEE 802.11b/g/n operations up to 150Mbps 1x1 2.4 GHz ) supports 20 digital input/output pins (of which 7 can be used as PWM outputs and 12 as analog inputs), a 16 MHz crystal oscillator, a micro USB connector, an ICSP header, two reset buttons and one user button.
The Arduino Yún Mini is similar to the Leonardo in that the ATmega32u4 has built-in USB communication, eliminating the need for a secondary processor. This allows the Arduino Yún Mini to appear to a connected computer as a mouse and keyboard, in addition to a virtual (CDC) serial / COM port.

云々と表示されている下部にある”Getting Started with Arduino Yun Mini”を開いてセットアップを進めます。

詳細はガイドに従ってもらうのが良いのですが、簡単に手順だけまとめておきます。
とりあえずは、USB⇔micro-USBのケーブルで母艦側となるPCとArduino Yun Miniを接続してみましょう。

WiFiのネットワークの接続先リストに"Linino-xxxxxxx"(xxxxxxxはwlanのmacアドレス)と表記されたアクセスポイントが表示されたら、母艦側からアクセスポイントへ接続します。

※いつまで待っても表示されない場合や、ネットワーク環境の変更によりアクセス出来なくなった場合は、Yun miniのUSBポートと反対側の裏面にWiFi Resetボタンがあるので5〜30秒長押ししてみて下さい。

ブラウザから、http://linino.localもしくはhttp://192.168.240.1でアクセスします。

Linino
Welcome to your Arduino Yun-Mini . Please enter password to access the web control panel

  • Please be sure you have cookies enabled before proceeding.

上の様な表示のあるページが開きパスワードを聞かれるので"doghunter"と入力してログインします。

ログインすると下の様にYun miniの情報が表示されたTOPページが開きます。

WELCOME TO LININO, YOUR ARDUINO YUN-MINI

WIFI (WLAN0) CONNECTED

Address 192.168.240.1Netmask 255.255.255.0MAC Address XX:XX:XX:XX:XX:XXReceived 38.03 KBTrasmitted 143.40 KB

WIRED ETHERNET (ETH1) DISCONNECTED

MAC Address XX:XX:XX:XX:XX:XXReceived 0.00 BTrasmitted 0.00 B

SYSTEM

System Type Atheros AR9330 rev 1Machine Arduino Yun-MiniBogoMIPS 265.42Kernel Version 3.3.8Local Time Wed Oct 28 21:19:28 2015Uptime 123 secondsLoad Average 94 %

MEMORY

Total Available 61324Free 25652

ページ上部の”CONFIGURE"をクリックして、設定画面に移動します。


For more advanced network configuration features, see the advanced configuration panel (luci)

  •  Refresh
  •  
    REST APIs allow you to access your sketch from the web, sending commands or exchanging configuration values.
    If your board is on a public network, or controlling sensitive equipment, or both, we recommend you leave the REST API password protected.
WebPanel GUI originally developed by Arduino

ここでは、必要最小限(たちまち使うには必要十分です。)の設定が行えます。
より詳細な設定を行いたい場合は、advanced configuration panel (luci)を選択して設定を行って下さい。
設定を終えたら下部にある"CONFIGURE & RESTART"を押して設定を確定します。

※ここまでの作業はシリアル通信でコマンドラインでも設定可能です。UIなんぞ必要ない!って漢な方はブラウザでの作業は不要です。

設定が完了したらSSHでログインします。
TeraTermでもPuTTYでもターミナルでも好きなの使っていいです。

ログインするとこんな感じになります。

Terminal -- bash -- 80x24
BusyBox v1.19.4 (2015-10-28 23:29:54 CET) built-in shell (ash)
Enter 'help' for a list of built-in commands.

      ___                   ___                       ___           ___   
     /\__\      ___        /\__\          ___        /\__\         /\  \  
    /:/  /     /\  \      /::|  |        /\  \      /::|  |       /::\  \ 
   /:/  /      \:\  \    /:|:|  |        \:\  \    /:|:|  |      /:/\:\  \
  /:/  /       /::\__\  /:/|:|  |__      /::\__\  /:/|:|  |__   /:/  \:\  \
 /:/__/     __/:/\/__/ /:/ |:| /\__\  __/:/\/__/ /:/ |:| /\__\ /:/__/ \:\__\
 \:\  \    /\/:/  /    \/__|:|/:/  / /\/:/  /    \/__|:|/:/  / \:\  \ /:/  /
  \:\  \   \::/__/         |:/:/  /  \::/__/         |:/:/  /   \:\  /:/  /
   \:\  \   \:\__\         |::/  /    \:\__\         |::/  /     \:\/:/  /
    \:\__\   \/__/         /:/  /      \/__/         /:/  /       \::/  / 
     \/__/                 \/__/                     \/__/         \/__/ 

            _______                     ________        __
           |       |.-----.-----.-----.|  |  |  |.----.|  |_
           |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
           |_______||   __|_____|__|__||________||__|  |____|
                    |__| W I R E L E S S   F R E E D O M

root@linino:~#

"linup latest"を使ってシステムを最新にします。
"アップデートすんのんか?"と聞かれるので"y"を入力。

Terminal -- bash -- 80x24
root@linino:~# linup latest

the current branch is lininoIO...

Verifying internet connection...

The current kernel date is : 18 04 2015
Linino OS image date is : 29 10 2015

A new upgrade is available for your system !

Do you want to upgrade your board now ? (y/n)

y

更新の手続きがザーーーっと続いて、
以下のような表示が出ます。

Terminal -- bash -- 80x24
lininoIO-generic-linino-yun-mini-squashfs-sysupgrade.bin: OK


1. Upgrade and keep your current setting #現在の設定を維持してアップグレード
2. Upgrade and revert to default settings #デフォルト設定に戻してアップグレード
0. Exit #設定を中止


Choose : 

最も安全で推奨されるのは、"2. Upgrade and revert to default settings"だと思いますが、私は再設定面倒なので"1. Upgrade and keep your current setting"を選びました。
あとは再起動待ちです。

再起動したら、Lininoの中を調べてみます。
当たり前ですが、Node.JSは入ってません。"df"の結果はこんな感じ。

Terminal -- bash -- 80x24
root@linino:~# uname -a
Linux linino 3.3.8 #1 Wed Nov 11 12:29:46 CET 2015 mips GNU/Linux
root@linino:~# node -v
-ash: node: not found
root@linino:~# df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
rootfs                    5760       304      5456   5% /
/dev/root                 8960      8960         0 100% /rom
tmpfs                    30664       668     29996   2% /tmp
tmpfs                      512         0       512   0% /dev
/dev/mtdblock3            5760       304      5456   5% /overlay
overlayfs:/overlay        5760       304      5456   5% /
root@linino:~#

パッケージの導入はEdisonと同じく"opkg"です。
まずは、"update"。アップデート後にリストチェックするとインストール可能なパッケージが増えます。

Terminal -- bash -- 80x24
root@linino:~# opkg -v
opkg version 0.1.8
root@linino:~# opkg update
Downloading http://download.linino.org/linino_distro/lininoIO/latest/packages/Packages.gz.
Updated list of available packages in /var/opkg-lists/attitude_adjustment.
Downloading http://download.linino.org/linino_distro/lininoIO/latest/packages/Packages.sig.
Signature check passed.
root@linino:~# opkg list | grep Node.js
node - v0.10.25-2 - Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.
node-muzzley-client - 0.5.1-2 - Node.js package to access serial ports for reading and writing OR Welcome your robotic JavaScript overlords. Better yet, program them!
node-serialport - 2.0.1-1 - Node.js package to access serial ports for reading and writing OR Welcome your robotic JavaScript overlords. Better yet, program them!
root@linino:~#

インストール可能なNode.JSのバージョンはv0.10.25-2ですね。

ガイドの方では、ArduinoIDEをインストールして〜って流れですが、此処では脱線したところで終了します。
セットアップ完了を目指される方はスタートアップガイドを読んで下さい。

1 件のコメント:

  1. Hi, Muzzley just released an arduino YUN library for the CIAO. Look here https://github.com/muzzley/arduino-ciao-muzzley-connector. There's also an example of controlling a door here: https://github.com/muzzley/yun-muzzley-lock

    返信削除