Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mihini-dev] Appcon module

Hi Curo,
again thank you ver much for your explanation, 
I have tried several ways to implement DevieManagement finally implemented some configuration and provisionin operations, now my requirement is install and updates some apps to the device remotely, for that i need to use the functions defined in appcon module,

as you said i tried rpc module to remotely connect to mihini VM and called the appcon function, but still i cannot access those functions,
here is my code, it doesn't work

local function main()
log.setlevel("INFO")
log("GENARAL", "INFO","Device initiated")

devicetree.init()-- configure the module
devicetree.set ("config.agent.deviceId", 'ramshad')
devicetree.set ("config.agent.server.url", 'tcp://m2m.eclipse.org:44900')
devicetree.set ("config.agent.DEVInfo.Man", 'anodize')
devicetree.set ("config.agent.DevInfo.DevId", 'ramsh')
devicetree.set ("config.agent.DevInfo.Lang", 'english')
devicetree.set ("config.agent.DevInfo.Mod", 'r001')
devicetree.set ("config.agent.DevInfo.DmV", 'dm01')
devicetree.set ("config.server.autoconnect.onboot", true)

local devId=devicetree.get("config.agent.deviceId")
local Lang=devicetree.get("config.agent.DevInfo.Lang")
local Man=devicetree.get("config.agent.deviceInfo.Man")
local Mod=devicetree.get ("config.agent.DevInfo.Mod")
local DmV=devicetree.get ("config.agent.DevInfo.DmV")
print(devicetree.get("config.agent.deviceId"))
print(devicetree.get("config.agent.DmAcc.newNode"))
print(devicetree.get("config.agent.DmAcc.reboo"))

devicetree.register('config.agent.DmAcc.newNode',test)
devicetree.register('config.agent.DmAcc.reboo',swUpdate)


client, err = rpc.newclient('localhost', 1999)
for x,y in pairs(client) do
print (x,":",y)
end
client:call('client.agent.appcon.list')

end

sched.run(main)
--sched.run(writebranch)
sched.run(swUpdate)
sched.loop()



can you please tell me how to exactly call appcon.install/appcon.list function using rpc


On Wed, Dec 11, 2013 at 4:30 PM, Cuero Bugot <cbugot@xxxxxxxxxxxxxxxxxx> wrote:

OK. Well.

 

So in a typical device management architecture you have devices and a central server that you use to administrate the devices. SWI provide a commercial solution for the server, that you can try for free BTW (https://airvantage.net/)

Mihini is a software designed to run on the device. It is composed of an agent that talk using M3DA protocol that was specifically designed for M2M, and AirVantage solution. It is feature full and bandwidth efficient while providing a state of the art security model.

In addition Sierra also contributed an open source M3DA server stack available here: https://github.com/SierraWireless/m3da-server (Java). It is less feature full than the commercial solution but it provides the connectivity means to do device management. There an already deployes instance of that server on the eclipse site: (tcp://m2m.eclipse.org:44900)

 

For reference, there is also a Lua  implementation under Mihini.Git/tools/LuaPlatformServer. (type make platformserver lua  in the build.default directory, and run bin/lua lua/platform/init.lua in a terminal). You can then login using a browser on http://localhost:9898/)

 

You will have to configure the Mihini agent to communicate with the right server.

(Log in with a  telnet in the LuaVM shell of the agent and check the setting:

> :agent.config.server.url

 

This is not very well documented, it was planned to be done in a next step.

 

I hope you can sort out the details J

 

Thx,

Cuero

 

From: mihini-dev-bounces@xxxxxxxxxxx [mailto:mihini-dev-bounces@xxxxxxxxxxx] On Behalf Of Mohammadu Ramsath
Sent: Wednesday, December 11, 2013 8:50 AM


To: Mihini project developer discussions
Subject: Re: [mihini-dev] Appcon module

 

Hi Cuero,

Thanks for your response, it was a great help for me to proceed with device management,

but there are also some other api's such as rest api , and m3da commands which i can use for device mangment(what i understand)

could you please tell me what exactly we have to use for device management in mihini, rest api? or lua rpc? or any other?

i also would like to know is there any mihini client module developed to communicate with device management server and execute commands

thanks

regards

Ramshad

 

 

On Mon, Dec 9, 2013 at 4:48 PM, Cuero Bugot <cbugot@xxxxxxxxxxxxxxxxxx> wrote:

Ha Ok I understand.

 

Well the update system was designed for update outside of the system: I mean so that something external to the system could update the system. If you want to do it from within your application it might be a little more complicated.

 

You cannot require agent.appcon in your application as appcon/update is run in the agent VM, and not in the applications.

 

However you can use Lua RPC module to connect to the agent VM and call function from there.

require ‘rpc’, then call “newclient()” API. This object will provide a ‘call()’ method, to which you can give the function name/param you want to call on the remote VM. (the rpc client object is also callable)

 

You may have to look to the rpc code (luafwk/rpc/common.lua) to have more information.

 

This would have the same behavior as when you do the call manually from a Lua shell.

 

Hope that’ll help.

Cuero

 

 

 

From: mihini-dev-bounces@xxxxxxxxxxx [mailto:mihini-dev-bounces@xxxxxxxxxxx] On Behalf Of Mohammadu Ramsath

Sent: Monday, December 09, 2013 7:05 AM
To: Mihini project developer discussions
Subject: Re: [mihini-dev] Appcon module

 

Hi Cuero,

Thanks for reply,

but, i tried it already procedure described here: http://wiki.eclipse.org/Mihini/Run_Mihini_on_an_Open_Hardware_platform ?

i was able to do that manual part, accesing appcon module and function through lua shell,

however when i tried to include apcon module to my lua app (ex: local appcon = require "appcon") it shows errors

i even tried local appcon=require "agent.appcon" it also doesn't works

my need is , i want to use the functions available in the appcon module such as install, start etc.  to my lua app

can you please help me.

Thanks

 

On Fri, Dec 6, 2013 at 7:43 PM, Cuero Bugot <cbugot@xxxxxxxxxxxxxxxxxx> wrote:

Hi Mohammadu,

 

No you should not need to develop those device management operation as the vanilla Mihini provide application install.

Did you try the procedure described here: http://wiki.eclipse.org/Mihini/Run_Mihini_on_an_Open_Hardware_platform ?

 

Thx,

Cuero

 

From: mihini-dev-bounces@xxxxxxxxxxx [mailto:mihini-dev-bounces@xxxxxxxxxxx] On Behalf Of Mohammadu Ramsath
Sent: Friday, December 06, 2013 12:06 PM
To: mihini-dev@xxxxxxxxxxx
Subject: [mihini-dev] Appcon module

 

Hi,

I have been trying to use appcon module to my lua program which is to be run on mihini,

But i couldn't use it, similarly the update module

do i need to develop those device management functions or else is there any way to access those functions

Thankyou


_______________________________________________
mihini-dev mailing list
mihini-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/mihini-dev

 


_______________________________________________
mihini-dev mailing list
mihini-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/mihini-dev

 


_______________________________________________
mihini-dev mailing list
mihini-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/mihini-dev



Back to the top