5 Replies Latest reply on Aug 31, 2016 9:28 AM by Intel Corporation

    Reg:The soft reset of Intel edison board

    Radhika.k

      Hi all,

       

                I  would like to know about soft reset the intel edison (arduino expansion board),I know reboot(hard reset).My idea is to reboot only some services or processes not the whole edison board.

       

                we are using different I2C sensors and we want to reboot only the i2c sensors without rebooting the whole edison board.This is because when we are running the I2C sensors all at a time by using external power supply only,when we are disconnecting or adding some of the sensors they are not responding immediately i.e,the devices addresses are not detecting according to the device,when we reboot the board they can be detected .But we don't want to reboot frequently as we are using some network configuration files and they will be lost if we reboot by the hardware.

       

      we tried to kill the processes after the process is completed but I think killing the process is not the right option without rebooting.

       

       

      Here the sensors are optional,but for any other operation how can we reboot only some processes without rebooting the whole edison board???Hope the answer would be useful.Any or every reply is appreciated.

       

       

      Thanks and Regards,

      Radhika.

        • 1. Re: Reg:The soft reset of Intel edison board
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hi Radhika,

          If you wish to restart a service in the Edison you can use systemctl. In the Edison, you can look at the services with ls /lib/systemd/system. To restart a service type systemctl restart <service_name>.

          Let us know if this approach works for you.

          -Sergio
           

          • 2. Re: Reg:The soft reset of Intel edison board
            Radhika.k

            Hi Sergio,   

             

                      Thanks for the reply,I have my script file in /home/root/demo/edison_script.sh and created the service in ls /lib/systemd/system and my service file consists of

            [Unit] 

            Description=edison_script.service 

            After=network.target 

            [Service] 

            ExecStart=/home/root/demo/edison_script.sh

            Restart=always 

            [Install] 

            WantedBy=multi-user.target

            As I'm using the I2C commands in the script file,I have tried the way to kill the process by the command 

            sudo kill -9 `ps | grep edison_script.sh | awk '{print $1}'` and the process is killed after that restarting the service using

            systemctl daemon-reload

            systemctl restart edison_script.service

            systemctl status edison_script.service

            but the status of my service is failed and is inactive(dead) although it is running in the other terminal.Even I tried without killing the process the status is that it is not loaded.

             

            The edison_script file consists of

            #! /bin/sh

            echo "I2C script"

            echo 28 > /sys/class/gpio/export|echo 27 > /sys/class/gpio/export|echo 204 > /sys/class/gpio/export|  echo 205 > /sys/class/gpio/export |

            echo 236 > /sys/class/gpio/export |echo 237 > /sys/class/gpio/export|echo 14 > /sys/class/gpio/export |echo 165 > /sys/class/gpio/export|  echo 212 > /sys/class/gpio/export|echo 213 > /sys/class/gpio/export |echo 214 > /sys/class/gpio/export |

            echo low > /sys/class/gpio/gpio214/direction|echo low > /sys/class/gpio/gpio204/direction | echo low > /sys/class/gpio/gpio205/direction |

            echo in > /sys/class/gpio/gpio14/direction|echo in > /sys/class/gpio/gpio165/direction|echo low > /sys/class/gpio/gpio236/direction| echo low > /sys/class/gpio/gpio237/direction|echo in > /sys/class/gpio/gpio212/direction |echo in > /sys/class/gpio/gpio213/direction|

            echo mode1 > /sys/kernel/debug/gpio_debug/gpio28/current_pinmux |echo mode1 > /sys/kernel/debug/gpio_debug/gpio27/current_pinmux|

            echo high > /sys/class/gpio/gpio214/direction

            i2cdetect -r 6

                                     I'm not knowing how to approach to my problem.Is there any way to approach to soft reset.Are there any changes in the service file in system.??Or should I go for another Service in /lib/systemd/system?If I should go to another service ..which service for I2C should be restarted.??Can I configure GPIO pins to restart the process??(not only for I2C)

                                     Please let me know the process to soft reset the edison only for some processes without effecting the other files in edison.Hoping the positive result from you.

             

             

            Thanks and Regards,

            Radhika.

            • 3. Re: Reg:The soft reset of Intel edison board
              Intel Corporation
              This message was posted on behalf of Intel Corporation

              Hi,

              Could you try to run the systemctl commands one by one to check if each individual command is working as expected? While the service is running, use systemctl status unit to check if it’s on. Then, reload the service. You can check the various options here https://www.freedesktop.org/software/systemd/man/systemctl.html . Try with systemctl reload unit and systemctl daemon-reload options. After each, check with the systemctl status unit option again to see if the service restarted successfully. You can post screenshots of systemctl status unit output after each command is entered to see how the service is behaving. Once you confirm you’re using the right commands you can add the systemctl commands to the edison_script.sh file.

              We’ll be waiting for your response.

              -Sergio
               

              • 4. Re: Reg:The soft reset of Intel edison board
                Radhika.k

                Hi Sergio,

                                    Yes,I have tried the systemctl commands individually and I'm seeing the same error again ...I'm pinning the screenshots below..systemctl_final.pngsystemctl_restart.png

                 

                My service file consists of

                [Unit] 

                Description=edison_script.service 

                After=network.target 

                [Service] 

                ExecStart=/home/root/demo/edison_script.sh

                Restart=always 

                [Install] 

                WantedBy=multi-user.target

                 

                My edison_script.sh file has

                #! /bin/sh

                echo "I2C script"

                echo 28 > /sys/class/gpio/export|echo 27 > /sys/class/gpio/export|echo 204 > /sys/class/gpio/export|  echo 205 > /sys/class/gpio/export |

                echo 236 > /sys/class/gpio/export |echo 237 > /sys/class/gpio/export|echo 14 > /sys/class/gpio/export |echo 165 > /sys/class/gpio/export|  echo 212 > /sys/class/gpio/export|echo 213 > /sys/class/gpio/export |echo 214 > /sys/class/gpio/export |

                echo low > /sys/class/gpio/gpio214/direction|echo low > /sys/class/gpio/gpio204/direction | echo low > /sys/class/gpio/gpio205/direction |

                echo in > /sys/class/gpio/gpio14/direction|echo in > /sys/class/gpio/gpio165/direction|echo low > /sys/class/gpio/gpio236/direction| echo low > /sys/class/gpio/gpio237/direction|echo in > /sys/class/gpio/gpio212/direction |echo in > /sys/class/gpio/gpio213/direction|

                echo mode1 > /sys/kernel/debug/gpio_debug/gpio28/current_pinmux |echo mode1 > /sys/kernel/debug/gpio_debug/gpio27/current_pinmux|

                echo high > /sys/class/gpio/gpio214/direction

                i2cdetect -r 6

                 

                Thanks and Regards,

                Radhika

                • 5. Re: Reg:The soft reset of Intel edison board
                  Intel Corporation
                  This message was posted on behalf of Intel Corporation

                  Hi Radhika,

                  While researching for this case I noticed you have another thread opened that discusses the same issue. I’d suggest for you to continue with support in https://communities.intel.com/thread/105293 .
                  This is done to avoid confusion and threads with duplicate information.

                  Regards
                  -Sergio