4 Replies Latest reply on Feb 10, 2015 12:51 PM by babaltz

    enableiot cloud - MQTT setup and latency?

    mhahn

      some questions:

      - is there any preferred way to set the iotkit-agent for MQTT rather REST apart from modifying the default protocol in config js file?

      - what's the typical latency of a MQTT triggered actuator action? In my attempts it takes minutes from an actual event till the actuator action is triggered

        • 1. Re: enableiot cloud - MQTT setup and latency?
          babaltz

          The preferred way of setting the agent protocol (MQTT/REST) is:

          # iotkit-admin protocol <protocol>

           

          You would need to restart the agent process for the protocol change to take effect:

          # systemctl restart iotkit-agent

           

          Note: MQTT does not work through firewalls and REST cannot handle actuation requests from the Cloud.

           

          I ran a short test by sending a control request to my device from the IoT Analytics dashboard. The actuation request from the Cloud via MQTT was received on my device around ~2 seconds later. The agent then parses this message and sends out a message to local UDP port 41235 (configurable). The user must then process this message and perform the desired action. As an example, the Arduino example listens to UDP port every 5 seconds so potentially there is latency from the user app also. See the Actuation section in the iotkit-agent wiki for further information.

          • 2. Re: enableiot cloud - MQTT setup and latency?
            babaltz

            I should have mentioned, valid protocol values for the "iotkit-admin" are "mqtt" and "rest" (lower-case).

            1 of 1 people found this helpful
            • 3. Re: enableiot cloud - MQTT setup and latency?
              mhahn

              babaltz wrote:

               

              The preferred way of setting the agent protocol (MQTT/REST) is:

              # iotkit-admin protocol <protocol>

               

              You would need to restart the agent process for the protocol change to take effect:

              # systemctl restart iotkit-agent

               

              Note: MQTT does not work through firewalls and REST cannot handle actuation requests from the Cloud.

               

               

               

              • and iotkit-admin would just modify the config file likewise?
              • are there any other benefits/limitations on MQTT vs REST for Intel(R) cloud analytics?

               

               

               

              I ran a short test by sending a control request to my device from the IoT Analytics dashboard. The actuation request from the Cloud via MQTT was received on my device around ~2 seconds later. The agent then parses this message and sends out a message to local UDP port 41235 (configurable). The user must then process this message and perform the desired action. As an example, the Arduino example listens to UDP port every 5 seconds so potentially there is latency from the user app also. See the Actuation section in the iotkit-agent wiki for further information.

              firstly I am running native or better Python script. Python should get fired at once the message is there.

              I had rare occassions where the actuation came in after seconds. Typically it's more like minutes (didn't run any proper measurements yet).

               

              btw: under which conditions are the actuators triggered? My impression is that it's not reliably always the case. Would one have to wait for a certain time until it's triggered again?

              • 4. Re: enableiot cloud - MQTT setup and latency?
                babaltz

                Hi.

                • and iotkit-admin would just modify the config file likewise?

                Right. Agent configuration is done through iotkit-admin command. There's no need to edit config files now.

                are there any other benefits/limitations on MQTT vs REST for Intel(R) cloud analytics

                I can't say for sure. Support for web sockets will be added to the agent "soon" so actuation will be possible when using REST protocol - even through proxy servers.

                firstly I am running native or better Python script. Python should get fired at once the message is there.

                I had rare occassions where the actuation came in after seconds. Typically it's more like minutes (didn't run any proper measurements yet)

                Hmm. i'm not sure how much geographic location adds to latency. The servers are in the northwest US so I'm fairly close (New Mexico). Europe may experience more lag.