OpenWrt for Arduino Yun cheat sheet: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 74: | Line 74: | ||
:node, node-serialport は純正パッケージで。 (node-serialport はエラーがでるので対策考える...) | :node, node-serialport は純正パッケージで。 (node-serialport はエラーがでるので対策考える...) | ||
:rng-tools は純正パッケージで。 | :rng-tools は純正パッケージで。 | ||
:v8m-rb はコンパイルエラーになるが パッケージの patch に '-fno-strict-overflow'. 追加すればよい。 | :v8m-rb はコンパイルエラーになるが パッケージの patch に '-fno-strict-overflow'. 追加すればよい。(悪影響あるようなので別途対策する) | ||
kernel コンフィグレーションで必須な項目 | kernel コンフィグレーションで必須な項目 |
Revision as of 16:25, 4 February 2016
Arduino Yun の Atheros AR9331 で稼働する OpenWrt が、LLC 版 OpenWrt-Yun も Linino もカーネルやパッケージが古くていろいろ残念。 OpenWrt の最新版(trunk)との同期がとれるかをメモ。
すでにある Chaos Calmer 15.05 版 OpenWrt-Yun
Arduino Yun フォーラムで発見した RedSnake64 さんの実装。
RedSnake64版 OpenWrt-Yun:
https://github.com/RedSnake64/openwrt-yun ChaosCalmer_v1.2
- 人柱で導入してみた。mDNS がつかえず .local でアクセスできなかった。IP 指定で設定まではいけたがいったん実験終了。(avahi をホゲる)
- これをもとにして OpenWrt trunk でつかえる Arduino Yun package つくることにする。
本家 OpenWrt の Yun Profile を調査する
OpenWrt Project には、すでに Arduino Yun の Profile がある。
target/linux/ar71xx/generic/profiles/arduino.mk ar71xx: add Arduino Yun
https://github.com/openwrt/packages/tree/master/utils/yunbridge yunbridge
- Arduino YUN bridge library が取り込まれている。
OpenWrt snapshot images:
https://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/ https://downloads.openwrt.org/snapshots/trunk/ar71xx/generic/packages/ openwrt-ar71xx-generic-yun-16M-squashfs-sysupgrade.bin
- 時々ビルドに失敗して snapshots から消えてしまうようだ。一週間ぐらい気長に待つ。
- この System Image は Arduino Yun のハードウェアは対応してるが、Yun 独自のソフトウェアは組み込まれていない。
git.openwrt.org Git - openwrt trunk tree
- OpenWrt 本体とコアなパッケージのレポジトリ。
https://github.com/openwrt/packages https://github.com/openwrt/luci https://github.com/openwrt-routing/packages https://github.com/openwrt/telephony https://github.com/openwrt/targets https://github.com/openwrt-management/packages
- 本家のオプションパッケージは github で管理するようになっている。
Where to get packages OpenWrt Wiki
OpenWrt-Yun で必要なもの
https://github.com/RedSnake64/openwrt-arduino-packages/tree/for-15.05
- RedSnake64版 arduino package
https://github.com/arduino/openwrt-packages-yun/tree/master/arduino
- LLC版 arduino package
Arduino OpenWrt Yún packages:
avrdude *
cpu-mcu-bridge *
cwiid
luci-app-arduino-webpanel
node *
node-bleno
node-noble
node-serialport *
node-socket.io
node-socket.io-client
node-socket.io-client-legacy
node-socket.io-legacy
node-sqlite3
node-ws
rng-tools *
spacebrew
temboo
uSDaemon
v8m-rb *
yun-conf
yun-scripts
- avrdude は "packages/utils/avrdude" に純正パッケージがあるが、Yun 用の avrdude.conf をもつこのパッケージを使用する。
- cpu-mcu-bridge は純正パッケージの yunbridge と重なるが互換性をかんがえるとこっちにする。
- node, node-serialport は純正パッケージで。 (node-serialport はエラーがでるので対策考える...)
- rng-tools は純正パッケージで。
- v8m-rb はコンパイルエラーになるが パッケージの patch に '-fno-strict-overflow'. 追加すればよい。(悪影響あるようなので別途対策する)
kernel コンフィグレーションで必須な項目
CONFIG_TARGET_ar71xx=y
CONFIG_TARGET_ar71xx_generic=y
CONFIG_TARGET_ar71xx_generic_Yun=y
CONFIG_IMAGEOPT=y
CONFIG_PREINITOPT=y
CONFIG_TARGET_PREINIT_SUPPRESS_STDERR=y
CONFIG_TARGET_PREINIT_TIMEOUT=2
# CONFIG_TARGET_PREINIT_SHOW_NETMSG is not set
# CONFIG_TARGET_PREINIT_SUPPRESS_FAILSAFE_NETMSG is not set
CONFIG_TARGET_PREINIT_IFNAME=""
CONFIG_TARGET_PREINIT_IP="192.168.1.1"
CONFIG_TARGET_PREINIT_NETMASK="255.255.255.0"
CONFIG_TARGET_PREINIT_BROADCAST="192.168.1.255"
CONFIG_INITOPT=y
CONFIG_TARGET_INIT_PATH="/bin:/sbin:/usr/bin:/usr/sbin"
CONFIG_TARGET_INIT_ENV=""
CONFIG_TARGET_INIT_CMD="/sbin/init"
CONFIG_TARGET_INIT_SUPPRESS_STDERR=y
CONFIG_VERSIONOPT=y
CONFIG_VERSION_DIST="OpenWrtYun"
CONFIG_VERSION_NICK="Bleeding Edge"
CONFIG_VERSION_NUMBER=""
CONFIG_VERSION_REPO="http://downloads.openwrt.org/snapshots/trunk/%S/packages"
CONFIG_VERSION_MANUFACTURER=""
CONFIG_VERSION_MANUFACTURER_URL=""
CONFIG_VERSION_PRODUCT=""
CONFIG_VERSION_HWREV="1.0"
CONFIG_VERSION_FILENAMES=y
CONFIG_PER_FEED_REPO=y
CONFIG_PER_FEED_REPO_ADD_DISABLED=y
CONFIG_PER_FEED_REPO_ADD_COMMENTED=y
CONFIG_FEED_packages=y
CONFIG_FEED_luci=y
CONFIG_FEED_routing=y
CONFIG_FEED_telephony=y
CONFIG_FEED_management=y
CONFIG_FEED_arduino=y
# CONFIG_SMIMEOPT is not set
CONFIG_OPKGSMIME_PASSPHRASE=y
CONFIG_PACKAGE_avrdude=y
CONFIG_PACKAGE_cpu-mcu-bridge=y
CONFIG_PACKAGE_python-cwiid=m
CONFIG_PACKAGE_libcwiid=m
CONFIG_PACKAGE_luci-app-arduino-webpanel=y
CONFIG_PACKAGE_node=m
CONFIG_PACKAGE_node-bleno=m
CONFIG_PACKAGE_node-noble=m
CONFIG_PACKAGE_node-serialport=m
CONFIG_PACKAGE_node-socket.io=m
CONFIG_PACKAGE_node-socket.io-client=m
CONFIG_PACKAGE_node-socket.io-client-legacy=m
CONFIG_PACKAGE_node-socket.io-legacy=m
CONFIG_PACKAGE_node-sqlite3=m
CONFIG_PACKAGE_node-ws=m
CONFIG_PACKAGE_rng-tools=y
CONFIG_PACKAGE_spacebrew=y
CONFIG_PACKAGE_temboo=y
CONFIG_PACKAGE_uSDaemon=y
CONFIG_PACKAGE_v8m-rb=m
CONFIG_PACKAGE_yun-conf=y
CONFIG_PACKAGE_yun-scripts=y
CONFIG_PACKAGE_libavahi-client=y
# CONFIG_PACKAGE_libavahi-compat-libdnssd is not set
CONFIG_PACKAGE_libavahi-dbus-support=y
# CONFIG_PACKAGE_libavahi-nodbus-support is not set
CONFIG_PACKAGE_avahi-autoipd=m
CONFIG_PACKAGE_avahi-daemon-service-http=m
CONFIG_PACKAGE_avahi-daemon-service-ssh=m
CONFIG_PACKAGE_avahi-dbus-daemon=y
CONFIG_PACKAGE_avahi-dnsconfd=y
# CONFIG_PACKAGE_avahi-nodbus-daemon is not set
CONFIG_PACKAGE_avahi-utils=y
CONFIG_PACKAGE_nano=y
CONFIG_PACKAGE_curl=y
CONFIG_PACKAGE_wget=y
- いろいろ試してみてから .config はさらす予定。
#DELETE PACKAGES
rm -rf ./package/feeds/packages/avrdude
rm -rf ./package/feeds/arduino/rng-tools
#LINK CUSTOM PACKAGES
ln -s ../../../feeds/arduino/avrdude ./package/feeds/packages/avrdude
Python OpenWrt Wiki
python-mini が python-light になってる。
If you are using Chaos Calmer then python-mini package is replaced by python-light package. Currently python package adds a lot of dependencies so we suggest that you don't even try to install full version, unless you have at least 50MB of free space on your flash storage.
RedSnake64 版を fork して、ぼちぼち OpenWrt-Yun 用のパッケージをつくりつつある。
https://github.com/nxhack/openwrt-arduino-packages
OpenWrt-Yun build メモ
おおもとの LLC 版 OpenWrt-Yun
git clone --depth=1 --branch master --single-branch https://github.com/arduino/openwrt-yun.git
RedSnake64 さん版を参考に、できるだけ本家の trunk に近いように工夫して野良ビルド中...
git clone --depth=1 --branch 15.05 --single-branch https://github.com/RedSnake64/openwrt-yun.git
- を参考にして
git clone --depth=1 --branch master --single-branch https://github.com/openwrt/openwrt.git
- 本家をビルド
Ubuntu 14.04 環境でクロスコンパイル。
apt-get update
apt-get install -y git subversion build-essential asciidoc \
fastjar flex gawk libgtk2.0-dev intltool zlib1g-dev \
genisoimage libncurses5-dev libssl-dev ruby sdcc unzip \
bison libboost-dev libxml-parser-perl libusb-dev bin86 \
bcc sharutils openjdk-7-jdk mercurial cvs bzr \
nodejs-legacy curl
apt-get install g++-multilib
apt-get install squashfs-tools
- 出来上がった Image の検証用 (unsquashfs openwrtyun-15.05-ar71xx-generic-yun-16M-squashfs-sysupgrade.bin)
Installing Node.js via package manager | Node.js
- Ubuntu 純正パッケージの nodejs, npm 使うとビルドこける。
https://downloads.openwrt.org/sources/
- パッケージのソースの取得に失敗する場合はここからとって ./dl/ 配下に置いておく。
wget http://pkgs.fedoraproject.org/repo/pkgs/libconfuse/confuse-2.7.tar.gz/45932fdeeccbb9ef4228f1c1a25e9c8f/confuse-2.7.tar.gz
wget http://pkgs.fedoraproject.org/repo/pkgs/avrdude/avrdude-6.1.tar.gz/9db8c25b935d34234b9b1ba16ad55fd5/avrdude-6.1.tar.gz
v8m-rb の patch に '-fno-strict-overflow'. 追加
./feeds.conf.default:
src-git packages https://github.com/openwrt/packages.git
src-git luci https://github.com/openwrt/luci.git
src-git routing https://github.com/openwrt-routing/packages.git
src-git telephony https://github.com/openwrt/telephony.git
src-git management https://github.com/openwrt-management/packages.git
##src-git targets https://github.com/openwrt/targets.git
#src-git oldpackages http://git.openwrt.org/packages.git
#src-svn xwrt http://x-wrt.googlecode.com/svn/trunk/package
#src-svn phone svn://svn.openwrt.org/openwrt/feeds/phone
#src-svn efl svn://svn.openwrt.org/openwrt/feeds/efl
#src-svn xorg svn://svn.openwrt.org/openwrt/feeds/xorg
#src-svn desktop svn://svn.openwrt.org/openwrt/feeds/desktop
#src-svn xfce svn://svn.openwrt.org/openwrt/feeds/xfce
#src-svn lxde svn://svn.openwrt.org/openwrt/feeds/lxde
#src-link custom /usr/src/openwrt/custom-feed
#src-git arduino https://github.com/RedSnake64/openwrt-arduino-packages.git;for-15.05
src-git arduino https://github.com/nxhack/openwrt-arduino-packages.git;for-trunk
- これでビルド実験中...
LLC 版 OpenWrt-Yun の(古い) .config の avahi 系の設定は
CONFIG_PACKAGE_avahi-autoipd=m
CONFIG_PACKAGE_avahi-daemon=y
CONFIG_PACKAGE_avahi-dnsconfd=y
CONFIG_PACKAGE_avahi-utils=y
RedSnake64 さん版に avahi を設定するのは
CONFIG_PACKAGE_avahi-autoipd=m
CONFIG_PACKAGE_avahi-daemon-service-http=m
CONFIG_PACKAGE_avahi-daemon-service-ssh=m
CONFIG_PACKAGE_avahi-dbus-daemon=y
CONFIG_PACKAGE_avahi-dnsconfd=y
# CONFIG_PACKAGE_avahi-nodbus-daemon is not set
CONFIG_PACKAGE_avahi-utils=y
RedSnake64 さん版の build.sh を変更して menuconfig でいろいろ試せるようにする
- 初めてなら (.config がない時) RedSnake64 さん版の config.default を Load してから作業する。
./build.sh:
#!/bin/bash -ex
#FEEDS
./scripts/feeds uninstall -a
rm -rf feeds
./scripts/feeds update -a
./scripts/feeds install -a
#UNINSTALL BROKEN PACKAGES
#./scripts/feeds uninstall aria2 freecwmp libfreecwmp libmicroxml crtmpserver dansguardian
#DELETE PACKAGES
rm -rf ./package/feeds/packages/avrdude
rm -rf ./package/feeds/packages/node-serialport
rm -rf ./package/feeds/packages/node-arduino-firmata
#LINK CUSTOM PACKAGES
ln -s ../../../feeds/arduino/avrdude ./package/feeds/packages/avrdude
ln -s ../../../feeds/arduino/node-serialport ./package/feeds/packages/node-serialport
ln -s ../../../feeds/arduino/node-arduino-firmata ./package/feeds/packages/node-arduino-firmata
make menuconfig
- rng-tools は本家版をつかう。
- aria2 コンパイルコケる。コンパイルオプションでなんとかなるかも。
- freecwmp, libfreecwmp, libmicroxml は git clone できず。
- crtmpserver サイト消滅。
- dansguardian コンパイルコケる。コンパイルオプションでなんとかなるかも。
- v8m-rb のpatch に -fno-strict-overflow 追加。
TO DO
- rc.local
- LLC の openwrt-yun 直下の files ディレクトリ以下を build する直下にもってくる。
- uboot-linino コンパイルエラーとる
- extern inline -> static inline, extern __inline__ -> static inline
- .config 差異
- DISTRIB_TAINTS 意味調査