REXYGEN Community Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Login

    Run Linux command

    REXYGEN Studio
    2
    5
    270
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      MikeyH
      last edited by

      Hi All,

      I have a python script running on a RPi, if the RPi shuts down I have a service call to restart the script, but it doesn't always work. The script is for modbus comms between the RPi and another device.

      Is there a way I can run the script from within REXYGEN? I've tried the EPC block and can't seem to get it to work. Have I done something wrong or there there a better way?

      44c6e906-55d6-41c2-91cc-6ca6cfbf121c-image.png

      Cheers,
      Mike

      cechuratC 1 Reply Last reply Reply Quote 0
      • cechuratC
        cechurat @MikeyH
        last edited by

        @MikeyH Hi Mike,

        Thanks for your question. I can confirm that using EPC FB is the right way. I don't see anything wrong - maybe just "sudo" is not necessary in this case. Just put the rising edge to the "EXEC" input and it should run the command.

        Does the System log say anything?

        Cheers,
        Tomas

        M 1 Reply Last reply Reply Quote 0
        • M
          MikeyH @cechurat
          last edited by MikeyH

          @cechurat Hi Tomas,

          I had to delete all these highlighted lines. It worked perfectly then.

          4e0bad46-bddd-477a-a0df-285b7ffa2f77-image.jpeg

          Cheers,
          Mike

          cechuratC 1 Reply Last reply Reply Quote 0
          • cechuratC
            cechurat @MikeyH
            last edited by

            @MikeyH Hi Mike,

            thanks for sharing the solution with the community!

            Good luck with your project.

            Cheers,
            Tomas

            M 1 Reply Last reply Reply Quote 0
            • M
              MikeyH @cechurat
              last edited by

              @cechurat Hi Tomas,

              No problem, and thank you for your help as always.

              Cheers,
              Mike

              1 Reply Last reply Reply Quote 0
              • First post
                Last post

              This is a community forum for REXYGEN users and fans. Detailed information can be found at REXYGEN homepage.

              There is also an outdated REXYGEN community forum.

              Powered by NodeBB.