## if appmon_deamon is monitoring the agent, it will restart it automatically within seconds

+

## if not, then launch the agent manually

+

$ ./runtime/start.sh

+

</source>

Now, We are about to install an app available at <em>'/tmp/raspapp'</em>, which will be named <em>'sample'</em>, this application will benefit from <em>autostart</em> ( the last <code>true</code> parameter ).

Now, We are about to install an app available at <em>'/tmp/raspapp'</em>, which will be named <em>'sample'</em>, this application will benefit from <em>autostart</em> ( the last <code>true</code> parameter ).

Revision as of 10:35, 23 July 2013

This page describes a scenario for illustrating the use of Mihini on an Open Hardware Linux-based platform such as BeagleBoard or RaspberryPi.

The goal is to allow someone to take a bare development board and configured it to collect data from the GPIO sensors. All this within an hour!

Right clic on "Applications", then "Connect…", and fill your credential

Step 5 - Create your first application

You could blink a LED, use a touch sensor, measure the temperature and available RAM of the board... I decided to keep it simple in this tutorial, my application will simply log :). The file is the main.lua from a new LUA Project.

Automatically

Then, you will be able to start, stop, delete and enable or disable the autostart of your application directly from LDT.

Manually

Create a launcher

Mihini Application container runs executables. To run a Lua application, we need to create a launcher. In the Mihini world, it is an executable file called run. Here is its content:

#!/bin/sh
lua main.lua

Now the my application folder looks like

$ find raspapp/
raspapp/
raspapp/run
raspapp/main.lua

Install application

First of all, you should be sure that the AppMon Daemon is running on your device. Secondly, be sure that the appcon is activated.
While starting, Mihini opens a Telnet server on port 2000, it enables you communicate with its runtime. We are about to use it for activating the appcon and then install an application.

$ telnet localhost 2000> agent.config.appcon.activate = true

Then restart your agent.

> os.exit(1)## if appmon_deamon is monitoring the agent, it will restart it automatically within seconds## if not, then launch the agent manually
$ ./runtime/start.sh

Now, We are about to install an app available at '/tmp/raspapp', which will be named 'sample', this application will benefit from autostart ( the last true parameter ).