Communication between Controller & Agent


(Karthik Nujella) #1

Hey I am trying to install Iofog Agent & Controller on 2 Raspberry Pi’s (3B+ model).
I have followed the steps in the Set up agent & set up controller documentation, till the end and tried creating a provisioning key as well.

But I am unable to figure out, if the controller is really able to talk to the agent! May I know how can I assure there existed a communication channel/thread between them!

And I’m even unsure of the iofog-agent configuration with the IP Address(Either using domain name or IP Address, I opted for IP Address)

Can someone please help me out!!

(Ian Martin) #2

Absolutely. The easiest way would be either to run iofog-agent status on the RPI with Agent installed. It will tell you if Connection to Controller is either:

ok, broken certificate(The Agent doesn’t trust it’s controller), and not provisioned if not connected.

If you see either broken certificate or not provisioned, ensure that both iofog-controller is started, the agent is pointed to it
(with iofog-agent config -a http://<IP-Address of Controller>:<Port Assigned>/api/v3/)

You may also attempt to add a microservice to the agent, through one of our provided interfaces(like REST API, our ProductDemo Previews) or through CLI. If you add this and start the flow, you may run

cat /etc/iofog-agent/microservices.json which will become populated with a Json describing the microservices you have deployed. You can also check /var/log/iofog-agent/iofog-agent.0.log.

If you are unsure of the port when you run iofog-controller start it Will tell you which port to expect.


iofog-controller start
[info] Starting iofog-controller...
==> 🌎 Listening on port 54421. Open up http://localhost:54421/ in your browser.
ioFog-Controller has started at pid: 46997

I hope this answered your question, or cleared up some confusion. Please tell me if you’re still confused

(Karthik Nujella) #3

Hey Martin,

Thank you so much for the quick response!

Well, I tried following what you said, but unexpectedly the following error showed up!

Result: Provision failed with error message: “SQLITE_READONLY: attempt to write a readonly database”

Could you please help me figure out what could be the reason behind this?


(Ian Martin) #4

Hey can you please run sudo iofog-agent version and sudo iofog-controller controller version on the respective machines and tell me what versioning you have? We tend to see provisioning/db errors like this when versions mismatch between the two.

(Karthik Nujella) #5

Hey the iofog-controller version is 1.1.1

and the iofog-agent version output is as follows:
ioFog 1.2.0 Copyright © 2018 Edgeworx, Inc. Eclipse ioFog is provided under the Eclipse Public License 2.0 (EPL-2.0)

*But I followed the documentation for 1.1.1 for iofog agent as well.

Could you please let me know, if 1.2.0 is released ?


(Saeid) #6

Hi Karthik,

Can you please install latest Controller (v1.2.1) and try again?

sudo npm i -g --unsafe-perm iofogcontroller@1.2.1


(Harish) #7

Hi Saeid,

Thanks for the reply,

I executed the command provided by you to install 1.2.1, installed successfully.

Unfortunately, I couldn’t add the new provisioning key, Details as follows,
sudo iofog-agent provision GM2b98Mf
Provisioning with key “GM2b98Mf” … Result: Provision failed with error message: “Invalid Provisioning Key”

Could you help me with the concerned steps to be taken care.

Thanks much,

(Saeid) #8

So the error means that the provisioning key is no longer valid.
You need to generate a new one from the machine running Controller:

iofog-controller iofog provisioning-key -i <iofog-uuid>