C++ compile:

nano hello.cpp
// 'Hello World!' program
#include <iostream>
int main()
{
  std::cout << "Hello World!" << std::endl;
  return 0;
}
g++  hello.cpp -o hello

root@Arduino:/mnt/sda1# ./hello
./hello: can't load library 'libstdc++.so.6'

opkg update
opkg install libstdcpp

root@Arduino:/mnt/sda1# ./hello
Hello World!

 

Write comment (0 Comments)

Compile and install Lua Module(C API)

Install lua_devel:

cd /usr/local/include
wget -O lua_devel.tar.gz https://www.dropbox.com/s/66zxd9gvdf7lvib/lua_devel.tar.gz?dl=0 --no-check-certificate
tar -xzf lua_devel.tar.gz
rm lua_devel.tar.gz

Download and compile lua-cjson:

cd /mnt/sda1/
wget http://www.kyne.com.au/~mark/software/download/lua-cjson-2.1.0.tar.gz
tar -xzf lua-cjson-2.1.0.tar.gz
cd /mnt/sda1/lua-cjson-2.1.0

gcc -c -O3 -Wall -pedantic -DNDEBUG  -I/usr/local/include -fpic -o lua_cjson.o lua_cjson.c
gcc -c -O3 -Wall -pedantic -DNDEBUG  -I/usr/local/include -fpic -o strbuf.o strbuf.c
gcc -c -O3 -Wall -pedantic -DNDEBUG  -I/usr/local/include -fpic -o fpconv.o fpconv.c
gcc  -shared -o cjson.so lua_cjson.o strbuf.o fpconv.o

Install lua-cjson:

cp cjson.so /usr/lib/lua/

Testing lua-cjson:

nano /mnt/sda1/arduino.lua

#!/usr/bin/lua
-------simple data-------
local tab ={}
tab["arduino"] = "arduino.cc"
--encode json -------
local cjson = require "cjson"
local jsonData = cjson.encode(tab)

print(jsonData) 
-- print result:  {"arduino":"arduino.cc"}

--decode json -------
local data = cjson.decode(jsonData)

print(data.arduino) 
-- print result:  arduino.cc
root@Arduino:/mnt/sda1# chmod 755 arduino.lua
root@Arduino:/mnt/sda1# ./arduino.lua
{"arduino":"arduino.cc"}
arduino.cc

lua-cjson (C-API) V.S. pure lua json module performance boost 1000% to 2000%!

 

Write comment (0 Comments)

Install driver, library, application for Yun.

The freetds-dev is open source library for Sybase and Microsoft SQL server.

wget ftp://ftp.freetds.org/pub/freetds/current/freetds-dev.0.92.812.tar.gz
tar -zxvf freetds-dev.0.92.812.tar.gz
cd  freetds-dev.0.92.812

./configure 
make
make install

Here you need take very long coffee break at stage "make"!

Testing connect to MS SQL Server 

tsql -H192.168.0.111 -p 1433  -U sa -P password
locale is "C"
locale charset is "ASCII"
using default charset "ISO-8859-1"
1> use AdventureWorks2008
2> go
1> SELECT * FROM Person.Address where AddressID=1
2> go
AddressID       AddressLine1    AddressLine2    City    StateProvinceID PostalCode      SpatialLocation rowguid ModifiedDate

Now Yun is able to directly talk to Sybase  and Microsoft SQL server.

Write comment (0 Comments)

Help compile C (sshpass) application:

opkg update
opkg install tar
wget http://pkgs.fedoraproject.org/repo/pkgs/sshpass/sshpass-1.05.tar.gz/c52d65fdee0712af6f77eb2b60974ac7/sshpass-1.05.tar.gz
tar -zxvf sshpass-1.05.tar.gz
cd sshpass-1.05
./configure
make 
make install

Download prebuild sshpass:

cd /bin 
wget https://www.dropbox.com/s/bl6vyhd5jpim6zm/sshpass --no-check-certificate
chmod 755 sshpass

Usage:

sshpass -p "YOUR_PASSWORD" ssh YOUR_USERNAME@SOME_SITE.COM "ls -al"
Write comment (1 Comment)

Subcategories

Expand the Storage at Yun

Languages Supported by Yun

Backup and Recover

Network and Yun

Hardware & Yun

OpenWrt-SDK & Yun