Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mihini-dev] RE : Mihini on Arduino Yun

Hi Anurag,


That's a good work you've already done in you set up on Mihini :)
Here are some answers to your questions:

1
Porting folder for RaspberryPi contains getdeviceid function in porting/raspberrypi-linaro/agent/platform.lua
This function is used to retrieve an unique ID for the device, especially used when Mihini agent communicates with an M2M server.
I don't know much on Arduino Yun, but it is likely that the data used for RaspberryPi unique ID (/proc/cpuinfo, field "Serial") is not available for Yun (you can check).
Then it's is up to you to find a unique ID for your device, for example the HWaddr of some network interface can be a good start.

You can keep most of the other things from  RaspberryPi porting folder?
(FYI Files in porting/raspberrypi-linaro/agent/system are very likely to be nonfunctional files for (almost deprecated) network management functions).

2
Mihini uses a Lua 5.1 runtime with some modifications (especially some modifications introduced in Lua 5.2), so you should not try replacing lua/luac files used in Mihini.
Mihini embeds this specific Lua runtime and it should not try to use existing Lua runtime on the device.
Moreover Mihini doesn't request you to replace existing lua/luac execetables, I have both Lua runtime on my development PC.
I think you should just keep what is built in Mihini (and if you ended up not using Mihini packages, you may not need to explicitly build lua/luac), and see how that's working.

3
Yes, you can skip make package step if you want to.
It is mainly provided to help Mihini installation/integration on the target.
All you need to copy on target is in the "runtime" folder of the build folder generated by build.sh.


Regards,

Laurent.

________________________________________
De : mihini-dev-bounces@xxxxxxxxxxx [mihini-dev-bounces@xxxxxxxxxxx] de la part de Anurag Chugh [lithiumhead@xxxxxxxxx]
Date d'envoi : dimanche 12 janvier 2014 20:51
À : mihini-dev@xxxxxxxxxxx
Objet : [mihini-dev] Mihini on Arduino Yun

Hi guys,

I am trying to cross compile Mihini for Arduino Yun
Arduino Yun runs OpenwRT and has a MIPS processor.

1. Getting the tool chain
Many of the TP-LINK routers have the exact same processor.
So getting the cross tool chain installed was easy.
I have documented it here:
http://www.electronicsfaq.com/2013/11/helloworld-on-tp-link-tl-wr740n.html

I was able to cross compile a helloworld.c application using this tool chain and execute it successfully on my Yun.

I used an Ubuntu PC for cross compilation.

2. Pre-requisites
I had to install git and cmake on my ubuntu box (sudo ap-t get install cmake git)

used git to fetch the repository:
git clone git://git.eclipse.org/gitroot/mihini/org.eclipse.mihini.git

3. CMake file

I added a file named toolchain.yun-openwrt.cmake to the ~/org.eclipse.mihini/cmake
The contents of this file are:

# this one is important
SET(CMAKE_SYSTEM_NAME Linux)
#this one not so much
#SET(CMAKE_SYSTEM_VERSION 1)

# specify the cross compiler
set( CMAKE_C_COMPILER mips-openwrt-linux-uclibc-gcc )
set( CMAKE_CXX_COMPILER mips-openwrt-linux-uclibc-g++ )

# where is the target environment
set( CMAKE_FIND_ROOT_PATH /home/anurag/openwrt/OpenWrt-SDK-ar71xx-for-linux-i486-gcc-4.6-linaro_uClibc-0.9.33.2/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/ )

set( CMAKE_SYSTEM_PROCESSOR mips )

# search for programs in the build host directories
#SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
#SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
#SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

SET(DEFAULT_BUILD true)

4. porting folder

I make a copy of porting/raspberrypi-linaro directory for my yun target by executing the following command ~/org.eclipse.mihini/porting:

cp -avr raspberrypi-linaro/ yun-openwrt/

5. build.sh

I executed ./bin/build.sh -t yun-openwrt and it worked without any errors

6. What should I do next?

I want to execute the commands:
$ make lua luac
$ make modbus_serial
$ make package

But I have the following questions:

 1.  I simply cloned the raspberrpi porting folder, I am sure some stuff needs to be changed there for Arduino Yun, where do I start?
 2.  Arduino Yun already has lua and luac installed, I dont want to package that into my Mihini install package, But when I execute "make package" it will complain about those being missing, how do I take care of that? By modifying the makefile? how will this affect installation when mihini doesnt find lua/luac in the usual location on Arduino Yun
 3.  Can i skip the "make package" step and take the folder generated by build.sh and copy it to Arduino Yun? Yun already has lua/luac installed, what must I change to get it to work this way by simply copying? what folders do I copy?
 4.  Any suggestion on how to go about doing this?

Anurag

Back to the top