3 Replies Latest reply on Aug 24, 2016 8:35 AM by jam16

    iotkit-agent on Debian Linux - UDP to port 41234 problem

    jam16

      Hi all,

       

      Recently attended a workshop using iotkit-agent on the Edison board to push data to Intel EnableIoT. Everything worked and it was great.

       

      I want to get iotkit-agent running on Linux. I have followed the tutorial at the link below to install the iotkit-agent on my Tinkerforge 'RED Brick' running Debian Linux

      GitHub - enableiot/iotkit-agent: Edge agent to abstract cloud connectivity complexities

      RED Brick – Tinkerforge

       

      Using the commands below appears to install iotkit-agent just fine (using the 2. Installing using npm method).

      npm install iotkit-agent
      mv node_modules/iotkit-agent ./

      cd iotkit-agent
      npm install forever

       

      Following the guide below, I've registered the device on EnableIoT and activated it.

      ICRIedisonIoT/README.md at master · ICRI-Cities/ICRIedisonIoT · GitHub

       

      I've run the "./iotkit-admin.js catalog" command and registered catalog items for 'sound' ,'temperature', 'humidity' and 'light' using the command "./iotkit-admin.js register <measure> <catalog-id>" command.

       

      Starting the agent using the command "./start-agent.sh", works fine.

       

      I can then use the command "./iotkit-admin.js observation temperature 30" for example to push data to EnableIOT. This works fine

       

      However,

      After starting the iotkit-agent service (starts fine) and attempting to run some Python code sending JSON encoded packets to UDP port 41234 at localhost 127.0.0.1, nothing happens and I am not sure what I am doing wrong.

       

      My Python code has been sourced from here(and changed a bit)

      GitHub - enableiot/iotkit-samples: Demonstration code for the IoT Kit

       

      and as far as I can tell, produces JSON encoded data in the same format as described here:

      GitHub - enableiot/iotkit-agent: Edge agent to abstract cloud connectivity complexities

      and here:

      GitHub - enableiot/iotkit-samples: Demonstration code for the IoT Kit

       

      When I test the Python code in Windows with a small Python script listening on port 41234, the data appears to be sent and received OK. However, on my little Debian RED brick, data does not appear to be being sent.

       

      I attach the Python code I have been using to send data and the code I used to listen to port 41234.

       

      I would appreciate any ideas anybody has

       

      Thanks

        • 1. Re: iotkit-agent on Debian Linux - UDP to port 41234 problem
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hi,

          As you may know the iotkit-agent listens to port 41234, but this is on Edison using the Yocto image. I’m not sure if on your REDbrick this port is available or if it is reserved for another task. The problem here is that these steps were tested on Yocto-Edison and not on your environment.
          Have you tried by checking the src files of the agent to see if there is a way to debug this on your board?
          What is the status of the iotkit-agent service before and after trying to send data?
          I also suggest you to contact http://www.tinkerunity.org/ for more accurate information about any requirement you will need to make the agent run successfully in this specific board, and if this has been tested before.

          Regards,
          -Charlie
           

          1 of 1 people found this helpful
          • 2. Re: iotkit-agent on Debian Linux - UDP to port 41234 problem
            jam16

            Thanks for the reply. The port does not appear to be reserved for another task.

             

            I've since discovered that the agent does not appear to be running after i run the command  "./start-agent.sh" from within the iotkit-agent folder.

             

            Running the "netstat -tulpn" command, I can see that node is not listening on 41234.

             

            I have also tried installing iotkit-agent using the npm install method on a raspberryPi running raspbian but see the same problem.

             

            Is anybody successfully running iotkit-agent on raspberryPi or other Linux device?

             

            Thanks

            • 3. Re: iotkit-agent on Debian Linux - UDP to port 41234 problem
              jam16

              I've found the problem!

               

              Within the iotkit-agent folder there is a forever.log file. Within this there was an error message saying that forever had quit as the device had not been activated.

               

              Therefore, I ran this command:

              ./iotkit-admin.js activate <activation_code> 

               

              before running the./start-agent.sh

              command

               

              Now I have nodejs running on port 41234.

               

              basically following the guide line by line here:

              GitHub - enableiot/iotkit-agent: Edge agent to abstract cloud connectivity complexities

               

              Therefore iotkit-agent will run successfully on a tinkerforge red-brick or a raspberry pi