[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [mihini-dev] Getting Started with Mihini
|
Hello All,
I am now able to run (and even remotely
debug) a Lua application running on Mihini! Thanks a lot!
My next steps include remotely controlling
an LED and querying the state of a switch. I'll be trying to do something
similar to what has been done with the Greenhouse Demonstrator, including
the json/rest interface.
However, I'm using the 0.8 version (the
one I got the binaries and installed with the dpkg -i). For some reason,
I am still not able to configure the defaultconfig.lua (shell.address property)
to make Mihini to accept external connections. Maybe I am missing something
really basic. I tried to change the "*" to be the Raspberry Pi
IP and also to be 0.0.0.0, hoping that this would make the server to be
launched/listening on the right interface, but still no luck. I'll try
to evolve on this after I get the updates from the repository (Laurent
notified that the modbus issue is gone).
Anyway, I am making progress and enjoying
using Mihini. Later on, it would be great to make some minor suggestions
(to the Wiki) to make it even easier for someone to get started. Please
let me know how to contribute there.
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 |
From:
Guilhem Saurel <gsaurel@xxxxxxxxxxxxxxxxxx>
To:
mihini-dev@xxxxxxxxxxx
Date:
07/22/2013 05:17 AM
Subject:
Re: [mihini-dev]
Getting Started with Mihini
Sent by:
mihini-dev-bounces@xxxxxxxxxxx
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
_______________________________________________
mihini-dev mailing list
mihini-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/mihini-dev