Makefile of luars232:

#############
#
# Copyright (C) 2007-2013 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=luars232
PKG_VERSION:=1.0.1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_FIXUP:=libtool
include $(INCLUDE_DIR)/package.mk
PKG_INSTALL=1
define Package/luars232
  SUBMENU:=Lua
  SECTION:=lang
  CATEGORY:=Languages
  TITLE:=Lua lib for serial communication over rs-232
  DEPENDS:=+lua
endef
define Package/luars232/description
 Lua lib for serial communication over rs-232
endef
TARGET_CFLAGS += -DLUA_USE_LINUX $(FPIC)
define Build/Configure
        $(call Build/Configure/Default, \
        CFLAGS="$(TARGET_CFLAGS)" \
        )
endef
define Build/InstallDev
 $(INSTALL_DIR) $(1)/usr/include
 $(CP) $(PKG_INSTALL_DIR)/usr/include/librs232 $(1)/usr/include/
 $(INSTALL_DIR) $(1)/usr/lib/lua
 $(CP) $(PKG_INSTALL_DIR)/usr/lib/librs232.{a,so*} $(1)/usr/lib/lua/
 $(CP) $(PKG_INSTALL_DIR)/usr/lib/luars232.{a,so*} $(1)/usr/lib/lua/ 
 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/librs232.pc $(1)/usr/lib/pkgconfig/
endef
define Package/luars232/install
 $(INSTALL_DIR) $(1)/usr/lib/lua
 $(CP) $(PKG_INSTALL_DIR)/usr/lib/librs232.so* $(1)/usr/lib/
 $(CP) $(PKG_INSTALL_DIR)/usr/lib/luars232.so* $(1)/usr/lib/ 
 $(CP) $(PKG_INSTALL_DIR)/usr/lib/librs232.so* $(1)/usr/lib/lua
 $(CP) $(PKG_INSTALL_DIR)/usr/lib/luars232.so* $(1)/usr/lib/lua 
endef
$(eval $(call BuildPackage,luars232))
cd /mnt/sda1
wget -O  luars232_1.0.1_ar71xx.ipk https://www.dropbox.com/s/a56jppa64gijtmt/luars232_1.0.1_ar71xx.ipk?dl=0 --no-check-certificate
opkg update
opkg install luars232_1.0.1_ar71xx.ipk
Installing luars232 (1.0.1) to root...
Configuring luars232.

Write comment (0 Comments)

root@Arduino:~# lsusb
...
Bus 001 Device 006: ID 13ee:0001 MosArt

Install software:

opkg update 
opkg install kmod-usb-hid
...
Configuring kmod-input-core.
Configuring kmod-input-evdev.
Configuring kmod-hid.
Configuring kmod-usb-hid.
...

Testing by move at mouse:

cat /dev/input/event1  | hexdump
0000000 5586 1a30 000d 3f1e 0002 0000 ffff ffff
0000010 5586 1a30 000d 3f37 0000 0000 0000 0000
0000020 5586 1a30 000d 5e5d 0002 0000 ffff ffff
0000030 5586 1a30 000d 5e75 0000 0000 0000 0000
0000040 5586 1a30 000d 7d9b 0002 0000 ffff ffff
0000050 5586 1a30 000d 7da9 0002 0001 ffff ffff

Write comment (0 Comments)

OpenWrt-SDK

If you get a message usb.h file missing, you have to install this library:

sudo apt-get install libusb-dev
git clone  https://github.com/sonnyyu/UsbRelay.git
cd UsbRelay
mips-openwrt-linux-uclibc-gcc   -O -Wall  -c usbrelay.c -o usbrelay.o
mips-openwrt-linux-uclibc-gcc  -O -Wall -I${CFLAGS} -c hiddata.c -o hiddata.o
mips-openwrt-linux-uclibc-gcc -L${LDFLAGS} -o usbrelay usbrelay.o hiddata.o -Wl,-rpath-link=${LDFLAGS} -lusb
mips-openwrt-linux-uclibc-strip usbrelay
file usbrelay
usbrelay: ELF 32-bit MSB executable, MIPS, MIPS32 rel2 version 1 (SYSV), dynamically linked (uses shared libs), with unknown capability 0x41000000 = 0xf676e75, with unknown capability 0x10000 = 0x70403, stripped

Write comment (0 Comments)

nano /www/cgi-bin/test.py
#!/usr/bin/python
print "Content-type:text/html\r\n\r\n"
print '<html>'
print '<head>'
print '<title>Hello Word - First CGI Program</title>'
print '</head>'
print '<body>'
print '<h2>Hello Word! This is my first CGI program</h2>'
print '</body>'
print '</html>'
chmod 755 /www/cgi-bin/test.py

View result at "http://192.168.0.102/cgi-bin/test.py"

Hello Word! This is my first CGI program

Write comment (0 Comments)

Subcategories

Expand the Storage at Yun

Languages Supported by Yun

Backup and Recover

Network and Yun

Hardware & Yun

OpenWrt-SDK & Yun