make package/yun-conf/compile make package/yun-scripts/compile make package/luci-app-arduino-webpanel/compile make package/yun-conf/install make package/yun-scripts/install make package/luci-app-arduino-webpanel/install
2016-04-08 DraginoYun Shield
1 2 3 4 5
svn checkout https://github.com/dragino/openwrt-yun.git dragino-yun cd dragino-yun/trunk ./build_image.sh cd openwrt vi feeds.config.default
make menuconfig Base System ---> <*> yun-conf...................................... Custom Yún configurations <*> yun-scripts.......................................... Custom Yún scripts LuCI ---> 3. Applications ---> <*> luci-app-arduino-webpanel............ simplified wifi configuration panel echo"src/gz barrier_breaker http://download.linino.org/dogstick/all-in-one/latest/packages/" >> /etc/opkg.conf opkg install rng-tools --force-depends opkg install gnupg +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ “Not enough random bytes available. Please do some other work to give the OS a chance to collect more entropy! (Need 284 more bytes)” First make sure you have the following available and have the rights to it: ls -l /dev/urandom then execute rngd against it: rngd -r /dev/urandom +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ /etc/init.d/generate_new_gpg_key start
#Apparently Yun uses avrdude linuxgpio, this is suggested by /etc/linino/test_avrdude.sh #run-avrdude wants to edit sys/class/gpio/gpio21/value which does not exist here #Also see http://www.tonylianlong.com/?p=135 #It has modified files for the Arduino IDE and it has the GPG key and gpg binary #They have also a modified /usr/bin/run-avrdude script which is pure genius, it changes linuxgpio to serial programming and if that is all that is required to change makes it trivial to hook up different boards via USB as well: #!/bin/sh #echo 1 > /sys/class/gpio/gpio21/value #avrdude -c linuxgpio -C /etc/avrdude.conf -p m32u4 -U lfuse:w:0xFF:m -U hfuse:w:0xD8:m -U efuse:w:0xFB:m -Uflash:w:$1:i $2 #echo 0 > /sys/class/gpio/gpio21/value #echo “$2” > /s2
Development: the easy way The easiest way to hack the web panel is to copy on your Yún the files you find in this repo, maintaining the folders structure. For example, file usr/lib/lua/luci/controller/arduino/index.lua will go to /usr/lib/lua/luci/controller/arduino/index.lua on your Yún. Then access the webpanel at http://arduino.local/ (where “arduino” is the name of your Yún), properly edit file index.lua and refresh the page to see the changes. Once done, copy the files back to your pc and submit us a pull request, so that everyone can take advantage of the improvements you made. Development: the fast, local but hard way You need a GNU/Linux box and the following tools: subversion, gnupg, lua, make, gcc, wget. On Debian based distros, these are packages subversion, gnupg, lua5.1, liblua5.1-0-dev, build-essential, wget. 参考 https://github.com/arduino/YunWebUI
ubuntu系统设置
1 2 3 4 5 6 7 8 9 10
sudomkdir /etc/arduino cd /etc/arduino sudo wget https://raw.githubusercontent.com/arduino/openwrt-packages-yun/master/arduino/yun-conf/files/etc/arduino/gpg_gen_key_batch sudo gpg --batch --gen-key /etc/arduino/gpg_gen_key_batch sudorm -f /etc/arduino/arduino_gpg.asc sudo gpg --no-default-keyring --secret-keyring /etc/arduino/arduino_gpg.sec --keyring /etc/arduino/arduino_gpg.pub --export --armor --output /etc/arduino/arduino_gpg.asc sudochmod 644 /etc/arduino/arduino_gpg.* svn co http://svn.luci.subsignal.org/luci/branches/luci-0.11 luci cd /home/router-dev/iot-gateway svn co https://github.com/arduino/YunWebUI/trunk yunWebUI
进入openwrt目录
1 2 3 4 5 6
cd /home/router-dev/openwrt/branches/attitude_adjustment/feeds cd luci mkdir applications/arduino cp applications/myapplication/Makefile applications/arduino ln -s /home/router-dev/iot-gateway/yunWebUI/usr/lib/lua/luci applications/arduino/luasrc ln -s /home/router-dev/iot-gateway/yunWebUI/www applications/arduino/htdocs
# zigbeegw-luci cd /home/router-dev/openwrt/branches/attitude_adjustment/package svn co https://github.com/paradislover/zigbeegw-luci/trunk zigbeegw make menuconfig LuCI ---> 3.Applications ---> <*> luci-app-zigbeegw ................ LuCI Support for zigbeegw Kernel modules ---> USB Support ---> <*> kmod-usb-acm <*> kmod-usb-serial <*> kmod-usb-cp210x <*> kmod-usb-pl2303 make package/zigbee/clean make package/zigbee/compile make package/zibgee/install
2015-07-10,13,16,21 OpenWRT下远程调试
1 2 3
#### OpenWRT下远程调试 attitude_adjustment WR703N ``` bash svn co svn://svn.openwrt.org/openwrt/branches/attitude_adjustment
$ tar -xjf OpenWrt-ImageBuilder-ar71xx_generic-for-linux-i686.tar.bz2 $ cd OpenWrt-ImageBuilder-ar71xx_generic-for-linux-i686/ $ make info | grep 703 TLWR703: TP-LINK TL-WR703N $ make image PROFILE=TLWR703 [...] $ ls -l bin/ar71xx/ make image PROFILE=TLWR703 PACKAGES="luci luci-i18n-chinese libstdcpp vsftpd openssh-sftp-server gdb gdbserver"
2015-07-09 OpenWRT下远程调试
OpenWRT下远程调试 attitude_adjustment WR703N
1
svn co svn://svn.openwrt.org/openwrt/branches/attitude_adjustment
############################################## # OpenWrt Makefile for helloworld program # # # Most of the variables used here are defined in # the include directives below. We just need to # specify a basic description of the package, # where to build our program, where to find # the source files, and where to install the # compiled program on the router. # # Be very careful of spacing in this file. # Indents should be tabs, not spaces, and # there should be no trailing whitespace in # lines that are not commented. # ############################################## include $(TOPDIR)/rules.mk # Name and release number of this package PKG_NAME:=helloworld.qq.com/ PKG_RELEASE:=1 # This specifies the directory where we're going to build the program. # The root build directory, $(BUILD_DIR), is by default the build_mipsel # directory in your OpenWrt SDK directory PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) include $(INCLUDE_DIR)/package.mk # Specify package information for this program. # The variables defined here should be self explanatory. # If you are running Kamikaze, delete the DESCRIPTION # variable below and uncomment the Kamikaze define # directive for the description below define Package/helloworld SECTION:=utils CATEGORY:=Utilities TITLE:=Helloworld -- prints a test message endef # Uncomment portion below for Kamikaze and delete DESCRIPTION variable above define Package/helloworld/description If you can't figure out what this program does, you're probably brain-dead and need immediate medical attention. endef # Specify what needs to be done to prepare for building the package. # In our case, we need to copy the source files to the build directory. # This is NOT the default. The default uses the PKG_SOURCE_URL and the # PKG_SOURCE which is not defined here to download the source from the web. # In order to just build a simple program that we have just written, it is # much easier to do it this way. define Build/Prepare mkdir -p $(PKG_BUILD_DIR) $(CP) ./src/* $(PKG_BUILD_DIR)/ endef # We do not need to define Build/Configure or Build/Compile directives # The defaults are appropriate for compiling a simple program such as this one # Specify where and how to install the program. Since we only have one file, # the helloworld executable, install it by copying it to the /bin directory on # the router. The $(1) variable represents the root directory on the router running # OpenWrt. The $(INSTALL_DIR) variable contains a command to prepare the install # directory if it does not already exist. Likewise $(INSTALL_BIN) contains the # command to copy the binary file from its current location (in our case the build # directory) to the install directory. define Package/helloworld/install $(INSTALL_DIR) $(1)/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/helloworld $(1)/bin/ endef # This line executes the necessary commands to compile our program. # The above define directives specify all the information needed, but this # line calls BuildPackage which in turn actually uses this information to # build a package. $(eval $(call BuildPackage,helloworld))
# # Copyright (C) 2015 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # add by : cuiqingwei # define Profile/WRTNODE NAME:=Wrtnode PACKAGES:=\ kmod-usb-core kmod-usb-dwc2 kmod-usb2 kmod-usb-ohci \ kmod-mt76 endef define Profile/WRTNODE/Description Support for WRTnode Board endef $(eval $(call Profile,WRTNODE))