4 Replies Latest reply on Dec 7, 2015 8:02 PM by a_Monteiro

    Communicating with Edison over UDP

    aneedles

       

      I am setting up a communications path to the Edison over WiFi, and I would like to use raw UDP packets for general purpose and high-speed transfer of data. I am relatively new to the Edison but not to programming. I am looking for advice on how to setup the Edison to communicate with a host on the same network. Is there a library I can use to send and receive UDP packets to a host computer?

      I see iotkit-comm provides data publish and subscribe options, but I am looking for general purpose communications, such as is possible with UNIX using sockets or Windows .NET using .NET libraries. Is there a similar library available on the Edison for raw UDP?

      Thanks in advance,  Aaron

       

        • 1. Re: Communicating with Edison over UDP
          ForumMigrationAdmin

           

          FWIW most of the time when I wanna do something like this on the Edison, I ignore Edison and just look for Linux - the following may be useful

          http://www.binarytides.com/programming-udp-sockets-c-linux/

          In a month or so I will be looking for something to perform bidirectional comms with a mac running osx - I believe I can configure (or get another instance of eclipse) to get native mac code to run - (I hate x-code with a passion.....).

          I will be following what you are doing (and wish you the best of success) - because I may wish to unashamibally (sic) leech your code at some stage.

          Stan

           

          • 2. Re: Communicating with Edison over UDP
            ForumMigrationAdmin

             

            agree with Stan - from my side I used UDP sockets from within C, C++, Node.JS and Python on Edison fine. Haven't looked into Mono .NET but probably doable there as well. Just note: Linux socket programming is slightly different to Windows one (different header files ...)

            Just the default busybox netcat "nc" on Edison doesn't come with udp (-u) support. If you'd want to go via nc you'd have to install a more powerful netcat version

             

            • 3. Re: Communicating with Edison over UDP
              ForumMigrationAdmin

               

              ... and there is lots of information available online

              e.g. Node.JS: https://nodejs.org/api/dgram.html

              Python: http://pymotw.com/2/socket/udp.html

               

              • 4. Re: Communicating with Edison over UDP
                a_Monteiro

                has anyone been able to install dgram on their edison I have been having getting errors when i try to :

                root@edison:~# npm install dgram

                npm WARN package.json http@0.0.0 http is also the name of a node core module.

                npm WARN package.json http@0.0.0 No description

                npm WARN package.json http@0.0.0 No repository field.

                npm WARN package.json http@0.0.0 No README data

                npm WARN package.json net@1.0.2 net is also the name of a node core module.

                npm WARN package.json net@1.0.2 'repositories' (plural) Not supported. Please pick one as the 'repository' field

                npm WARN package.json net@1.0.2 No README data

                npm ERR! 404 Not Found

                npm ERR! 404

                npm ERR! 404 'dgram' is not in the npm registry.

                npm ERR! 404 You should bug the author to publish it

                npm ERR! 404

                npm ERR! 404 Note that you can also install from a

                npm ERR! 404 tarball, folder, or http url, or git url.

                 

                 

                npm ERR! System Linux 3.10.17-poky-edison+

                npm ERR! command "node" "/usr/bin/npm" "install" "dgram"

                npm ERR! cwd /home/root

                npm ERR! node -v v0.10.38

                npm ERR! npm -v 1.4.28

                npm ERR! code E404

                npm ERR!

                npm ERR! Additional logging details can be found in:

                npm ERR!     /home/root/npm-debug.log

                npm ERR! not ok code 0