Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mihini-dev] Getting Started with Mihini

Hello,

Le 19/07/2013 20:24, mnerys@xxxxxxxxxx a écrit :
> On Step 1, I initially took the first option:
> http://wiki.eclipse.org/Mihini/Build_Mihini
> 
> There, I got an error with modbus (please see attached log).

I had this error too in the main repo, and corrected it in my branch. I
will submit a patch in a few days.

> (BTW: I had to use the ldd trick presented on the wiki)

It's not that obvious when you read the wiki, but it's a normal behaviour.

> Then, I tried to Export a Lua Project from LDT and it failed with a connection refused error. I tried to do a telnet from my workstation to Mihini and I could not connect either.
> 
> I could do an ssh to the Raspberry Pi (I was looking for issues with firewall configuration) and I noticed that a telnet on the Pi works only with localhost. If the Raspberry Pi's IP is used, connection fails.

This is a configuration issue. And it's my fault, because I wrote this
part of the documentation only in the third option for step one
(http://wiki.eclipse.org/Mihini/Install_Mihini).

You can try with this defaultconfig.lua [1] and this platform.lua [2] in
/home/pi/mihini/lua/agent, but this specific problem comes from
«shell.address = "*"»


> The problem that I am facing now is that I am trying to use the sample code on Step 4:
> local log   = require "log"
> local sched = require "sched"
> local function main()
>     log("GENERAL", "INFO", "My first Mihini app is alive :)")
> end
> 
> sched.run(main)
> sched.loop()
> 
> However, the syslog does not show the message above. It seemed like the app was failing to run.

Well… I don't see this message… But the log works in my other applications…

> I am not sure if this would work, but I tried to run:
> cd /opt/mihini/apps/test
> ./run
> 
> And no module from Mihini is being found. If I comment the 'log' module out, then I get an error with 'sched'.
> 
> lua: main.lua:1: module 'log' not found:
>         no field package.preload['log']
>         no file './log.lua'
>         no file '/usr/local/share/lua/5.1/log.lua'
>         no file '/usr/local/share/lua/5.1/log/init.lua'
>         no file '/usr/local/lib/lua/5.1/log.lua'
>         no file '/usr/local/lib/lua/5.1/log/init.lua'
>         no file '/usr/share/lua/5.1/log.lua'
>         no file '/usr/share/lua/5.1/log/init.lua'
>         no file './log.so'
>         no file '/usr/local/lib/lua/5.1/log.so'
>         no file '/usr/lib/arm-linux-gnueabihf/lua/5.1/log.so'
>         no file '/usr/lib/lua/5.1/log.so'
>         no file '/usr/local/lib/lua/5.1/loadall.so'
> stack traceback:
>         [C]: in function 'require'
>         main.lua:1: in main chunk
>         [C]: ?
> 

This run files is supposed to be launched by Mihini, which has already
set some environment variables for you.

If you want to run it manually, you can try with this run (which may not
be named "run").

===================================================================
#!/bin/sh

LUA_PATH="/home/pi/mihini/lua/?.lua;/home/pi/mihini/lua/?/init.lua"
LUA_CPATH="/home/pi/mihini/lua/?.so"
export LUA_PATH LUA_CPATH

/home/pi/mihini/bin/lua main.lua
===================================================================

> 
> Thanks,
> 
> Marcelo Nery dos Santos
> Research Software Engineer
> Phone: 55-21-2132-3663
> E-mail: mnerys@xxxxxxxxxx       Av. Pasteur 146 & 138
> Rio de Janeiro, RJ
> 22290-240 - Brazil
> 


Guilhem Saurel.

[1]
https://github.com/nim65s/mihini-repo/blob/CPack/porting/raspberrypi-linaro/agent/defaultconfig.lua
[2]
https://github.com/nim65s/mihini-repo/blob/CPack/porting/raspberrypi-linaro/agent/platform.lua


Back to the top