Per Instance Configuration?

The planner had support for letting set configuration that is specific to an imp for a given “model”, how do we do this in the new imp/agent model?

if(ImpId == "23455cd643fc42ee"){ NoLights = true; server.log("NoLights is "+ NoLights); agent.send("Aprilboard",NoLights);} else{ NoLights = false; server.log("NoLights is "+ NoLights); agent.send("Aprilboard",NoLights); };

and whatever…

That is what I was doing, but I was thinking, if I am going to deploy more then one (if it is for enterprise only, that is fine, I only plan on deploying one or two of the same model), it would be nicer if I didn’t hard code each client specifics in the code.

So there might be a specific client id necessary to communicate with an imp (besides the unique agent url) to that is part of the https traffic to ensure that nobody else can communicate with my agent.

you can let your client identify itself by a lot of ways you can program yourself, like with an id you choose yourself and take actions on that. If this is not what you mean I don’t understand.

Lets say I am writing a controller for a garage door opener. Lets say I have 3 garage door openers. All 3 run the EXACT same code. But I might want to authenticate them each either their own code so that someone who discovers the agent URL doesn’t access them.

I could

a) Have a bunch of if statements that say if imp1, secret code is X, if imp2, secrete code is Y

b) I could generate the secrete code based on a common algorithm that is specific to the agent URL

c) I could have data that is specific to that running instance of the agent (there is going to be 1 agent per imp, so if I have my “garage” code running on 3 imps, I will have 3 agents running the exact same code.

The planner had a way of specifying (and changing) configuration data in the planner that would apply only to that instance (and didn’t require you to bake that specific data into the code).

Generally, you’d have a deployment process (in a commercial app, this would be done by the phone app talking to the agent immediately after blinkup) where you could set up security details which would then be stored by the agent in server-side storage.

For one-offs, you could still do this by hitting the agent manually/with a curl that sets these parameters. Just needs the server-side storage API, which will be rolling out shortly.

Correct me if I’m wrong, but I thought this type of per instance configuration is exactly the purpose of imp.configparams:
http://devwiki.electricimp.com/doku.php?id=electricimpapi:imp:configparams

Configparams works for the imp (not the agent) and is rather planner-centric.