7 Replies Latest reply on Mar 10, 2017 12:11 PM by Intel Corporation

    How to keep GPIO alive after restart

    radix_zero

      I seem to have a problem with reliable access to the GPIO and persisting the system configuration between power cycles

       

      I'm working with the Arduino broard and the System Studio IoT Edition I've modified the on-board led blink to use D8 instead and hooked-up a simple LED.  I have recently flashed to the latest firmware.

       

      The problem is that if

      • left unattended for a couple hours,
      • if the power cycles, either by the button or unplug,
      • or modify the program and redeploy too many times

       

      then the gpio no longer works.  No errors are produced, but the LED does not blink.  (I added a couple printf to have some debug output)

      there also seems to be no way to have the wifi configuration persist.  I'm using the configure_edison with both the wifi flag, the one time setup flag and the --persist.  http://edison.local times out.

       

      (configure_edision --version is "Could not determine firmware version information. Quitting.")

       

      If i power cycle and reset a few times (and reconfigure wifi each time) eventually GPIO starts working again.

       

      Is there a more reliable way to work with the board.

        • 1. Re: How to keep GPIO alive after restart
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hello radix_zero,

          Thanks for reaching out!

          If you are using ISSIoT, your scripts will not be permanently stored on your Edison as they are stored on a temporary file that is erased every time the board boots, that might explain why your code stops on every power cycle. 

          I suggest you to check https://communities.intel.com/message/358383#358383, there it is explained how to permanently store your scripts on your Edison's storage and run them on boot.

          If you'd like to expand on the same topic spoken on the thread above, I suggest you to check this guide: https://communities.intel.com/docs/DOC-111103.

          I hope this information helps you,
          Pedro M.

          • 2. Re: How to keep GPIO alive after restart
            radix_zero

            Yes i know they are in /tmp.  It is when the program is run again through ISSIoT or executed directly on the command line the GPIO does not function.  No errors are presented.   ps shows it is running.  But there physical world change to the pin anymore. 

            • 4. Re: How to keep GPIO alive after restart
              Intel Corporation
              This message was posted on behalf of Intel Corporation

              I'm not sure I understand you. Please clarify the next to me:

              Scenario 1:

              You run the script, you stop it and when trying to start it again, Edison will not react.

              Scenario 2:

              You run the script, it stops for some reason and when trying to start it again Edison will not react until reboot.

              Scenario 3:

              You run the script, while it is running you try to execute it again and it stops working but it does not throw any error messages.

              Do any of those scenarios describe your situation? Or, am I not getting it?

              Let me know.
              Pedro M.

              • 5. Re: How to keep GPIO alive after restart
                radix_zero

                run the program using ISSIoT - works as expected

                stop the program using terminate button on the console window

                run the program again using ISSIoT - program runs but LED does not blink.

                 

                unplug both USB cables from the board and plug them back in - board is now in AP mode

                use serial terminal the run configure_edison --wifi --persit - setup wifi

                run the program again using ISSIoT - program runs but LED does not blink

                repeat a couple times and LED will start blinking

                 

                so the issues:

                1. persisting wifi config

                2. programs running, no errors, but sometimes no observable response from GPIO

                • 6. Re: How to keep GPIO alive after restart
                  joe_nasti

                  I'm not sure about the 'dead' GPIO problems, but the Wi-Fi should have an explanation.

                   

                  Could you confirm that you're on the latest firmware? configure_edison --version never works for me either....what is the output of these two commands:

                  #> cat /etc/version

                  #> uname -a

                   

                  The only time I've seen people complain about persisting Wi-Fi was back in 2014 in the earliest of builds. If you're using anything from the last year, it *should* be ok. If not, try looking into something like this: Re: Edison WiFi woes

                  "Try running 'systemctl enable wpa_supplicant' to enable automatically starting of Wi-Fi and use 'systemctl disable wpa_supplicant' if you ever want to disable automatic starting of Wi-Fi."

                  If you see your Wi-Fi is down after a reboot, check it with "systemctl status wpa_supplicant" to see if it's running. If not, then you probably have to make sure it's enabled like the link suggests.

                  • 7. Re: How to keep GPIO alive after restart
                    Intel Corporation
                    This message was posted on behalf of Intel Corporation

                    Have you tried to reflash your board to see if the issue persists? I've personally haven't faced an issue such as this.

                    Let us know how it goes.
                    Pedro M.