Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Mihini/Build Mihini"

(Creation of this page, from Mihini/Run_Mihini_on_an_Open_Hardware_platform)
 
m (Check that everything works typo)
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Step 1 - Build Mihini ==
 
 
 
So far, all the work is being done directly on your remote system. For the following sample, <em>pi</em> user is being used on a <em>RaspberryPi</em> running <em>Raspbian Wheezy</em>. Connect to you device using <code>ssh</code> and follow the steps.
 
So far, all the work is being done directly on your remote system. For the following sample, <em>pi</em> user is being used on a <em>RaspberryPi</em> running <em>Raspbian Wheezy</em>. Connect to you device using <code>ssh</code> and follow the steps.
 
<source lang="bash">
 
<source lang="bash">
Line 35: Line 33:
 
# Optional, if you want to use Modbus over serial (e.g. to run the Greenhouse sample)
 
# Optional, if you want to use Modbus over serial (e.g. to run the Greenhouse sample)
 
$ make modbus_serial
 
$ make modbus_serial
 +
# Optional, if you want to use the GPIOs
 +
$ make gpio
  
 
# Move the result of the build in your HOME
 
# Move the result of the build in your HOME
Line 40: Line 40:
 
</source>
 
</source>
  
=== Configure Mihini ===
+
=== Check that everything works ===
 +
 
 +
<source lang="bash">
 +
$ cd ~/mihini
 +
$ ./start.sh
 +
</source>
 +
 
 +
This should produce an output similar to:
 +
 
 +
<pre>
 +
2012-08-24 17:21:42 GENERAL-INFO: ************************************************************
 +
2012-08-24 17:21:42 GENERAL-INFO: Starting Mihini ...
 +
2012-08-24 17:21:42 GENERAL-INFO:      Mihini: 8.0-DEV - Build: Unknown
 +
2012-08-24 17:21:42 GENERAL-INFO:      Lua VM: Lua 5.1.4 (+meta pairs/ipairs) (+patch-lua-5.1.4-3)
 +
2012-08-24 17:21:42 GENERAL-INFO:      System: Linux anzu 3.0.0-24-generic #40-Ubuntu SMP Tue Jul 24 15:38:25 UTC 2012 x86_64
 +
2012-08-24 17:21:42 GENERAL-INFO: ************************************************************
 +
2012-08-24 17:21:42 GENERAL-INFO: Module [AssetConnector] initialized
 +
2012-08-24 17:21:42 SHELL-INFO: Binding a shell server at address ?localhost, port 2000
 +
2012-08-24 17:21:42 GENERAL-INFO: Module [Lua Shell] initialized
 +
2012-08-24 17:21:42 GENERAL-INFO: Module [NetworkManager] initialized
 +
2012-08-24 17:21:42 GENERAL-INFO: Module [Lua RPC] initialized
 +
2012-08-24 17:21:42 GENERAL-INFO: Module [ServerConnector] initialized
 +
2012-08-24 17:21:42 GENERAL-INFO: Module [DataManagement] initialized
 +
2012-08-24 17:21:42 ASSCON-INFO: Connection received from asset [table: 0x9242d0] at '<local ipc=table: 0x8f33f0>:0'
 +
2012-08-24 17:21:42 ASSCON-INFO: Asset registered, name="@sys", id=table: 0x9242d0.
 +
2012-08-24 17:21:42 GENERAL-INFO: Module [DeviceManagement] initialized
 +
2012-08-24 17:21:42 GENERAL-INFO: Mihini successfully initialized
 +
</pre>
 +
 
 +
You should be able to open an lua shell on mihini: <code>$ telnet localhost 2000</code>.
 +
 
 +
You can then close this lua shell with <code>CTRL-D</code> and the <code>start.sh</code> with <code>CTRL-C</code>.
 +
 
 +
<!--=== Configure Mihini ===
  
 
Now there are some configuration items in <code>~/mihini/lua/agent/defaultconfig.lua</code> that you may optionally want to modify.
 
Now there are some configuration items in <code>~/mihini/lua/agent/defaultconfig.lua</code> that you may optionally want to modify.
Line 51: Line 84:
 
* Enable the highest logfile output level, this way you can easily see errors in the code
 
* Enable the highest logfile output level, this way you can easily see errors in the code
 
