• Software
  • Custom script/project in automatic startup?

I'd like to do the following at startup:

  1. enable wifi
  2. run scsynth

what is the easiest way to set this up officially? is there a way that I can create a "project" in which there is a (shell-)script and then set_startup.sh run_scsynth?

You could run set_startup.sh and then manually edit the file ~/Bela_startup.sh so that it waits for WiFi before starting your program. Note, however, that running set_startup.sh on a SuperCollider project would start sclang, not scsynth. If this is not what you want (e.g.: for the additional overhead or for the longer boot time) then you'll have to edit that part of ~/Bela_startup.sh as well.

as to how to "wait for the WiFi", I would try

while sleep 0.1; do
ifconfig $INTERFACENAME | grep $IPADDRESS && break
done
#....scsynth or sclang
7 days later

Thanks for the pointers! (only now see your answer, somehow didn't get notified...)
for later; if I want to switch between projects, how can I create a project would run a custom script with these settings (e.g. starting scsynth and doing something else...)?

    Not sure I understand the requirements for your script. What should it do ? Is it something you could achieve by simply editing ~/Bela_startup.sh?

    LFSaw (only now see your answer, somehow didn't get notified...)

    Yeah not sure what is happening, I am not getting email notifications either, but yesterday we made a test post to verify this and it worked just fine.

      giuliomoro Not sure I understand the requirements for your script. What should it do ? Is it something you could achieve by simply editing ~/Bela_startup.sh?

      I want to switch between projects with
      make --no-print-directory -C /root/Bela PROJECT=$BBB_PROJECT_NAME startup

      resp.

      set_startup.sh -s projectname

      ok, I'll try it again:

      I would like to have two setups for the BELA I want to swap between.

      1. Script
        • start scsynth with options
        • start custom serial2osc script
      2. Script
        • start scsynth with different options
        • run custom OSC-sending script

      My question is: How can I create two projects (as in the stuff that resides in ~/Bela/projects that contain this functionality?
      Just writing something to ~/Bela_startup.sh will not work since, as I understand it, set_startup.sh -s projectname will write straight over it.

        So,

        LFSaw Just writing something to ~/Bela_startup.sh will not work since, as I understand it, set_startup.sh -s projectname will write straight over it.

        set_startup.sh (or setting a program to startup from the IDE) will overwrite ~/Bela_startup.sh. However, I assume you are not using any of the above, given that you are using scsynth directly, therefore there would be no problem in overwriting the file with your own stuff.

        On the other hand, if you want to be 100% sure, you could just place it in another file and then call that file by editing /etc/init.d/bela. This is where ~/Bela_startup.sh is called.

        You probably want to run the scsynth and your custom serial (or OSC) scripts each in a screen.

        LFSaw I would like to have two setups for the BELA I want to swap between.

        How would you select one or the other script?

          giuliomoro How would you select one or the other script?

          in a perfect world, I can configure/define my script in the .json file in the project and select by using set_startup.sh -s <projectname> (see above).

          Well there is not supported way of doing this through the scripts right now. I guess your best option would be to keep two versions of Bela_startup.sh on your computer and scp them over when you need one or the other (instead of calling set_startup.sh)