hmmm maybe you have an oldish version of the codebase. It looked like this before:

                       if(belaCapeButton.read() == 0){

again, make it == 1 instead.

Actually now that I think of it you should probably update your Bela code anyhow, or the whole belaconfig stuff may not work.

    giuliomoro You were right, it was "if(stopButton.read()..." - changed value to 1. Have to reattach to Pepper to see what it does, bare with me...

    After the stopButton.read change in PRU.cpp IDE starts up, but fails to run, in single patch mode i get this:

    Nov 03 17:17:22 bela stdbuf[969]: Button pressed, quitting
    Nov 03 17:17:22 bela stdbuf[969]: make: warning: Clock skew detected. Your build may be incomplete.
    Nov 03 17:17:22 bela stdbuf[969]: make: Leaving directory '/root/Bela'
    Nov 03 17:17:23 bela systemd[1]: bela_startup.service: Service hold-off time over, scheduling restart.
    Nov 03 17:17:23 bela systemd[1]: Stopped Run Bela at boot.
    Nov 03 17:17:23 bela systemd[1]: bela_startup.service: Start request repeated too quickly.
    Nov 03 17:17:23 bela systemd[1]: Failed to start Run Bela at boot.
    Nov 03 17:17:23 bela systemd[1]: bela_startup.service: Unit entered failed state.
    Nov 03 17:17:23 bela systemd[1]: bela_startup.service: Failed with result 'start-limit-hit'.

    Ay. i guess i will return everything to initial state now.

    Bela version is v0.3.8b btw

    Does it run when you run the project from the IDE?

      giuliomoro No, the messages above came from the IDE. It also doesn't matter, if i choose single patch or loop mode. The essage "bela stdbuf[969]: Button pressed, quitting" appears regardless.

      yeah but what if you start a program from the IDE? That's the first step we need to get to work before the rest falls into place.In particular, I would like to make sure that PRU.cpp got rebuilt after your changes. You could do rm /root/Bela/build/core/PRU.o before starting a project and that should force a rebuild of PRU.cpp.

      I did start from the IDE, too. rm /root/Bela/build/core/PRU.o gives me a "no such file or directory"

      and when you start the program from the IDE it should show that it rebuilds PRU.cpp, is that the case?

      Okay IDE is single patch mode is doing something

      Building PRU.cpp...
      ...done
      Linking...
      ...done
      Enabling Bela at startup in a loop...
      project set to run on boot succesfully

      Running several different patches then each say

      Button pressed, quitting
      ...done
      Enabling Bela at startup in a loop...
      Bela stopped
      project set to run on boot succesfully

      All in IDE.

        jayrope Building PRU.cpp...
        ...done
        Linking...
        ...done
        Enabling Bela at startup in a loop...
        project set to run on boot succesfully

        does the project run OK here?

        jayrope Running several different patches then each say

        If the answer above is yes, try cleaning each project and rebuilding it ?

          giuliomoro No, none of the projects run (all PD). Upon running them they load and then quit saying

          Button pressed, quitting
          Bela stopped

          EDIT: This also goes for the PD patches in the examples

          ok, what is the content of /root/.bela/belaconfig at the moment?

          Also i have removed PRU.o again (rm /root/Bela/build/core/PRU.o) to force rebuild PRU.cpp, the rebuild happens, but at last

          Button pressed, quitting
          Bela stopped

          appear again

          ok, what is the content of /root/.bela/belaconfig at the moment?

          My bad. It was empty !!!"§$%&/&%$§

          now has "CL=--stop-button-pin 86 " in it, trying IDE again [...]

          • Single patches WORK although buggy in patch (maybe PD-related), Button 23 now simply turns the patch off, but doesn't restart them again.
            So that's equivalent to a Bela shutdown i guess, BBB stays on.

          • loop mode then [...] just hangs in blinking LED ... after restart loop mode plays only from IDE, then shuts down Bela and BBB upon button 23 press. After two restarts loop plays last chosen in IDE then shutsdown everything with button.

            jayrope Single patches WORK although buggy in patch (maybe PD-related), Button 23 now simply turns the patch off, but doesn't restart them again.

            try a simple C++ example

            jayrope loop mode then [...] just hangs in blinking LED

            Hmmm not sure what LED blinking at what stage, could you clarify ? Also, do you get any log in the IDE when you ope nit up after it "hangs in blinking LED" ?

            In IDE: Both C++ and PD work in principal.
            However using the button shuts them down, and the patch doesn't restart. I can however restart from the IDE.

              I kind of hate to waste your evening with this. Should we continue this tomorrow? In principal using a Pepper button to shut a patch down does work. Question now would be how restart the same patch, when in single patch mode, or better how to start the next patch in the list, when in loop mode.

              (side note: i somehow forgot how to quote in here)

              EDIT: Idealistically the button would restart the same patch again, when pressed again, or then start the next patch, when in loop mode.

                jayrope However using the button shuts them down, and the patch doesn't restart. I can however restart from the IDE.

                brilliant! And also expected behaviour: when starting a patch in the IDE it is always in single-shot mode: you start it from the IDE and you stop it either from the IDE or with the Button.

                jayrope the button would restart the same patch again, when pressed again

                If a single patch is set to start at boot, pressing the button for less than 2 seconds should do just that: stop the current patch. systemd will then automatically restart it.

                jayrope or then start the next patch, when in loop mode.

                When set to run `loop_*" patches at boot, when one stops the next one will start, so pressing the button should stop the current one - as usual - and then the script should run the next one.

                jayrope (side note: i somehow forgot how to quote in here)

                Select the text and a little "quote" popup should pop up. Make sure you click-drag when selecting because sometimes doing triple click to select a full paragraph doesn't show the popup.