for testing purposes, you can run the built project from the command line in a terminal, e.g. assuming your project is called HID, after you build it in the IDE, you'd do:
/root/Bela/projects/HID/HID
Then keep using the IDE for your .scd
file. If this goes well, you should then make systemd
service out of your program.
Here are some instructions from a WIP knowledge base article:
You need to create a file /lib/systemd/system/hid.service with this content (making sure the project name matches your project name):
[Unit]
Description=HID to OSC Launcher
After=network-online.target
[Service]
ExecStart=/root/Bela/projects/HID/HID
Type=simple
Restart=always
RestartSec=1
WorkingDirectory=/root/Bela/projects/HID
Environment=HOME=/root
KillMode=process
[Install]
WantedBy=default.target
This can be done from the terminal or by creating a file hid.service
in your project (make sure the file includes only the text above and none of the automatically-generated content in the file you create) and then linking it into place by running ln -s /root/Bela/projects/O2O/hid.service /lib/systemd/system/hid.service
in the Bela IDE console.
You can then start the programme running in the background with systemctl start hid
in the console of the IDE. You can stop the programme with systemctl stop hid
. Once the programme is running in the background you should be able to send OSC messages to it like before and see the results on the screen.
While this programme is running in the background, you can visualise the processβs output with journalctl -fu hid
(if executing the command from the Bela IDE console, use journalctl -n 20 -u hid | cat
instead). Once you verify it is working, you can open a different Bela project and try to send OSC to it from the Bela project instead of the host.
Once you are happy with how this working and would like to embed your project you can enable the hid
service to start automatically in the background at boot with systemctl enable hid
. Later you can disable it with systemctl disable hid
.