**<source lang="lua">log.defaultlevel = "DEBUG" -- default log level: can be one of NONE, ERROR, WARNING, INFO, DETAIL, DEBUG, ALL. See log.lua for details</source>
 
**<source lang="lua">log.defaultlevel = "DEBUG" -- default log level: can be one of NONE, ERROR, WARNING, INFO, DETAIL, DEBUG, ALL. See log.lua for details</source>
 +
-->
  
=== It should be easier  ===
+
=== Next ===
 
+
What is explained above is just a beginning. We are about to provide material which will speed up previous steps, such as:
+
  
* How to cross compile Mihini from your Desktop machine
+
Then, you can go back to the main tutorial: [[Mihini/Run_Mihini_on_an_Open_Hardware_platform|Run Mihini on an Open Hardware platform]]
* A <code>defaultconfig.lua</code> with the right default settings
+
* A Linux package, to avoid any kind of compilation or configuration
+
  
 
<!--
 
<!--

Latest revision as of 06:26, 30 July 2013

So far, all the work is being done directly on your remote system. For the following sample, pi user is being used on a RaspberryPi running Raspbian Wheezy. Connect to you device using ssh and follow the steps.

$ ssh pi@raspberry.local

Compilation prerequisites

First of all, you will need some compilation tools:

$ sudo apt-get install build-essential cmake git telnet

Sources to compile

Get the sources

$ cd
$ git clone http://git.eclipse.org/gitroot/mihini/org.eclipse.mihini.git mihini-repo

Run the compilation

Lets move into the repository you just cloned. Make sure you have all prerequisites mentioned above installed. Now, simply run the following in the repository you just cloned, here called mihini-repo/.

# Compile Mihini
$ cd mihini-repo
$ ./bin/build.sh
 
# Compile a Lua interpreter
$ cd build.default/
$ make lua
# Optional, if you want to use Modbus over serial (e.g. to run the Greenhouse sample)
$ make modbus_serial
# Optional, if you want to use the GPIOs
$ make gpio
 
# Move the result of the build in your HOME
$ mv runtime ~/mihini

Check that everything works

$ cd ~/mihini
$ ./start.sh

This should produce an output similar to:

2012-08-24 17:21:42 GENERAL-INFO: ************************************************************
2012-08-24 17:21:42 GENERAL-INFO: Starting Mihini ...
2012-08-24 17:21:42 GENERAL-INFO:      Mihini: 8.0-DEV - Build: Unknown
2012-08-24 17:21:42 GENERAL-INFO:      Lua VM: Lua 5.1.4 (+meta pairs/ipairs) (+patch-lua-5.1.4-3)
2012-08-24 17:21:42 GENERAL-INFO:      System: Linux anzu 3.0.0-24-generic #40-Ubuntu SMP Tue Jul 24 15:38:25 UTC 2012 x86_64
2012-08-24 17:21:42 GENERAL-INFO: ************************************************************
2012-08-24 17:21:42 GENERAL-INFO: Module [AssetConnector] initialized
2012-08-24 17:21:42 SHELL-INFO: Binding a shell server at address ?localhost, port 2000
2012-08-24 17:21:42 GENERAL-INFO: Module [Lua Shell] initialized
2012-08-24 17:21:42 GENERAL-INFO: Module [NetworkManager] initialized
2012-08-24 17:21:42 GENERAL-INFO: Module [Lua RPC] initialized
2012-08-24 17:21:42 GENERAL-INFO: Module [ServerConnector] initialized
2012-08-24 17:21:42 GENERAL-INFO: Module [DataManagement] initialized
2012-08-24 17:21:42 ASSCON-INFO: Connection received from asset [table: 0x9242d0] at '<local ipc=table: 0x8f33f0>:0'
2012-08-24 17:21:42 ASSCON-INFO: Asset registered, name="@sys", id=table: 0x9242d0.
2012-08-24 17:21:42 GENERAL-INFO: Module [DeviceManagement] initialized
2012-08-24 17:21:42 GENERAL-INFO: Mihini successfully initialized

You should be able to open an lua shell on mihini: $ telnet localhost 2000.

You can then close this lua shell with CTRL-D and the start.sh with CTRL-C.


Next

Then, you can go back to the main tutorial: Run Mihini on an Open Hardware platform


Back to the top