4 Replies Latest reply on Aug 15, 2017 12:58 PM by Intel Corporation

    How to implement network switching

    FocaaBR

      Hi everyone,

       

      I'm working with a project on Intel Edison that consists of collecting data and send it to cloud if the Edison is on Online mode or to storage in the sdcard if the Edison is on Offline mode. Right now I'm using a push button to do this switching between Online/Access Point mode but I want to do this automatically. Like, in one hour the board should be 10 minutes online and then go 50 minutes offline. Also I want to know if the Edison could do this using a real time clock to "see" the time and switch the mode (i.e. at 3:00PM Edison goes Online and 3:10PM Edison goes Offline).

       

      Right now I have a script that runs when I press the button to reconfigure the mode of the network as follow:

       

      Modify Network

      192.168.1.40

      get ip

      192.168.1.40

      wifi mode on -> AP mode

      Set interface - AP mode

      [warn] Running /etc/init.d/networking restart is deprecated because it may not re-enable some interfaces ... (warning).

      [....] Reconfiguring network interfaces...Ignoring unknown interface dfarm=dfarm.

      done.

      [ ok ] Stopping advanced IEEE 802.11 management: hostapd.

       

      If I was not clear, just ask please!

        • 1. Re: How to implement network switching
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hi FocaaBR,

          Thank you for contacting us.

          I’d like to ask one question to make sure I fully understand your request.

          Do you want the Edison to be running and then, after you push the button, for the Edison to run the script. This script places the Edison in Online mode and then after a certain amount of time, in offline mode, and then end the script?

          Or, do you want to completely remove the button and have the Edison boot in online mode and be continuously switching between online and offline mode?
          If your goal is similar to the first case, modify the script. This script could be activated after pushing the button. After the script is activated, it will run for the time it is configured to do so in online mode, and then offline mode. The script will end and would be activated again after pushing the button.

          If you’re looking for a solution for the second scenario, you could use a service to run the script automatically after boot. The script should have a parameter that defines for how long the Edison is going to be in online mode before switching to offline mode. If you’re looking for information about services you can check: https://www.losant.com/blog/edison-automatic-process-startup

          Let us know if this answers your questions.

          -Sergio A
           

          • 2. Re: How to implement network switching
            FocaaBR

            Hello Sergio,

             

            I'm looking for a solution of the second scenario! I will check the link that you provided and try to implement it.

             

            Also, I have a question about what is running when the button is being pressed. In that case it shows this "address" /etc/init.d/networking. So, I should look for the script that runs when I press the button and then include it to the services?

             

            Thank you.

            • 3. Re: How to implement network switching
              Intel Corporation
              This message was posted on behalf of Intel Corporation

              Hi,

              Go ahead and try our suggestion. Let us know your results.

              In regards to your question, it was my understanding that you already have a script that allows you to configure the network’s mode using a push button. This script would just need to have an extra few lines that define for how long the board will be in online mode to later change to offline mode, without the need of a button. The job of the service would be to start the script at boot.

              We’ll be waiting for your response.

              -Sergio A
               

              • 4. Re: How to implement network switching
                Intel Corporation
                This message was posted on behalf of Intel Corporation

                Hi FocaaBR,

                Do you still need assistance with this case?

                -Sergio A