5 Replies Latest reply on May 5, 2016 11:11 AM by Iosif

    Wi-Fi Direct on Edison

    JoBemp

      I was able to find Edison on my Android phone through Wi-Fi direct by sending an invitation with a pin number. Is there a way for me to program a code in Arduino to accept the invitation by writing the pin number back? It works only if I use ssh and send an invitation with a p2p command but I'm trying to get it to work the other way around. Is this even possible?

        • 1. Re: Wi-Fi Direct on Edison
          CMata_Intel

          Hi JoBemp,

           

          I haven’t seen a sketch like this but you could try to do it with system calls or with a Bluetooth library. For system calls you need to use system (“linux_command”), take a look at this thread: How to make dynamic system call in sketch it may help you with this.

          As you may know there isn’t a Bluetooth library for the board but some other libraries have been tested and/or you could create your own in order to achieve this. (Shields Test Report)

          You can also try to change the configuration between the devices in order to not need a pin for the validation of the connection.

           

          Regards,

          Charlie

          • 2. Re: Wi-Fi Direct on Edison
            JoBemp

            CMata_Intel,

             

            The goal of the project that I am working on is to use Wi-Fi Direct instead of Bluetooth. So let's say, I try to connect to the Edison through my Android phone and my phone sends an invitation with a pin number, how can I use a system call so that the Edison checks if an invitation has been received? I am hoping the invitation comes with both a MAC address and a pin number so that I can use the following p2p command to connect to my Android phone:


            wpa_cli -ip2p-dev-wlan0 p2p_connect <MAC address> <pin number> join


            In short, what kind of system call should I use to check if the Edison has received the invitation?

             

            I would like to use a pin to validate the connection for security purposes.

             

            Thank you!

            JoBemp

            • 3. Re: Wi-Fi Direct on Edison
              CMata_Intel

              Hi JoBemp,

               

              The system calls are used with Linux commands, for example you can use system(“configure_edison –setup”); but you will not see the output of this on the Serial Monitor because you will be using different devices (/dev/tty*).  What I suggest you to do is to create a script/sketch that will receive the invitation of the phone in order to save the address and pin into a file. Then, you can access the file and read the data.

              If you want to use an Arduino sketch, I suggest you to look into the SD library for more information about how to manage files, there are some examples on the IDE that may give you an idea on how to start.

               

              Regards,

              Charlie

              • 4. Re: Wi-Fi Direct on Edison
                JoBemp

                CMata_Intel,

                 

                I decided to go for a different approach with several system calls and it is working very well. Thank you!

                 

                JoBemp

                • 5. Re: Wi-Fi Direct on Edison
                  Iosif

                  Can you please tell me how u do it? I also want to invite FROM Android the Edison so addison just to accept my device....