12 Replies Latest reply on Nov 25, 2014 1:58 PM by DiegoV_Intel

    Setting Access Point Mode

    jblackston

      Is there a way to change the pin to setup the Edision to be an Access Point? I want to shift the pin from the power pin to a different pin.

        • 1. Re: Setting Access Point Mode
          DiegoV_Intel

          Hi jblackston,

           

          Could you please be more specific? Do you want to re-map the pins of the Edison?

           

          Regards,

          Diego.

          • 2. Re: Setting Access Point Mode
            jblackston

            Right now setting the hardware as an access point you hold the power button, is there a way to map this to a different pin, say for gpio40 and just toggling the pin causes it?

            • 3. Re: Setting Access Point Mode
              DiegoV_Intel

              Hi jblackston,

               

              I think I'm not following you. When you said "the power button", to which pin are you referring to? Are you referring to the pin PWRBTN# in the Edison?

               

              Regards,

              Diego.

              • 4. Re: Setting Access Point Mode
                jblackston

                Yes, sorry. The power pin on the Edision. I was hoping i could map that to a different pin. So if say GPIO23 goes high I get a script to perform the configuration_edison command to place it into AP mode.

                • 5. Re: Setting Access Point Mode
                  DiegoV_Intel

                  Hi jblackston,

                   

                  So you are taking about the PWRBTN# pin right? Unfortunately it can't be mapped. Actually the Edison pins can't be mapped to another pins. For example, the PWRBTN# pin is the pin 17 in the Edison 70-pin connector. It can't be mapped to another one, let's says for example to the pin 48 which is a GPIO pin.

                   

                  Let me know if this answered your question.

                   

                  Regards,

                  Diego.

                  • 6. Re: Setting Access Point Mode
                    jblackston

                    I guess the question is, I want a script to be called when a GPIO pin changes states, like going from low to high. I'm assuming that's what the PWRBTN# is doing when it gets held down for x number of seconds. I could probably write an application to do this, but I figured that there was probably away for a script or a js file that could perform this act.

                    • 7. Re: Setting Access Point Mode
                      deium

                      You could certainly put a momentary switch on a gpio pin and monitor it for a state change and have your application pretty much perform whatever you needed.

                      There are several examples in C, C++, javascript and python in the mraa documents mraa: Main Page

                      • 8. Re: Setting Access Point Mode
                        DiegoV_Intel

                        Hi jblackston,

                         

                        I think deium's suggestion is helpful, and it answers your question. Regarding the PWRBTN#, its functionality is to get the Edison into a power down/sleep mode, not to call a script as you said. Take a look to this document where there is an explanation of the functionality of the PWRBTN# pin: Intel® Edison kit for Arduino – Buttons and Switch. This Edison pin is connected to the power button (SW1UI2) in the Arduino Expansion Board, so the description you will find in the document for the power button (SW1UI2) is actually the description of the functionality of the PWRBTN# pin in the Edison Module.

                         

                        Regards,

                        Diego.

                        • 9. Re: Setting Access Point Mode
                          jblackston

                          I thought there was a .js script that ran that caused this. I was just wondering if I could do this with possibly a simple script rather than writing an application to just look at a pin to.

                          • 10. Re: Setting Access Point Mode
                            deium

                            "An application" being a process that runs on your Edison, can be created by a "simple script" such as the webserver for configure_edison. The mraa pin example GPIO_DigitalRead.js could be a starting point and you can expand that script outward to suit your needs.   That file by Dan Yocom of Intel less the comments:

                            -------------------------

                            var m = require('mraa'); //require mraa
                            console.log('MRAA Version: ' + m.getVersion()); //write the mraa version to the console

                            var myDigitalPin = new m.Gpio(6); //setup digital read on pin 6
                            myDigitalPin.dir(m.DIR_IN); //set the gpio direction to input

                            periodicActivity(); //call the periodicActivity function

                            function periodicActivity() //
                            {
                              var myDigitalValue =  myDigitalPin.read(); //read the digital value of the pin
                              console.log('Gpio is ' + myDigitalValue); //write the read value out to the console
                              setTimeout(periodicActivity,1000); //call the indicated function after 1 second (1000 milliseconds)
                            }

                            -------------------------

                            With regards to your original question

                            > Is there a way to change the pin to setup the Edision to be an Access Point? I want to shift the pin from the power pin to a different pin.

                            DiegoV_Intel stated it can not be remapped.

                            • 11. Re: Setting Access Point Mode
                              jblackston

                              Thanks, that's kind of what I was thinking of.

                              • 12. Re: Setting Access Point Mode
                                DiegoV_Intel

                                Hi jblackston,

                                 

                                The step 2 of Configure Edison (Access Point Mode) points you have to press and hold the power button on the Arduino Expansion Board for 2+ seconds to enable the AP mode. Another way to do this, is using the command "configure_edison --enableOneTimeSetup". This command has the same effect of pressing and holding the power button for 2+ seconds.

                                 

                                Now, if you want to do that with another pin, you could put a momentary push button on a GPIO pin and monitor it for a stage change just as deium explained. Depending on the value read (HIGH or LOW), you could execute the "configure_edison --enableOneTimeSetup"command.

                                 

                                Regards,

                                Diego.